Skip to content
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

Remove dependencies on discouraged-comment-location rule #2367

Closed
paul-dingemans opened this issue Nov 19, 2023 · 0 comments · Fixed by #2371
Closed

Remove dependencies on discouraged-comment-location rule #2367

paul-dingemans opened this issue Nov 19, 2023 · 0 comments · Fixed by #2371

Comments

@paul-dingemans
Copy link
Collaborator

paul-dingemans commented Nov 19, 2023

Rule discouraged-comment-location intended to make implementation of rules easier as certain 'unusual' comment locations do not have to be taken into account as they will have been blocked before those rules.

Disabling the rule however also forces users to disable other rules as well (for example see #2338). With the number of rules and the number of locations which are forbidden, this becomes more and more a useability problem for certain users. Disabling the discourages-comment-location rule for a specific type of comment location has the effect that all rules that depend on that rule have to be disabled as well.

Preferably a rule can handle comments in any possible location. If that for some reason is not possible, the comment location has to be blocked in that rule itself so that the rule does not need to depend on the discouraged-comment-location rule. Once, all ktlint rules have been migrated, the rule can not be removed until ktlint 2.x as other rule sets might depend on the rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant