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

Remove detekt-psi-utils usage from detekt-api #7260

Merged
merged 1 commit into from May 8, 2024
Merged

Conversation

3flex
Copy link
Member

@3flex 3flex commented May 6, 2024

Closes #7140

@3flex 3flex added the breaking change Marker for breaking changes which should be highlighted in the changelog label May 6, 2024
@3flex 3flex added this to the 2.0.0 milestone May 6, 2024
@3flex 3flex force-pushed the location-10 branch 2 times, most recently from 9bf2820 to 4ec6ce3 Compare May 7, 2024 10:08
@detekt-ci
Copy link
Collaborator

detekt-ci commented May 7, 2024

Warnings
⚠️ It looks like this PR contains functional changes without a corresponding test.

Generated by 🚫 dangerJS against 9dd130e

@BraisGabin
Copy link
Member

BraisGabin commented May 7, 2024

Who should add projects.detektPsiUtils in the classpath now? The clients? Or should we add it as a runtime only dependency on the core? Or :detekt-rules also as a runtime only?

@3flex
Copy link
Member Author

3flex commented May 7, 2024

It's already an implementation dependency of detekt-core, so it's on the runtime classpath:

implementation(projects.detektPsiUtils)

@BraisGabin
Copy link
Member

Oh, I thought that ci was failing exactly for that issue 🤐

@3flex
Copy link
Member Author

3flex commented May 7, 2024

ci was failing exactly for that issue

If only it were that simple... it's failing because this function was catching an IndexOutOfBoundsException due to errors in the implementation of MaxLineLength:

runCatching {
@Suppress("ForbiddenMethodCall")
DiagnosticUtils.getLineAndColumnInPsiFile(file, range)
}.getOrNull()

The above code was catching the exception, and I didn't copy that exactly to the new location because it shouldn't be needed anymore.

The MaxLineLength implementation should be fixed, but it looks like it needs changes to Location and/or Entity... until that's been corrected I'd call this and #7261 blocked.

Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.77%. Comparing base (2f5225d) to head (9dd130e).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7260   +/-   ##
=========================================
  Coverage     84.77%   84.77%           
  Complexity     3990     3990           
=========================================
  Files           578      578           
  Lines         12023    12027    +4     
  Branches       2478     2478           
=========================================
+ Hits          10192    10196    +4     
  Misses          606      606           
  Partials       1225     1225           

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

@3flex 3flex enabled auto-merge (squash) May 8, 2024 21:48
@3flex 3flex merged commit bb6c458 into detekt:main May 8, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api breaking change Marker for breaking changes which should be highlighted in the changelog build cli core formatting parser rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Break the dependency of :detekt-api with :detekt-psi-utils
3 participants