-
-
Notifications
You must be signed in to change notification settings - Fork 257
fix: Linter issues #52
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
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.
Commented on the reasons why I ignore some of the linter's suggestion.
I'd appreciate in some advise on the way to go there
@@ -891,10 +893,12 @@ class Runtime { | |||
final String rawDescription; | |||
|
|||
const Runtime({this.key, this.name, this.version, this.rawDescription}) | |||
// ignore: prefer_is_empty |
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.
If the prefer_is_empty
suggestion is taken here it fails with Invalid constant value.dart(invalid_constant)
.
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.
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.
Sounds like a gap in the language. /cc @lrhn @leafpetersen @eernstg
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.
Sorry, .length
is literally called out specially in the spec as one of the only things you're allowed to do in constants. Expanding the scope of what you can do in constants is a frequent request, so noted.
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.
Ah, then it's a linter issue. The linter should not be in a conflict with the language. Which quickly led me to https://github.com/dart-lang/linter/issues/1719
CI is green but doesn't update here, travis' web hooks probably broken. |
@yjbanov Would you please code review? Thanks! |
Triggering the CI webhook again |
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.
Alternatively, we could pull some lints from analysis_options.dart
in the flutter/flutter repo. This way this repo and flutter/flutter would use the same code style.
Leaving it to your taste.
I'll read up on the linting rules and file a PR. Thanks for the hint! |
@bruno-garcia How would you like to proceed w.r.t. which rules to apply? Do you want to submit this as is and update the linter rules in a separate PR? Or would you like to adopt Flutter's analysis options in this PR? |
@yjbanov if it's OK with you I'd merge this in to get rid of the warnings first. We can discuss the linting rules to be brought in (I just scrolled over the rules file so far) on a separate PR? |
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
With Flutter/Dart:
Running
./tool/presubmit.sh
printed:After the changes:
+ dartanalyzer --fatal-warnings ./ Analyzing sentry-flutter... No issues found!