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

Extracted REDUNDANT_SEMICOLON rule check from WRONG_NEWLINES rule #1864

Merged
merged 4 commits into from
Dec 15, 2023

Conversation

DrAlexD
Copy link
Member

@DrAlexD DrAlexD commented Dec 14, 2023

What's done:

  • REDUNDANT_SEMICOLON rule check moved to earlier checks to remove unnecessary semicolons before executing the rest of the rules.
  • Moved several warning and fix tests related to REDUNDANT_SEMICOLON rule.
  • Added smoke test for logic related to semicolons.
  • Added warning test for LocalVariablesRule.

Closes #1863, #1783

… `WRONG_NEWLINES` rule

### What's done:
- `REDUNDANT_SEMICOLON` rule check moved to earlier checks to remove unnecessary semicolons before executing the rest of the rules.
- Moved several warning and fix tests related to `REDUNDANT_SEMICOLON` rule.

Closes #1863, #1783
@DrAlexD DrAlexD self-assigned this Dec 14, 2023
@DrAlexD DrAlexD added bug Something isn't working enhancement New feature or request labels Dec 14, 2023
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6cb0093) 78.40% compared to head (98f7e80) 78.41%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1864   +/-   ##
=========================================
  Coverage     78.40%   78.41%           
- Complexity     2463     2465    +2     
=========================================
  Files           133      134    +1     
  Lines          8688     8695    +7     
  Branches       2200     2199    -1     
=========================================
+ Hits           6812     6818    +6     
- Misses          897      898    +1     
  Partials        979      979           

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

Copy link
Contributor

github-actions bot commented Dec 14, 2023

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

   166 files  +2     166 suites  +2   8m 36s ⏱️ + 3m 7s
1 426 tests +7  1 388 ✔️ +6  38 💤 +1  0 ±0 
2 805 runs  +7  2 767 ✔️ +6  38 💤 +1  0 ±0 

Results for commit e055494. ± Comparison against base commit 02c1a7c.

This pull request removes 3 and adds 10 tests. Note that renamed tests count towards both.
com.saveourtool.diktat.ruleset.chapter3.files.NewlinesRuleFixTest ‑ should fix one line function with and without semicolon()
com.saveourtool.diktat.ruleset.chapter3.files.NewlinesRuleFixTest ‑ should remove redundant semicolons()
com.saveourtool.diktat.ruleset.chapter3.files.NewlinesRuleWarnTest ‑ should forbid EOL semicolons()
com.saveourtool.diktat.ruleset.chapter2.KdocMethodsFixTest ‑ Should add throws tag only for throw without catch()
com.saveourtool.diktat.ruleset.chapter2.KdocMethodsTest ‑ No warning when throw has matching catch()
com.saveourtool.diktat.ruleset.chapter2.KdocMethodsTest ‑ No warning when throw has matching catch, which is parent exception to throw()
com.saveourtool.diktat.ruleset.chapter2.KdocMethodsTest ‑ Warning when throw doesn't have matching catch()
com.saveourtool.diktat.ruleset.chapter3.LocalVariablesWarnTest ‑ shouldn't fail on semicolon()
com.saveourtool.diktat.ruleset.chapter3.files.NewlinesRuleFixTest ‑ should fix one line function()
com.saveourtool.diktat.ruleset.chapter3.files.SemicolonsRuleFixTest ‑ should remove redundant semicolons()
com.saveourtool.diktat.ruleset.chapter3.files.SemicolonsRuleWarnTest ‑ should forbid EOL semicolons()
com.saveourtool.diktat.smoke.DiktatSaveSmokeTest ‑ regression - should not fail if file has unnecessary semicolons()
com.saveourtool.diktat.smoke.DiktatSmokeTest ‑ regression - should not fail if file has unnecessary semicolons()

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Dec 14, 2023

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

   166 files  +2     166 suites  +2   7m 6s ⏱️ -24s
1 426 tests +7  1 409 ✔️ +7  17 💤 ±0  0 ±0 
2 805 runs  +7  2 788 ✔️ +7  17 💤 ±0  0 ±0 

Results for commit e055494. ± Comparison against base commit 02c1a7c.

This pull request removes 3 and adds 10 tests. Note that renamed tests count towards both.
com.saveourtool.diktat.ruleset.chapter3.files.NewlinesRuleFixTest ‑ should fix one line function with and without semicolon()
com.saveourtool.diktat.ruleset.chapter3.files.NewlinesRuleFixTest ‑ should remove redundant semicolons()
com.saveourtool.diktat.ruleset.chapter3.files.NewlinesRuleWarnTest ‑ should forbid EOL semicolons()
com.saveourtool.diktat.ruleset.chapter2.KdocMethodsFixTest ‑ Should add throws tag only for throw without catch()
com.saveourtool.diktat.ruleset.chapter2.KdocMethodsTest ‑ No warning when throw has matching catch()
com.saveourtool.diktat.ruleset.chapter2.KdocMethodsTest ‑ No warning when throw has matching catch, which is parent exception to throw()
com.saveourtool.diktat.ruleset.chapter2.KdocMethodsTest ‑ Warning when throw doesn't have matching catch()
com.saveourtool.diktat.ruleset.chapter3.LocalVariablesWarnTest ‑ shouldn't fail on semicolon()
com.saveourtool.diktat.ruleset.chapter3.files.NewlinesRuleFixTest ‑ should fix one line function()
com.saveourtool.diktat.ruleset.chapter3.files.SemicolonsRuleFixTest ‑ should remove redundant semicolons()
com.saveourtool.diktat.ruleset.chapter3.files.SemicolonsRuleWarnTest ‑ should forbid EOL semicolons()
com.saveourtool.diktat.smoke.DiktatSaveSmokeTest ‑ regression - should not fail if file has unnecessary semicolons()
com.saveourtool.diktat.smoke.DiktatSmokeTest ‑ regression - should not fail if file has unnecessary semicolons()

♻️ This comment has been updated with latest results.

@DrAlexD DrAlexD changed the title Extracted REDUNDANT_SEMICOLON rule check from logic associated with WRONG_NEWLINES rule Extracted REDUNDANT_SEMICOLON rule check from WRONG_NEWLINES rule Dec 14, 2023
@DrAlexD DrAlexD added this to the 2.0.0 milestone Dec 14, 2023
- Added smoke test for logic related to semicolons.
@DrAlexD DrAlexD enabled auto-merge (squash) December 15, 2023 14:40
@DrAlexD DrAlexD merged commit 3e3740e into master Dec 15, 2023
19 checks passed
@DrAlexD DrAlexD deleted the feature/semicolons_rule branch December 15, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
3 participants