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

Baseline adds file path instead package #2985

Closed
kuFEAR opened this issue Aug 19, 2020 · 5 comments · Fixed by #2988
Closed

Baseline adds file path instead package #2985

kuFEAR opened this issue Aug 19, 2020 · 5 comments · Fixed by #2988
Assignees
Milestone

Comments

@kuFEAR
Copy link

kuFEAR commented Aug 19, 2020

Expected Behavior

<ID>MaximumLineLength:com.example.app.di.Module.kt:23</ID>

Observed Behavior

<ID>MaximumLineLength:com.example.app.di./Users/nikitakarnaukh/Develop/android/application/example/app/src/main/java/com/example/app/di/Module.kt:23</ID>

Steps to Reproduce

DetektCreateBaselineTask with configured baseline file and with warning in code by rule MaximumLineLength adds

Context

I can run detekt tasks on another machines(CI/colleges)

Your Environment

CI/local macbook pro 15

  • Version of detekt used: 1.11.0
  • Version of Gradle used (if applicable): 6.6
  • Operating System and version: osx 10.15.6
  • Link to your project (if it's a public repository): none
@BraisGabin
Copy link
Member

detekt only works with files, doesn't work with packages. And, for example, MaximumLineLength:com.example.app.di.Module.kt:23 is not a path. And it's not a fully qualified name (it have .kt) And what's the line number 23 of a class? starts at the beggining of the file or at the begging of the class declaration? It's really messy. For that reason it's safer to only work with paths.

Any way... is this MaximumLineLength:com.example.app.di./Users/nikitakarnaukh/Develop/android/application/example/app/src/main/java/com/example/app/di/Module.kt:23 a real output of detekt? I don't use the formatting plugin so I can't test it easily. But, if it is, it really seems strange.

@radzio
Copy link

radzio commented Aug 19, 2020

I have same issue, it troubles me because this path can be different between dev envs and ci/cd

@kuFEAR
Copy link
Author

kuFEAR commented Aug 19, 2020

I've faced with this behavior only on MaximumLineLength rule, another rules works ok

number 23 it's just example, it's line with code which reach limits (120 chars)

@radzio
Copy link

radzio commented Aug 19, 2020

It seems that it happens in 1.11.1, in 1.10.0 everything is ok

@arturbosch arturbosch self-assigned this Aug 19, 2020
@arturbosch arturbosch added this to the 1.11.2 milestone Aug 19, 2020
@arturbosch
Copy link
Member

Thanks for the report! I will look into this and release a bug fix release asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants