-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Document machine/rules.json #55977
Comments
If we intend the file to be public, I'll recommend adding a version number to the format, so that we can change the format in the future, and tools depending on the file can tell that they're not compatible with the new format. If the file is not intended to be public, consider adding a notice, maybe: {
"_NOTICE:_": "This file is for internal use by the SDK. Format may change without notice.",
"lints": ... current content ...
} (Oh why does JSON not have comments!) |
/fyi @parlough |
I don't think we intend for it to be public, or to have to consider versioning or consider any change to it a "breaking" change. |
Oh very cool! In that case I like the versioning suggestion. |
I believe this rules.json file is being used by @gaetschwartz to produce the all_lint_rules_community package. Does the Dart team produce an alternative? I absolutely love having all of the lint rules turned on by default, with some that I turn off. I catch so many problems in my code doing that. |
Not directly hosted on the site, but it's mirrored at https://github.com/dart-lang/site-www/blob/main/src/_data/linter_rules.json and used to generate the the linter rule docs that are indexed at https://dart.dev/tools/linter-rules#rules.
Currently the The final form of its replacement hasn't been decided yet, but I'll update here when it is ready and will keep in mind the use cases outlined here as well as any potential versioning concerns. |
Thanks @parlough! |
Cool, @srawlins. Thanks. Is that kept up to date with every new lint as they're created? |
Slight correction. I'd actually use: https://github.com/dart-lang/sdk/blob/main/pkg/linter/example/all.yaml (The linter repo is stale.) It should be kept up to date. (There used to be tests but I'll double-check.) PS: Hi Chris! |
hey Phil (@pq)! long time! we should grab some lunch sometime soon! |
I'll also add that https://dart.dev/lints/all has a list of all lints available on stable in the |
Please document this generated file: https://github.com/dart-lang/sdk/blob/main/pkg/linter/tool/machine/rules.json
Preferably in one (or both) of these pages:
I'm thinking just something like "you can view all the rules as JSON here" where "here" is a link to the raw file (so people can
curl
the linked page and get a JSON file). No need for documentation beyond that (people will either have a need for that file or not).I've been wanting a file like this to work with, but I didn't know it existed.
My use case: as part of a side project I'm working on, I'm trying to create a command-line tool that generates an
analysis_options.yaml
file that hasinclude package:flutter_lints/flutter.yaml
and also adds a rule underrules
for every existing rule that meets the following criteria:flutter_lints
flutter_lints
The goal is to make it easy for me to create a new Dart/Flutter project with a strict set of lints that is a superset of
flutter_lints
. I can then go through the lints listed in the generated file and remove the few that I don't want or conflict. This would be easier than going through the entire list of lints that Dart supports.Here is another use case I found that might benefit from machine/rules.json: VeryGoodOpenSource/very_good_analysis#100
Now that I know the file exists, this issue is:
The text was updated successfully, but these errors were encountered: