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

Add naming test for ForbiddenVoid rule #1740

Merged
merged 2 commits into from
Jul 6, 2019
Merged

Add naming test for ForbiddenVoid rule #1740

merged 2 commits into from
Jul 6, 2019

Conversation

schalkms
Copy link
Member

This adds tests to reproduce issue #1642

This adds tests to reproduce issue #1642
it("does not report when functions or classes are called 'Void'") {
val code = """
class Void {
fun void() {}
Copy link
Member

Choose a reason for hiding this comment

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

this should be fairly easy to fix, we just check if this name is a child of a declaration?

Copy link
Member Author

Choose a reason for hiding this comment

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

? What do you want to fix? There's nothing to fix here.

Copy link
Member

Choose a reason for hiding this comment

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

Ah though this is a false positive but now seeing that the declaration name does not trigger it aka the isEmpty check :)

@codecov-io
Copy link

codecov-io commented Jun 30, 2019

Codecov Report

Merging #1740 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1740      +/-   ##
============================================
+ Coverage     79.78%   79.82%   +0.04%     
- Complexity     1933     1934       +1     
============================================
  Files           324      324              
  Lines          5456     5467      +11     
  Branches       1004     1006       +2     
============================================
+ Hits           4353     4364      +11     
  Misses          581      581              
  Partials        522      522
Impacted Files Coverage Δ Complexity Δ
...ab/arturbosch/detekt/cli/console/FindingsReport.kt 100% <0%> (ø) 5% <0%> (+1%) ⬆️
.../gitlab/arturbosch/detekt/rules/ThrowExtensions.kt 80% <0%> (+5%) 0% <0%> (ø) ⬇️

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 5948565...f3c5cfd. Read the comment docs.

@schalkms
Copy link
Member Author

I don't know what problem CodeFactor has. There's no trailing whitespace there.

@arturbosch
Copy link
Member

Not even in the testing code? It look wierd at github though.

@arturbosch arturbosch added this to the 1.0.0 milestone Jul 6, 2019
@arturbosch arturbosch merged commit 9e87fb7 into detekt:master Jul 6, 2019
@schalkms schalkms deleted the #1642-ForbiddenVoid-naming branch July 14, 2019 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants