You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This one is also enforced in the AS formatter via changes to the shared IDEA config file.
Operators need to appear before a wrapped line, not after:
prependToLog("error: " + event.error.type + "Some more text here: " +
event.error.message)
This is, sadly, the opposite of our rule for Java (which is a checkstyle default), which forces the operators to appear at the beginning of the new line. There's some hope that this may be addressed in the future, but for now we'll have to live with the inconsistency.
For a more substantial demo of the changes, see eabb35b, which applies the new rules to the woocommerce-store branch. (These changes have now been added to this branch.)
Hey @aforcier.
Just in case you missed pinterest/ktlint#163:
+/- is wrapping is unlikely to change due to the following - pinterest/ktlint#163 (comment).
I know it's different from checkstyle's OperatorWrap default but there is little we can do (as unfortunate as it is).
Thanks @shyiko! Yes I read that, I was hopeful that the Android style guide might end up deciding to keep at least &&, || on the break-before-operator behavior, and make +/- exceptions since there's the unary operator problem. (In which case ktlint would probably be updated to reflect that, per your comment.) I probably should have used && in my example above since + probably won't change 😀
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates
ktlint
to0.21.0
and fixes new style violations introduced.Main changes:
This one is also enforced in the AS formatter via changes to the shared IDEA config file.
This is, sadly, the opposite of our rule for Java (which is a checkstyle default), which forces the operators to appear at the beginning of the new line. There's some hope that this may be addressed in the future, but for now we'll have to live with the inconsistency.
cc @maxme