Skip to content

Include linter rules on Dart.dev #3064

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

Merged
merged 13 commits into from
May 10, 2021
Merged

Conversation

parlough
Copy link
Member

@parlough parlough commented Mar 13, 2021

The goal is to standardize hosting rule information on dart.dev similar to the analyzer diagnostics. As a result, the style followed implementing this followed closely to that.

Parker's must complete tasks:

Long term tasks for after landing:

  • Flesh out each individual lint documentation, standardizing on a style similar to analyzer diagnostics
  • Update other locations to refer to this link where appropriate
  • Include rule set(s) in the listings in some fashion(need to iterate on designs). This will be important when the recommended rule sets are released.

You can find a staged version of this here:
Last updated 05-09-21
https://parlough-dart-dev.web.app/tools/linter-rules

@google-cla google-cla bot added the cla: yes Contributor has signed the Contributor License Agreement label Mar 13, 2021
@parlough parlough force-pushed the misc/linter-rules branch from 579a23b to 2d5f668 Compare April 25, 2021 20:38
@parlough parlough marked this pull request as ready for review April 25, 2021 21:16
@parlough
Copy link
Member Author

@kwalrath @pq

This is ready for review.

At first, I don't plan to replace the external(analyzer) linkages to this page. The goal is to get this in a good state to merge, then I can incrementally work on the necessary improvements in smaller follow-up pull requests. This gives time to identify issues and will make reviewing easier.

@pq
Copy link
Member

pq commented Apr 26, 2021

This looks great.

fyi @mit-mit as this bears on team-recommended lints.

@parlough: is the json a copy of what's in the linter gh-pages branch?

https://github.com/dart-lang/linter/blob/gh-pages/lints/machine/rules.json

What are your thoughts about keep that all synced up?

@parlough
Copy link
Member Author

parlough commented Apr 26, 2021

@pq Ah that's where the generated file is. I regenerated it manually since I forgot where I found it originally. I will keep it up synced up from there for now, but I'm wondering if we can create a GitHub action(on here or linter repo) with a cron job that checks if the file is updated and makes a commit or PR on this repository.

@pq
Copy link
Member

pq commented Apr 26, 2021

Yeah, some auto-sync would be good. Not sure about automating commits -- never looked into it! Alternatively, you could add a check that just fails the build when they've gone out of sync? (Not as awesome but at least lets you know when things have gone stale...)

@parlough parlough force-pushed the misc/linter-rules branch 2 times, most recently from 748a79f to d7d4000 Compare May 4, 2021 01:07
@parlough
Copy link
Member Author

parlough commented May 4, 2021

Rebased and staged at https://parlough-dart-dev.web.app/tools/linter-rules

Copy link
Contributor

@kwalrath kwalrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a bunch of nitpicky word comments, but I love the way you've organized the page!

@kwalrath
Copy link
Contributor

kwalrath commented May 4, 2021

I don't understand why my review comments appeared in the order they did... but hopefully you can make sense of them.

@parlough parlough force-pushed the misc/linter-rules branch from e2709e9 to f9bcba0 Compare May 9, 2021 19:07
@parlough
Copy link
Member Author

parlough commented May 9, 2021

@kwalrath Thanks for the thorough review and comments, I appreciate them a lot! I went through and included your changes as well as made some other minor adjustments. Please take another look when you get a chance :)

@parlough parlough requested a review from kwalrath May 9, 2021 19:22
Copy link
Contributor

@kwalrath kwalrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I have a question for @mit-mit that should be answered before we ship this page.

For example, some rules are more appropriate for library packages,
and others are designed for Flutter apps.
**Consider starting with pre-packaged linter rules**,
such as those in the [`effective_dart` package][].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mit-mit should we point to https://pub.dev/packages/lints instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning on a follow-up change for once lints has a 1.0.0 version released documenting the different types as well to make all those changes easier to review, but I'd be happy to include them in this PR instead. Just let me know!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I say let's publish this now and file an issue reminding us to update the package!

@kwalrath kwalrath merged commit 8e12011 into dart-lang:master May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Contributor has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants