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 getLineAndColumnInPsiFile function #7261

Merged
merged 2 commits into from May 8, 2024

Conversation

3flex
Copy link
Member

@3flex 3flex commented May 6, 2024

This was introduced to work around issues with mutated PSI. This is no longer an issue since #7206. Because the formatting rule set operates on a copy of the PsiFile and not the original PsiFile the original PsiFile will never be modified, so the protection offered by this function is not needed.

This also masks some issues with rule implementations due to use of runCatching - MaxLineLength was previously raising IndexOutOfBoundException when DiagnosticUtils.getLineAndColumnInPsiFile was called, but it was caught by runCatching and the exception was hidden. Avoiding that behaviour will avoid masking those issues in future.

@detekt-ci
Copy link
Collaborator

detekt-ci commented May 6, 2024

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

Generated by 🚫 dangerJS against 766759d

@3flex
Copy link
Member Author

3flex commented May 7, 2024

Blocked, see #7260 (comment)

@3flex 3flex force-pushed the drop-getLineAndColumnInPsiFile branch from 3ce73b3 to 7781d65 Compare May 8, 2024 06:02
Copy link

codecov bot commented May 8, 2024

Codecov Report

Attention: Patch coverage is 97.05882% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 84.77%. Comparing base (bf3fc6f) to head (6ad6ae7).
Report is 1 commits behind head on main.

❗ Current head 6ad6ae7 differs from pull request most recent head 766759d. Consider uploading reports for the commit 766759d to get more accurate results

Files Patch % Lines
...lab/arturbosch/detekt/rules/style/MaxLineLength.kt 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7261      +/-   ##
============================================
+ Coverage     84.75%   84.77%   +0.01%     
+ Complexity     3992     3990       -2     
============================================
  Files           578      578              
  Lines         12027    12023       -4     
  Branches       2485     2478       -7     
============================================
- Hits          10193    10192       -1     
  Misses          606      606              
+ Partials       1228     1225       -3     

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

3flex added 2 commits May 8, 2024 22:20
This was introduced to work around issues with mutated PSI. This is no
longer an issue since detekt#7206. Because the formatting rule set operates on a
copy of the PsiFile and not the original PsiFile the original PsiFile will
never be modified, so the protection offered by this function is not
needed.
…ions

There is no longer any reason to forbid usage of this function.
@3flex 3flex force-pushed the drop-getLineAndColumnInPsiFile branch from 6ad6ae7 to 766759d Compare May 8, 2024 12:21
@3flex 3flex marked this pull request as ready for review May 8, 2024 12:21
@3flex 3flex added psi-utils and removed blocked labels May 8, 2024
@3flex 3flex merged commit a895c5f into detekt:main May 8, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants