Skip to content
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

fix(lints): enable linter rules #191

Closed
wants to merge 1 commit into from

Conversation

aman-singh7
Copy link
Member

Fixes #149

Describe the changes you have made in this PR -
In the previous pull requests of this issue, linter rules are fixed and removed from analysis_options.yaml. They must be marked as true to enable them.

Screenshots of the changes (If any) -

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

@coveralls
Copy link

coveralls commented Jan 14, 2022

Pull Request Test Coverage Report for Build 1699690424

  • 10 of 14 (71.43%) changed or added relevant lines in 9 files are covered.
  • 8 unchanged lines in 7 files lost coverage.
  • Overall coverage remained the same at 71.894%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/ui/views/ib/ib_landing_view.dart 0 1 0.0%
lib/ui/views/projects/edit_project_view.dart 0 1 0.0%
lib/ui/views/groups/my_groups_view.dart 4 6 66.67%
Files with Coverage Reduction New Missed Lines %
lib/models/ib/ib_showcase.dart 1 5.26%
lib/ui/views/contributors/components/contributors_donate_card.dart 1 84.21%
lib/ui/views/contributors/components/contributors_support_card.dart 1 94.44%
lib/ui/views/home/components/feature_card.dart 1 93.33%
lib/ui/views/projects/project_preview_fullscreen_view.dart 1 0%
lib/ui/views/teachers/components/teachers_card.dart 1 94.74%
lib/ui/views/ib/components/ib_pop_quiz.dart 2 0%
Totals Coverage Status
Change from base Build 1698075440: 0.0%
Covered Lines: 3860
Relevant Lines: 5369

💛 - Coveralls

constant_identifier_names: false
always_declare_return_types: true
Copy link
Member

Choose a reason for hiding this comment

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

rules are by default enabled unless explicitly disabled.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope. You can see the changes. Earlier when these rules are not mentioned as true there were no issue otherwise CI would fail at the flutter analyze . step.

Copy link
Contributor

Choose a reason for hiding this comment

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

The default rules and requirements are already enabled. Explicitly enabling more rules would cause more errors and stricter rules for building.

Copy link
Member Author

Choose a reason for hiding this comment

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

Linters are basically meant for that only to enforce best practices. And I am not explicitly enabling rules from my side, the above was mentioned in the issue.

Copy link
Member

Choose a reason for hiding this comment

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

Nope. You can see the changes. Earlier when these rules are not mentioned as true there were no issue otherwise CI would fail at the flutter analyze . step.

So, you are saying that if any rule is not set to be true. By default they are not checked by linter ?

Copy link
Member

@manjotsidhu manjotsidhu Jan 16, 2022

Choose a reason for hiding this comment

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

So this confusion everyone had, you are right that we have to enable them as the specs of analyzer is designed in this way.

But actually, I meant that you don't need to write enable statements since they are already included by flutter_lints package (check include statement in analysis_options.yaml:1) and in turn flutter_lints uses dart-lang/lints's recommended linter rules.

I hope that clears the doubt ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@manjotsidhu

So this confusion everyone had, you are right that we have to enable them as the specs of analyzer is designed in this way.

But actually, I meant that you don't need to write enable statements since they are already included by flutter_lints package (check include statement in analysis_options.yaml:1) and in turn flutter_lints uses dart-lang/lints's recommended linter rules.

I hope that clears the doubt ?

Yeah, got it @manjotsidhu. So, I am closing this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope. You can see the changes. Earlier when these rules are not mentioned as true there were no issue otherwise CI would fail at the flutter analyze . step.

So, you are saying that if any rule is not set to be true. By default they are not checked by linter ?

Yes, all the linter rules specified in the issue are not checked by default. We have to specify them.

@aman-singh7 aman-singh7 deleted the enable_linters branch March 3, 2022 07:06
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 this pull request may close these issues.

Fix and enable linter rules
4 participants