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

Fix all Warnings #781

Merged
merged 17 commits into from
Apr 30, 2021
Merged

Fix all Warnings #781

merged 17 commits into from
Apr 30, 2021

Conversation

kentr0w
Copy link
Collaborator

@kentr0w kentr0w commented Feb 20, 2021

What's done:

Fixed all warnings
closes #769

### What's done:
   Fixed all warnings
@kentr0w kentr0w added the bug Something isn't working label Feb 20, 2021
@kentr0w kentr0w requested review from petertrr and aktsay6 February 20, 2021 11:49
Copy link
Member

@petertrr petertrr left a comment

Choose a reason for hiding this comment

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

Also, did you check, whether there is a flag that makes kotlin compiler threat warnings as errors?

Copy link
Member

@orchestr7 orchestr7 left a comment

Choose a reason for hiding this comment

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

Denis, please be more careful and pay attention to the details

@petertrr
Copy link
Member

@kentr0w any progress on this?

kentr0w added 2 commits April 28, 2021 14:41
…ings

# Conflicts:
#	diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/KotlinParser.kt
### What's done:
Fixed after review
Merged
Fixed more warnings
@codecov
Copy link

codecov bot commented Apr 28, 2021

Codecov Report

Merging #781 (8ce3cc8) into master (4c82083) will decrease coverage by 0.63%.
The diff coverage is 82.22%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #781      +/-   ##
============================================
- Coverage     81.06%   80.43%   -0.64%     
+ Complexity     2286     2185     -101     
============================================
  Files           100      101       +1     
  Lines          5857     5637     -220     
  Branches       1814     1734      -80     
============================================
- Hits           4748     4534     -214     
+ Misses          286      264      -22     
- Partials        823      839      +16     
Flag Coverage Δ Complexity Δ
unittests 80.43% <82.22%> (-0.64%) 2185.00 <2.00> (-101.00)

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

Impacted Files Coverage Δ Complexity Δ
...t/common/config/reader/JsonResourceConfigReader.kt 45.45% <ø> (ø) 3.00 <0.00> (ø)
...fn/diktat/common/config/rules/RulesConfigReader.kt 35.29% <ø> (+0.67%) 4.00 <0.00> (ø)
...rg/cqfn/diktat/plugin/gradle/DiktatGradlePlugin.kt 100.00% <ø> (ø) 2.00 <0.00> (ø)
...qfn/diktat/plugin/gradle/DiktatJavaExecTaskBase.kt 86.41% <ø> (-0.17%) 20.00 <0.00> (ø)
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 98.59% <ø> (+0.66%) 12.00 <0.00> (ø)
...tlin/org/cqfn/diktat/ruleset/dummy/DummyWarning.kt 100.00% <ø> (ø) 2.00 <0.00> (ø)
.../diktat/ruleset/rules/chapter1/IdentifierNaming.kt 75.31% <0.00%> (-6.90%) 87.00 <0.00> (-4.00)
.../ruleset/rules/chapter2/kdoc/CommentsFormatting.kt 65.77% <ø> (-3.61%) 76.00 <0.00> (ø)
.../diktat/ruleset/rules/chapter2/kdoc/KdocMethods.kt 84.61% <ø> (-3.13%) 70.00 <0.00> (-4.00)
...n/diktat/ruleset/rules/chapter3/MagicNumberRule.kt 78.04% <ø> (-2.91%) 26.00 <0.00> (-2.00)
... and 92 more

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 4c82083...8ce3cc8. Read the comment docs.

kentr0w added 4 commits April 28, 2021 17:05
### What's done:
Fixed according to our code-style
### What's done:
Fixed bug in WhiteSpaceRule.kt
Fixed according to our code style
…ings

# Conflicts:
#	diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt
### What's done:
Fixed according to our code-style
kentr0w added 2 commits April 29, 2021 19:15
### What's done:
Rollback all changes in md files
### What's done:
Fixed for test
@orchestr7
Copy link
Member

orchestr7 commented Apr 30, 2021

Also, did you check, whether there is a flag that makes kotlin compiler threat warnings as errors?

  <plugin>
                <artifactId>kotlin-maven-plugin</artifactId>
                <groupId>org.jetbrains.kotlin</groupId>
                <version>${kotlin.version}</version>
                <!-- ... -->
                <configuration>
                    <args>
                        <arg>-Werror</arg>
                    </args>
                </configuration>
            </plugin>

@orchestr7
Copy link
Member

orchestr7 commented Apr 30, 2021

for gradle:

compileKotlin {
    kotlinOptions.allWarningsAsErrors = true
}

Copy link
Member

@orchestr7 orchestr7 left a comment

Choose a reason for hiding this comment

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

treat warns as errors

kentr0w added 5 commits April 30, 2021 12:04
### What's done:
Added suppress
Added flags to poms
### What's done:
Remove ktlint implementation
### What's done:
Exclude some libs
### What's done:
Exclude some libs
### What's done:
Rollback md files
### What's done:
Added flag in parent pom
Copy link
Member

@orchestr7 orchestr7 left a comment

Choose a reason for hiding this comment

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

Lgtm

@kentr0w kentr0w merged commit 4c81b3f into master Apr 30, 2021
@kentr0w kentr0w deleted the bugfix/fix-all-warnings branch April 30, 2021 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix all compiler warnings generated by Kotlin compiler for diktat
3 participants