-
Notifications
You must be signed in to change notification settings - Fork 118
migrate template defaults to use package:pedantic for lints #594
Conversation
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.
lgtm, so far
I'm on the fence about using the actual I'd rather we copy-paste the lints in the file w/ a link to the pedantic repo. |
I hear you. On the other hand:
|
Thanks. There is an upside to depending on pkg:pedantic, but then we have the discussion about "do we pin the version or set a range". If we pin it, then we have to explain why we pin it. If we set a range, then 'pub upgrade' may add new lint warnings, which is weird. I think leaving it to the user to add the dependency is goodness |
@kevmoo: that's my thinking too. I totally punted on pinning and that's probably OK. Should we at least include the pedantic version we're deriving from in the comment? Maybe something like:
Back to pinning, maybe we could add a breadcrumb in the pubspec:
/fyi @davidmorgan. |
Great idea!
…On Fri, Jan 18, 2019 at 11:04 AM Phil Quitslund ***@***.***> wrote:
@kevmoo <https://github.com/kevmoo>: that's my thinking too. I totally
punted on pinning and that's probably OK. Should we at least include the
pedantic version we're deriving from in the comment? Maybe something like:
# Google-default lint rules as defined in package:pedantic (v1.4.0).
# See: https://github.com/dart-lang/pedantic for details and the latest
# ruleset.
Back to pinning, maybe we could add a breadcrumb in the pubspec:
dev_dependencies:
# include the latest pedantic rules
# pedantic: ^1.0.0
# alternatively, pin to a specific version, if you want to ensure that newly added rules can't break us
# pedantic: 1.4.0
/fyi @davidmorgan <https://github.com/davidmorgan>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#594 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCigFlO2K6l_y3pqjN3yUHMEhqE2GFks5vEhq7gaJpZM4aDuUM>
.
|
Great. I updated one template: https://github.com/dart-lang/stagehand/pull/594/files#diff-79e948527db3596d41d525bb56aae0cb If folks approve, I'll go ahead and update the rest. Thanks! |
My vote would be for @pq's original proposal: just import In this way newbies get the default set of lints out-of-the-box; a list that is continually updated and curated by expert Dart users (mainly based, I assume on internal projects). Power users will know how to twiddle things :) to their liking, including if/when to pin a package to a version or not. I don't like the non-DRY suggestion of having a comment like "Google-default lint rules as defined in package:pedantic (v1.4.0)" and then duplicating the pedantic list (from one specific point in time). That is just more maintenance for us down the line. My 2 cents :) |
Yeah, this does keep things nice and simple. |
VS having these out of sync w/ pedantic, I'll take the import. Proceed!
…On Fri, Jan 18, 2019 at 12:42 PM Devon Carew ***@***.***> wrote:
My vote would be for @pq <https://github.com/pq>'s original proposal:
just import pedantic.
Yeah, this does keep things nice and simple.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#594 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCiuXmZsJk_uHe8svuzl3h4ZaVRR-uks5vEjG9gaJpZM4aDuUM>
.
|
OK! Updated to the first proposal and maybe ready to go? PTAL. Word-smithing welcome. |
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.
LGTM
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.
Overall LGTM. I'll let @kwalrath have the final word w.r.t. word-smithing :)
Looks good, thanks! |
@kwalrath : any thoughts on wording (or otherwise)? |
Looking now... |
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.
Once you remove the unneeded semicolon before the URL (in all pubspec copies), LGTM.
templates/analysis_options.yaml
Outdated
@@ -1,14 +1,14 @@ | |||
# Defines a default set of lint rules enforced for | |||
# projects at Google. For details and rationale, | |||
# see: https://github.com/dart-lang/pedantic#enabled-lints. |
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.
see: -> see
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.
Fixed. Thanks!
Migrates templates to use the
package:pedantic
lint rule set.I started with just one options file to keep word-smithing / bike-shedding in one place. When we're happy with it, I'll update the others before proposing to land.Ready for review.
Additional context: https://github.com/dart-lang/linter/issues/1365.
Fixes #593.
/cc @kwalrath @kevmoo @chalin