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

Fixed VARIABLE_NAME_INCORRECT_FORMAT false positive when a property has a backing field #1810

Merged
merged 4 commits into from
Nov 22, 2023

Conversation

diphtongue
Copy link
Contributor

What's done:

  • fixed warning VARIABLE_NAME_INCORRECT_FORMAT on backing field.
  • added warning test.

Closes #1711

- fixed warning `VARIABLE_NAME_INCORRECT_FORMAT` on `backing field`.
- added warning test.
Closes #1711
@diphtongue diphtongue self-assigned this Nov 20, 2023
@nulls
Copy link
Member

nulls commented Nov 20, 2023

Does it close #1709 as well?

Copy link
Contributor

github-actions bot commented Nov 20, 2023

JUnit Tests (macOS, EnricoMi/publish-unit-test-result-action@v2)

   164 files   - 1     164 suites   - 1   8m 49s ⏱️ + 1m 36s
1 397 tests +2  1 361 ✔️ +2  36 💤 ±0  0 ±0 
2 776 runs  +2  2 740 ✔️ +2  36 💤 ±0  0 ±0 

Results for commit d84c98c. ± Comparison against base commit 81a7429.

This pull request removes 2 and adds 4 tests. Note that renamed tests count towards both.
com.saveourtool.diktat.plugin.gradle.DiktatGradlePluginTest ‑ check default reporter type value()
com.saveourtool.diktat.plugin.gradle.ReporterSelectionTest ‑ should fallback to plain reporter for unknown reporter types()
com.saveourtool.diktat.ruleset.chapter1.IdentifierNamingWarnTest ‑ should not trigger on backing field()
com.saveourtool.diktat.ruleset.chapter1.IdentifierNamingWarnTest ‑ should trigger on backing field with no matching property()
com.saveourtool.diktat.ruleset.chapter1.IdentifierNamingWarnTest ‑ should trigger on backing field with setter()
com.saveourtool.diktat.ruleset.chapter1.IdentifierNamingWarnTest ‑ should trigger on backing field with unmatched type()

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Nov 20, 2023

JUnit Tests (Windows, EnricoMi/publish-unit-test-result-action@v2)

   164 files   - 1     164 suites   - 1   6m 44s ⏱️ -13s
1 397 tests +2  1 380 ✔️ +2  17 💤 ±0  0 ±0 
2 776 runs  +2  2 759 ✔️ +2  17 💤 ±0  0 ±0 

Results for commit d84c98c. ± Comparison against base commit 81a7429.

This pull request removes 2 and adds 4 tests. Note that renamed tests count towards both.
com.saveourtool.diktat.plugin.gradle.DiktatGradlePluginTest ‑ check default reporter type value()
com.saveourtool.diktat.plugin.gradle.ReporterSelectionTest ‑ should fallback to plain reporter for unknown reporter types()
com.saveourtool.diktat.ruleset.chapter1.IdentifierNamingWarnTest ‑ should not trigger on backing field()
com.saveourtool.diktat.ruleset.chapter1.IdentifierNamingWarnTest ‑ should trigger on backing field with no matching property()
com.saveourtool.diktat.ruleset.chapter1.IdentifierNamingWarnTest ‑ should trigger on backing field with setter()
com.saveourtool.diktat.ruleset.chapter1.IdentifierNamingWarnTest ‑ should trigger on backing field with unmatched type()

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (51195ee) 78.77% compared to head (f9799af) 78.72%.

Files Patch % Lines
.../diktat/ruleset/rules/chapter1/IdentifierNaming.kt 57.89% 0 Missing and 8 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1810      +/-   ##
============================================
- Coverage     78.77%   78.72%   -0.05%     
- Complexity     2430     2441      +11     
============================================
  Files           126      126              
  Lines          8526     8544      +18     
  Branches       2150     2163      +13     
============================================
+ Hits           6716     6726      +10     
  Misses          850      850              
- Partials        960      968       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- added `ASTNode.isCorrectBackingField(ASTNode)` method.
- added warning tests, which trigger on incorrect `backing field` format.

Closes #1711
@diphtongue
Copy link
Contributor Author

Does it close #1709 as well?

No

@diphtongue diphtongue enabled auto-merge (squash) November 22, 2023 10:39
@diphtongue diphtongue merged commit b01cd64 into master Nov 22, 2023
18 of 19 checks passed
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.

VARIABLE_NAME_INCORRECT_FORMAT false positive when a property has a backing field
6 participants