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 AutoCorrection crashing with Missing extension point #4545

Merged
merged 1 commit into from Feb 4, 2022

Conversation

cortinico
Copy link
Member

Fixes #4003
Fixes #4500
Fixes #4489

This issue was apparently caused by my PR #3848

What is happening is that KtLint is enabling AST mutation on the Root Extension, while we're not. Therefore, as the autoCorrect tries to mutate the AST it crashes with the mentioned message.

Moreover there was a ! missing which was causing the code to do nothing. I've also removed the syncronized as KtLint is not using it either.

I've tested locally with a SNAPSHOT version and it works for me. I'm unsure how we can test this with an automated test.

Sadly we will have to live with the deprecated getRootArea(). KtLint is having that as well so I guess they'll find a way if JetBrains decides to remove this API (and we'll have to follow their approach).

@codecov
Copy link

codecov bot commented Jan 30, 2022

Codecov Report

Merging #4545 (d63d62c) into main (10e9e4c) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #4545      +/-   ##
============================================
+ Coverage     84.13%   84.14%   +0.01%     
- Complexity     3313     3315       +2     
============================================
  Files           477      477              
  Lines         10922    10920       -2     
  Branches       2030     2031       +1     
============================================
  Hits           9189     9189              
+ Misses          700      699       -1     
+ Partials       1033     1032       -1     
Impacted Files Coverage Δ
...n/kotlin/io/github/detekt/parser/DetektPomModel.kt 72.22% <100.00%> (+7.22%) ⬆️

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 10e9e4c...d63d62c. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants