Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Add avoid non null assertion rule #285

Merged
merged 5 commits into from
Apr 26, 2021
Merged

Add avoid non null assertion rule #285

merged 5 commits into from
Apr 26, 2021

Conversation

incendial
Copy link
Member

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix
[X] New rule
[ ] Changes an existing rule
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

@incendial incendial added the type: enhancement New feature or request label Apr 25, 2021
@incendial incendial added this to the 3.2.0 milestone Apr 25, 2021
@incendial incendial self-assigned this Apr 25, 2021
@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2021

Codecov Report

Merging #285 (e5a30ff) into master (4b61e8b) will increase coverage by 0.13%.
The diff coverage is 91.66%.

❗ Current head e5a30ff differs from pull request most recent head 9dbbe53. Consider uploading reports for the commit 9dbbe53 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #285      +/-   ##
==========================================
+ Coverage   73.01%   73.14%   +0.13%     
==========================================
  Files         108      109       +1     
  Lines        3272     3296      +24     
==========================================
+ Hits         2389     2411      +22     
- Misses        883      885       +2     
Impacted Files Coverage Δ
lib/src/obsoleted/rules_factory.dart 76.19% <0.00%> (-3.81%) ⬇️
...obsoleted/rules/avoid_non_null_assertion_rule.dart 100.00% <100.00%> (ø)

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 4b61e8b...9dbbe53. Read the comment docs.

@roman-petrov
Copy link
Contributor

Just got an email notification about this PR and I think it is great rule! I already seen a feature request asking to implement exactly the same in dart linter repository

Lint rule for ! postfix bang/exclamation and late null safety language features

@incendial
Copy link
Member Author

Yeah, I've actually seen this issue and decided to add this feature. Unfortunately there is no rule requests in our repo yet, hope this will change in the future.

location: nodeLocation(
node: expression,
source: source,
withCommentOrMetadata: true,
Copy link
Member

Choose a reason for hiding this comment

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

@incendial please remove withCommentOrMetadata: true,

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@dkrutskikh dkrutskikh merged commit 55bda50 into dart-code-checker:master Apr 26, 2021
@incendial incendial deleted the avoid-non-null-assertion branch April 26, 2021 21:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants