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

Adding new logic for suppressing inspection #1328

Merged
merged 10 commits into from
May 30, 2022
Merged

Conversation

orchestr7
Copy link
Member

@orchestr7 orchestr7 commented May 29, 2022

What's done:

  • ignoreAnnotated logic that helps to suppress inspections that could have triggered on the block of code annotated with some specific annotations (useful for Jetpack)
  • adding suppressing for ALL rules for the code block

@codecov
Copy link

codecov bot commented May 29, 2022

Codecov Report

Merging #1328 (45f9378) into master (0706885) will decrease coverage by 0.07%.
The diff coverage is 59.37%.

@@             Coverage Diff              @@
##             master    #1328      +/-   ##
============================================
- Coverage     82.08%   82.01%   -0.08%     
  Complexity     2538     2538              
============================================
  Files           105      105              
  Lines          7223     7239      +16     
  Branches       2065     2071       +6     
============================================
+ Hits           5929     5937       +8     
- Misses          346      354       +8     
  Partials        948      948              
Flag Coverage Δ
unittests 82.01% <59.37%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...fn/diktat/common/config/rules/RulesConfigReader.kt 32.20% <0.00%> (-5.06%) ⬇️
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 98.06% <50.00%> (ø)
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 82.64% <85.71%> (+0.41%) ⬆️

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 0706885...45f9378. Read the comment docs.

@orchestr7 orchestr7 marked this pull request as draft May 29, 2022 21:00
### What's done:
- ignoreAnnotated logic
- adding suppressing for ALL rules for the code block
@orchestr7 orchestr7 force-pushed the feature/ignoreAnnotated branch from 553898b to 48cfdbd Compare May 29, 2022 21:17
@orchestr7 orchestr7 linked an issue May 29, 2022 that may be closed by this pull request
orchestr7 added 2 commits May 30, 2022 00:17
### What's done:
- ignoreAnnotated logic to disable annotated code blocks
- adding mechanism for suppression of ALL rules for the selected code block with Suppress("diktat")
@orchestr7 orchestr7 marked this pull request as ready for review May 30, 2022 12:46
orchestr7 added 6 commits May 30, 2022 15:49
### What's done:
- ignoreAnnotated logic to disable annotated code blocks
- adding mechanism for suppression of ALL rules for the selected code block with Suppress("diktat")
### What's done:
- diktat fixes
…ature/ignoreAnnotated

# Conflicts:
#	diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt
### What's done:
- detekt fixes
### What's done:
- detekt fixes
README.md Outdated Show resolved Hide resolved
@@ -12,6 +12,8 @@
# Checks that the Class/Enum/Interface name does not match Pascal case
- name: CLASS_NAME_INCORRECT
enabled: true
# all code blocks with MyAnnotation will be ignored and not checked
ignoreAnnotated: [ MyAnnotation ]
Copy link
Member

Choose a reason for hiding this comment

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

This file will be bundled into the jar, is it worth adding this here and not into examples?

Copy link
Member Author

@orchestr7 orchestr7 May 30, 2022

Choose a reason for hiding this comment

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

I see that users copy-paste this one 🤦
But yes, let's remove

Co-authored-by: Peter Trifanov <[email protected]>
@orchestr7 orchestr7 enabled auto-merge (squash) May 30, 2022 15:13
@orchestr7 orchestr7 merged commit 8aae73e into master May 30, 2022
@orchestr7 orchestr7 deleted the feature/ignoreAnnotated branch May 30, 2022 15:28
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.

Implement ignoreAnnotated suppressor like detekt
2 participants