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

Added pedantic lint rules. #132

Merged
merged 6 commits into from
Oct 24, 2020
Merged

Conversation

awhitford
Copy link
Collaborator

This enables a bunch of wise rules for flutter analyze and helps promote code quality.

Note that there is a minor bug where include_file_not_found is erroneously reported, but the rules are still being checked.

@awhitford
Copy link
Collaborator Author

The erroneous include_file_not_found has been resolved.

@awhitford
Copy link
Collaborator Author

Is the build breaking because of the analyze results? Or is there something else going on?

@aagarwal1012
Copy link
Owner

@awhitford, pedantic introduced some flutter analysis issues that need to be fixed for this PR. Logs are given below:

Analyzing 3 directories...                                      
   info • Private field could be final • lib/src/colorize.dart:96:13 • prefer_final_fields
   info • Omit type annotations for local variables • lib/src/colorize.dart:141:17 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/colorize.dart:162:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/fade.dart:201:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/fade.dart:232:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/fade.dart:258:9 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/rotate.dart:249:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/rotate.dart:280:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/scale.dart:226:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/scale.dart:257:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/scale.dart:283:9 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/text_liquid_fill.dart:189:10 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/typer.dart:165:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/typer.dart:200:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/typewriter.dart:179:17 • omit_local_variable_types
   info • Only use double quotes for strings containing single quotes • lib/src/typewriter.dart:181:35 • prefer_single_quotes
   info • Omit type annotations for local variables • lib/src/typewriter.dart:212:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/typewriter.dart:253:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:123:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:156:5 • omit_local_variable_types
   info • Private field could be final • lib/src/wavy.dart:175:25 • prefer_final_fields
   info • Use isEmpty instead of length • lib/src/wavy.dart:179:9 • prefer_is_empty
   info • DO use curly braces for all flow control structures • lib/src/wavy.dart:185:7 • curly_braces_in_flow_control_structures
   info • Omit type annotations for local variables • lib/src/wavy.dart:185:12 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:191:11 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:229:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:230:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:231:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:232:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:233:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:273:5 • omit_local_variable_types
   info • Omit type annotations for local variables • lib/src/wavy.dart:280:10 • omit_local_variable_types
   info • Avoid relative imports for files in `lib/` • test/smoke_test.dart:3:8 • avoid_relative_lib_imports

@awhitford
Copy link
Collaborator Author

I didn't realize those warning would break the build. I fixed all but one with #133. Does the build need to have zero?

@aagarwal1012
Copy link
Owner

aagarwal1012 commented Oct 23, 2020

@awhitford, every build needs to have zero warnings in order to pass the tests.

info • Avoid relative imports for files in `lib/` • test/smoke_test.dart:3:8 • avoid_relative_lib_imports

@awhitford
Copy link
Collaborator Author

I'm unclear how to best resolve the last one: avoid_relative_lib_imports.

import '../example/lib/main.dart';

@codecov
Copy link

codecov bot commented Oct 23, 2020

Codecov Report

Merging #132 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #132   +/-   ##
=======================================
  Coverage   72.36%   72.36%           
=======================================
  Files           8        8           
  Lines         760      760           
=======================================
  Hits          550      550           
  Misses        210      210           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b78fa0...9532220. Read the comment docs.

@awhitford
Copy link
Collaborator Author

@aagarwal1012 OK, it's ready now.

Copy link
Owner

@aagarwal1012 aagarwal1012 left a comment

Choose a reason for hiding this comment

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

lgtm

@aagarwal1012 aagarwal1012 merged commit bc14549 into aagarwal1012:master Oct 24, 2020
@awhitford awhitford deleted the pedantic branch October 24, 2020 19:23
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.

2 participants