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

ClassNaming: Don't treat Kotlin syntax ` as part of class name #3977

Merged
merged 2 commits into from
Aug 2, 2021

Conversation

BraisGabin
Copy link
Member

This tries to fix #2656. But I find this a bit controversial:

Pros:

  • It's true that ` is not part of the name of a class (or any other entity in the code).

Cons:

  • FunctionNaming is using this "error" to provide the feature that only allows any type of function name if it uses backticks. That's like that because in the tests we want to allow that kind of naming in the functions.

I vote to merge because I think that the one that is wrong is FunctionNaming. But fixing FuctionNaming is not easy. A way to fix it would be to allow multiple instances of the same rule with different configurations. This way we could have an instance that checks FunctionNaming in production code and another for test code.

Maybe a solution is to exclude FunctionNaming from test source sets and don't allow backtick at all.

@codecov
Copy link

codecov bot commented Jul 25, 2021

Codecov Report

Merging #3977 (af36d56) into main (ce7bb32) will increase coverage by 0.01%.
The diff coverage is 100.00%.

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

@@             Coverage Diff              @@
##               main    #3977      +/-   ##
============================================
+ Coverage     83.48%   83.49%   +0.01%     
- Complexity     3159     3160       +1     
============================================
  Files           458      458              
  Lines          9047     9047              
  Branches       1759     1759              
============================================
+ Hits           7553     7554       +1     
  Misses          567      567              
+ Partials        927      926       -1     
Impacted Files Coverage Δ
...tlab/arturbosch/detekt/rules/naming/ClassNaming.kt 100.00% <100.00%> (ø)
...b/arturbosch/detekt/rules/naming/FunctionNaming.kt 100.00% <100.00%> (+3.84%) ⬆️

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 ce7bb32...fda2c94. 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
Development

Successfully merging this pull request may close these issues.

ClassNaming rule treating Kotlin syntax ` as part of class name
3 participants