-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Lint request: A single "set" of "effective Dart" lints #32612
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
Comments
FWIW, Flutter has a pair of "recommended" analysis options files, one for people who want an easy-go-lucky style (the default for |
Definitely! |
related #57153 |
We've recently been trying to take analysis options more seriously at my workplace, and have run into the same kinds of issues. Turning on a new lint requires a lot of vetting to make sure that it works with our code base, and we've had to give up on several lints because of false positives or the sheer number of times we violate the lint in existing code. Sharing the lints we've vetted is also problematic, as pretty much all we can do is post a set of "standard" lints and tell people to check back for updates occasionally. In that light, I'm all for this request! However, there's a couple things that worry me about
Rather than adding a |
You can include one analysis options file in another by having a top level key of I suspect that facility satisfies this issue, so I'm closing it. |
Yes, that satisfies my use case, and works great in a quick experiment (though it's Also, is the Edit: Specifically, I'd expect |
I didn't find any documentation for it, no. |
Is the expectation that we should start recommending people write |
No. Neither the command-line analyzer nor the analysis server support The expectation is that the Angular package could contain one or more standard options files just like the Flutter package does and that users can use a |
makes sense, I don't think we need changes in the analyzer to support it in that case, but it's probably worth keeping this issue open as a request to ship such a file in the SDK. Angular Dart wouldn't own the "effective dart" lint set. I'd also be fine moving this issue to dart-lang/linter as a request to ship the file there. It would not be a big issue, I think, to add a dependency on that package to pick up the canonical lint sets. Versioning would be easier if it were in the SDK though since we could validate that the lints are compatible with the version of the linter package in use, not the one in the pub solve. |
Ok, I've re-opened it.
Yeah, that would be harder to do. The only URIs for referencing things in the SDK are the
I like that idea better than special casing some |
There is now a "google.yaml" file defining the lints used at Google. I believe that should satisfy this request. Please re-open if there's something I'm missing. |
Forked from #32596 (comment).
AngularDart (and internally at Google) requires a better process for identifying, testing, and using lints than the one currently used right now (i.e. many varied contributions without requirements they conform with the style guide - often they are inventing style guide requirements that do not exist).
i.e. I'd like to be able to write (or similar):
Internally, we might need a transitional set of lints that are not quite all of them:
Here are our requirements:
google
andgoogle-relaxed
. It's likely most of these lints already exist, but we should double check the implementations. We'd be linting 10s of millions of lines of code, so we need the quality bar to the extremely high (internally lints with a false-positive rating of >=0.5% are automatically disabled).prefer
) need to be excluded on existing code - i.e. we don't want to force teams to have to write hundreds of// ignore: x_x_x
because they didn't follow an optional rule.Nice to have externally (we do this internally already):
4.
above, anyway, because otherwise we wouldn't have context on whether code is "new" or not./cc @JekCharlsonYu., @davidmorgan (who is working on internal linting).
The text was updated successfully, but these errors were encountered: