-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
[FR]: Should keep-sorted by a formatter? #480
Comments
Take a look at the root README where I lay out the principles of format vs. lint. In particular formatters are never allowed to change the program's behavior, so that we can hook them into a DX where developers have no choice, and it's safe to apply them blindly across a whole repo including other teams' legacy code. |
I should add, yes it's frustrating under my formulation that you need your |
Ok, I see - yes I understand that keep-sorted is not safe enough to be used as a formatter. Perhaps the easiest way would be to instead integrate it into the editor (outside of bazel) so that every file can be "linted" as such. Unfortunately there doesn't seem to be any editor extensions doing that at the moment (at least for vscode). Will look into it! |
Maybe you can simply |
What is the current behavior?
Keep-sorted is currently integrated as a linter, not as a formatter.
Describe the feature
Should keep-sorted by a formatter instead of a linter? My motivations are:
bazel lint
works on bazel targets, I cannot lint a random file. But often I would need // keep-sorted on files which are not in any bazel targets, e.g.devcontainer.json
to sort the list of extensions, orpyproject.toml
to sort the list of linting tools, etc.Let me know if you think this makes sense!
The text was updated successfully, but these errors were encountered: