Skip to content

Consider using pedantic as a baseline for linting? #459

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

Closed
pq opened this issue Dec 12, 2018 · 13 comments · Fixed by #492
Closed

Consider using pedantic as a baseline for linting? #459

pq opened this issue Dec 12, 2018 · 13 comments · Fixed by #492

Comments

@pq
Copy link
Member

pq commented Dec 12, 2018

Currently there's a hand-crafted list of enforced lints:

https://github.com/dart-lang/pana/blob/master/lib/src/analysis_options.dart

It would be cool to migrate to the pedantic package rule-set and be able to badge projects "pedantic" clean or something.

FWIW we're tagging pedantic and flutter user lints now in the generated docs like so:

image

(The flutter badge corresponds to lints in flutter user options.)

/cc @isoos @kevmoo @jonasfj

@pq
Copy link
Member Author

pq commented Dec 12, 2018

fyi @davidmorgan

@isoos
Copy link
Collaborator

isoos commented Dec 12, 2018

We had similar discussion a few months back, and I agree with @mit-mit's comment here: "If we think this flag is high value, why is it not on by default [in dartanalyzer]?"

Copying and applying Flutter's defaults is fine, we also try to match stagehand's defaults, but other than that, these lints are optional, and we should treat them as such. If they provide better code quality, then their place is in dartanalyzer.

@pq
Copy link
Member Author

pq commented Dec 12, 2018

I guess that raises the question then of why lint at all. FWIW I don't think the rules provided as an example in the stagehand template were very thoughtfully considered (and needless to say I'm certain they are not being actively maintained or reviewed). As for @mit-mit's comment, I think analyzer flags are a little different than lints but I totally agree with the sentiment. Many lints are lints (and not hints / warnings) for mainly historical reasons. Someday we may get around to rationalizing what is where but that's a conversation that's started and ultimately stalled at least a few times in the last 5 years (@bwilkerson: or more?).

As another thought, what if being pedantic clean earned you extra credit in scoring? 😉

@pq
Copy link
Member Author

pq commented Dec 12, 2018

FWIW I don't think the rules provided as an example in the stagehand template were very thoughtfully considered (and needless to say I'm certain they are not being actively maintained or reviewed).

Ok, whoops. I should have looked before I spoke.

https://github.com/dart-lang/stagehand/blob/master/analysis_options.yaml

is actually pretty fleshed out thanks to recent changes from @kevmoo. Notably, it is a superset of pedantic... As it's pretty opinionated, I'm not sure we want this as a standard for scoring or not?

@isoos
Copy link
Collaborator

isoos commented Dec 12, 2018

https://github.com/dart-lang/stagehand/blob/master/analysis_options.yaml

I meant the ones that are created by default in the simple project template:
https://github.com/dart-lang/stagehand/blob/master/templates/package-simple/analysis_options.yaml

The goal is that if a developer follows the recommended tool's defaults, we should gave it the max score.

@pq
Copy link
Member Author

pq commented Dec 12, 2018

Ah, right. Good point. In that case my original thought is actually little more relevant. The rules in that template haven't been changed for over a year.

image

The goal is that if a developer follows the recommended tool's defaults, we should gave it the max score.

Regarding this, if pedantic compliance isn't something we want to count in the score, could we still consider some kind of a vanity badge? As these are the emerging Google Dart standards, I think it would be good reinforcement if we called them out somehow.

Thanks for the back and forth!

@jonasfj
Copy link
Member

jonasfj commented Dec 13, 2018

I like the idea of a vanity badge :)

@pq
Copy link
Member Author

pq commented Dec 18, 2018

I like the idea of a vanity badge :)

#463

fyi @mit-mit

@pq
Copy link
Member Author

pq commented Jan 23, 2019

Cycling back to this, as of dart-archive/stagehand#594, stagehand is now using package:pedantic for all of its templates. 🤘

Can we update pana to follow suit?

@kwalrath
Copy link

We haven't quite updated stagehand yet... I'll prepare a release so we can publish it.

@isoos
Copy link
Collaborator

isoos commented Jan 23, 2019

Sure, we shall follow that.

@kwalrath
Copy link

kwalrath commented Jan 23, 2019

The stagehand release is prepped, but I'd like to update the analysis options docs before I publish stagehand. dart-lang/site-www#1322

@kwalrath
Copy link

kwalrath commented Jan 30, 2019

And the doc change is finally out! I've published stagehand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants