-
Notifications
You must be signed in to change notification settings - Fork 442
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
Linting - API #2149
base: feat/prepare-for-lint-take-2
Are you sure you want to change the base?
Linting - API #2149
Conversation
…rbidden characters." This reverts commit 9afa6dd.
…on't call it in the "special" way.
6f92ad7
to
a94dce9
Compare
…for easy API conversion.
…oser to the old behavior.
…) gets stored into every slot of `ValuePerStep` per invocation.
…at` calls and `lint` calls.
} | ||
|
||
public static Lint create(String code, String msg, int lineStart, int lineEnd) { | ||
if (lineEnd < lineStart) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given lineNumberFor
, lineNumber=-1
could be given a specific semantic (e.g. somewhere_undefined
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good call, it's probably a mistake to pretend that every Lint knows the range that it applies to.
Spotless is still primarily a formatter, not a linter. But when formatting fails, it's more flexible to model those failures as lints so that the formatting can continue. For example, issues like
spotlessCheck
could add comments and suggested fix to GitHub PR #655are difficult to resolve with our current model, because the only channel we have to communicate with the user is "this is the formatted content". Now we have two channels: "this is the formatted content" and "these are the problems we had".
At this point, the purpose of these lints is just to do formatting better. They are an implementation detail. If people start submitting PRs for more linters, perhaps it will turn into something more. Who knows!