-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following ij_formatter_{off,on}_tag pair #1163
Comments
This should be marked as an enhancement. The request seems very valid to me although I do not use those markers myself. In case However this should only be done after the Indent rule has been refactored and no longer works on the entire file (see #631). |
Duplicates #670 |
At the moment ktlint has the per-line
// ktlint-disable
marker comments for disabling rules, which is nice.Currently, I write my code with IntelliJ IDEA, that offers the notion of formatter off and formatter on tag pair, which default to
//@formatter:off
and//@formatter:on
comment pairs. These values may also be configured in an EditorConfig file usingij_formatter_off_tag
andij_formatter_on_tag
keys.In my code, I have some very long lines with some look-up data, like lists/maps of hundreds of static values, which I deem aren't really that important to be visible at once, for them to follow the
max_line_length
value set using EditorConfig value. I'll wrap those blobs of code with the formatter off/on pair, and IDEA won't auto-format them for me.For ktlint, I have to insert additional
/* ktlint-disable max-line-length */
and/* ktlint-enable max-line-length */
comment pair around the the no-format block, which seems redundant.Could there be a possibility to obey the no-formatting tags or define a set of no-format boundaries keys setting for using non-
ktlint-disable
?Expected Behavior
ktlint would obey existing/provide additional no-format boundary comments
Current Behavior
Additional
// ktlint-disable max-line-length,...
needs to be added for each row inside already in the no-format block for the IDEAdditional information
The text was updated successfully, but these errors were encountered: