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

Warnings as errors #3646

Merged
merged 3 commits into from
Apr 17, 2021
Merged

Warnings as errors #3646

merged 3 commits into from
Apr 17, 2021

Conversation

BraisGabin
Copy link
Member

This PR removes all the current warnigns in the project and enables warningsAsErrors in CI as before #2981. It was removed for some problems with Kotlin 1.4 that are fixed now so it's safe to add it again.

synchronized(Extensions.getRootArea()) {
arrayOf(project.extensionArea, Extensions.getRootArea())
synchronized(@Suppress("DEPRECATION") Extensions.getRootArea()) {
arrayOf(project.extensionArea, @Suppress("DEPRECATION") Extensions.getRootArea())
Copy link
Member Author

Choose a reason for hiding this comment

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

I have no idea what this code does and I can't find any alternative to this. The other suppressions are safe because we are suppressing our own deprecations and that's fine. But this case is different. What do you think? The problem is that if we don't fix this we can't enable warningsAsErrors again.

Other option would be to disable warningsAsErrors just for this module.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

😕 so ktlint still have that deprecated code... Any idea about how to fix this deprecation properly? How should we proceed here?

Copy link
Member

Choose a reason for hiding this comment

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

The replacement can be found here https://github.com/JetBrains/intellij-community/blob/master/platform/extensions/src/com/intellij/openapi/extensions/Extensions.java#L34. Would you mind trying it and verify the AST mutation still works?

@BraisGabin BraisGabin added the housekeeping Marker for housekeeping tasks and refactorings label Apr 2, 2021
@codecov
Copy link

codecov bot commented Apr 2, 2021

Codecov Report

Merging #3646 (b43fb97) into main (709f879) will decrease coverage by 0.01%.
The diff coverage is 50.00%.

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

@@             Coverage Diff              @@
##               main    #3646      +/-   ##
============================================
- Coverage     78.12%   78.11%   -0.02%     
+ Complexity     2837     2835       -2     
============================================
  Files           467      467              
  Lines          9143     9143              
  Branches       1737     1737              
============================================
- Hits           7143     7142       -1     
- Misses         1058     1059       +1     
  Partials        942      942              
Impacted Files Coverage Δ Complexity Δ
...kotlin/io/gitlab/arturbosch/detekt/api/Location.kt 77.77% <ø> (-3.71%) 5.00 <0.00> (-2.00)
.../kotlin/io/gitlab/arturbosch/detekt/api/RuleSet.kt 70.00% <ø> (ø) 3.00 <0.00> (ø)
...tlab/arturbosch/detekt/DetektCreateBaselineTask.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...o/gitlab/arturbosch/detekt/internal/SharedTasks.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...kotlin/io/gitlab/arturbosch/detekt/api/Findings.kt 62.50% <100.00%> (ø) 0.00 <0.00> (ø)
.../core/reporting/console/FileBasedFindingsReport.kt 100.00% <100.00%> (ø) 5.00 <0.00> (ø)
...n/kotlin/io/github/detekt/parser/DetektPomModel.kt 70.58% <100.00%> (ø) 5.00 <0.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 709f879...b732719. Read the comment docs.

This was removed in #2981 for an issue with kotlin 1.4 but that issue
is fixed now so it's safe to enable it again
Copy link
Member

@chao2zhang chao2zhang left a comment

Choose a reason for hiding this comment

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

We can delay Extensions.getRootArea() to a follow-PR. The urgency is to avoid adding new violations as warnings.

@BraisGabin
Copy link
Member Author

I created #3683 so we don't forget about it.

@BraisGabin BraisGabin merged commit 0388ffe into detekt:main Apr 17, 2021
@BraisGabin BraisGabin deleted the warnings-as-errors branch April 17, 2021 08:14
@cortinico cortinico added this to the 1.17.0 milestone May 1, 2021
chao2zhang pushed a commit to chao2zhang/detekt that referenced this pull request May 13, 2021
* Deprecate Location.file in favor of Location.filePath

* Fix warnings

* Enable warningsAsErrors again

This was removed in detekt#2981 for an issue with kotlin 1.4 but that issue
is fixed now so it's safe to enable it again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants