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

Repeat format step until no more errors are found which can be auto-corrected #2084

Closed
paul-dingemans opened this issue Jun 17, 2023 · 0 comments · Fixed by #2087
Closed
Assignees
Milestone

Comments

@paul-dingemans
Copy link
Collaborator

The order in which rules are executed can be influences with Rule.VisitorModifier. Now the network or rule execution dependencies get more complex, it becomes difficult to find that single order of rules which always resolves all format errors in a single trip. This is confusing for users of kltint.

If format finds any lint violations in a file that can be autocorrected, it should automatically rerun format on that file before returning the lint violations of the last format run. To prevent that a set of rules cause an infinite rerun of the format, no more than 3 reruns will be executed before returning the results.

@paul-dingemans paul-dingemans added this to the 0.50.0 milestone Jun 17, 2023
@paul-dingemans paul-dingemans self-assigned this Jun 17, 2023
paul-dingemans added a commit that referenced this issue Jun 22, 2023
…also can be autocorrected

Closes #2084

Do not require a blank line between the class/method signature and a nested declaration in rule blank-line-before-declaration.

Allow branches with empty blocks in if-else.

Emit violation which can not be autocorrected in case wrapping the operator reference in a binary expression would still violate the max-line-length.

Only emit violation in if-else-wrapping rule in case a newline is missing. An incorrect indent should not lead to a violation about a missing newline.

Swap the order in which the binary-expression-wrapping and argument-list-wrapping rules run. Binary expressions containing call expressions, or vice versa, are not autocorrected as it needs manual intervention whether it is better to wrap the operation reference or the argument value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant