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
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 using ij_formatter_off_tag and ij_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 IDE
Additional information
Current version of ktlint: 0.40.0
The text was updated successfully, but these errors were encountered:
This should be marked as an enhancement. The request seems very valid to me although I do not use those markers myself.
In case .editorconfig property ij_formatter_tags_enabled is true than handle tag ij_formatter_off_tag same as ktlint-disable and ij_formatter_on_tag same as ktlint-enable. This only requires a change in the SupressedRegionLocator.
However this should only be done after the Indent rule has been refactored and no longer works on the entire file (see #631).
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: