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 default print methods to ForbiddenMethodCall #2753

Merged
merged 3 commits into from
May 31, 2020

Conversation

cortinico
Copy link
Member

Adding all the variations of print/println from Java
to the ForbiddenMethodCall.

The rationale is to encourage the usage of a Logger or a PrintStream

Moreover this fixes the rule that was not catching all the method
calls due to overriding visitQualifiedExpression rather than visitCallExpression

Fixes #2678

Adding all the variations of print/println from Java and Kotlin
to the ForbiddenMethodCall.

The rationale is to encourage the usage of a Logger.

Moreover this fixes the rule that was not catching all the method
calls due to overriding visitQualifiedExpression rather than visitCallExpression

Fixes detekt#2678
@codecov
Copy link

codecov bot commented May 30, 2020

Codecov Report

Merging #2753 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2753      +/-   ##
============================================
- Coverage     80.44%   80.43%   -0.01%     
  Complexity     2303     2303              
============================================
  Files           379      379              
  Lines          6943     6946       +3     
  Branches       1261     1261              
============================================
+ Hits           5585     5587       +2     
  Misses          729      729              
- Partials        629      630       +1     
Impacted Files Coverage Δ Complexity Δ
...turbosch/detekt/rules/style/ForbiddenMethodCall.kt 83.33% <100.00%> (-3.34%) 5.00 <4.00> (ø)

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 afb85a2...31b34e8. Read the comment docs.

@arturbosch arturbosch merged commit 12bce58 into detekt:master May 31, 2020
@arturbosch arturbosch added this to the 1.10.0 milestone May 31, 2020
@cortinico cortinico deleted the forbiddenMethodCall-defaults branch June 13, 2020 20:40
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.

New rule: NoPrintStatement
3 participants