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 IT_LITERAL & LET_LITERAL #7310

Merged
merged 3 commits into from
May 20, 2024
Merged

Remove IT_LITERAL & LET_LITERAL #7310

merged 3 commits into from
May 20, 2024

Conversation

3flex
Copy link
Member

@3flex 3flex commented May 19, 2024

LET_LITERAL was unused.

IT_LITERAL is provided by StandardNames.IMPLICIT_LAMBDA_PARAMETER_NAME which has resulted in more descriptive code IMHO. There was one usage which I've replaced with string "it" because the rule is literally checking for "`it`-started expressions" so I think this is reasonable.

@3flex 3flex added this to the 2.0.0 milestone May 19, 2024
@detekt-ci
Copy link
Collaborator

detekt-ci commented May 19, 2024

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

Generated by 🚫 dangerJS against ac60908

@3flex 3flex added the breaking change Marker for breaking changes which should be highlighted in the changelog label May 19, 2024
Copy link

codecov bot commented May 19, 2024

Codecov Report

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

Project coverage is 84.76%. Comparing base (1b00a0c) to head (ac60908).
Report is 1 commits behind head on main.

Files Patch % Lines
.../arturbosch/detekt/rules/style/AlsoCouldBeApply.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7310   +/-   ##
=========================================
  Coverage     84.76%   84.76%           
  Complexity     3992     3992           
=========================================
  Files           578      578           
  Lines         12026    12026           
  Branches       2477     2477           
=========================================
  Hits          10194    10194           
  Misses          606      606           
  Partials       1226     1226           

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

Copy link
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

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

Approved because this is clearly better than before but I would use "it" directly. At least for me IMPLICIT_LAMBDA_PARAMETER_NAME is more complex than "it".

@3flex
Copy link
Member Author

3flex commented May 19, 2024

I think it's better to use type safe values, and using a Name instead of a plain string assists with that. IMPLICIT_LAMBDA_PARAMETER_NAME is awkward but it's descriptive. Maybe just my preference but I think we should promote type safety in our rule implementations.

@BraisGabin
Copy link
Member

Oh, I thought that it was just a plain string too. I'm still not 100% on board but it's good for me. This PR reduces complexity on our public api and that's the important point.

@cortinico
Copy link
Member

At least for me IMPLICIT_LAMBDA_PARAMETER_NAME is more complex than "it".

If so, we could have our own internal field that maps to IMPLICIT_LAMBDA_PARAMETER_NAME

@3flex 3flex merged commit e12d467 into detekt:main May 20, 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 rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants