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

In Travis CI: "0 kotlin files were analyzed." #1158

Closed
3flex opened this issue Sep 24, 2018 · 11 comments
Closed

In Travis CI: "0 kotlin files were analyzed." #1158

3flex opened this issue Sep 24, 2018 · 11 comments
Labels
Milestone

Comments

@3flex
Copy link
Member

3flex commented Sep 24, 2018

Expected Behavior

detekt Gradle plugin analyzes files during CI.

Current Behavior

detekt Gradle plugin does not analyze any files during CI.

Steps to Reproduce (for bugs)

View the Travis build log for master branch (https://travis-ci.org/arturbosch/detekt/jobs/432263468 at time of writing). See "0 kotlin files were analyzed." multiple times in the logs.

Context

N/A

Your Environment

N/A - build running in CI environment

@3flex 3flex changed the title In CI: "0 kotlin files were analyzed." In Travis CI: "0 kotlin files were analyzed." Sep 24, 2018
@3flex
Copy link
Member Author

3flex commented Sep 24, 2018

On closer inspection, looks like this is on Travis only, not AppVeyor... may be a *nix vs Windows issue with detekt itself?

@Mauin Mauin added the bug label Sep 24, 2018
@Mauin
Copy link
Collaborator

Mauin commented Sep 25, 2018

Just to clarify: This does not just affect master builds but pretty much every build on travis it seems. I cannot repro this locally.

@3flex
Copy link
Member Author

3flex commented Oct 9, 2018

Simple when you know what to look for...

The filters set when Travis build runs includes .*/build/*.. Travis checks out the build at /home/travis/build/arturbosch/detekt. Since /build/ is in the full file path, all Kotlin files under the project path are filtered out, so nothing gets scanned.

I'd say the root cause is that though the detekt is run from working directory /home/travis/build/arturbosch/detekt, and expectation is that it's filtering based on the relative path in that working directory it's actually filtering the absolute file path.

@Mauin
Copy link
Collaborator

Mauin commented Oct 9, 2018

Oh. Right... You want to submit a fix for this?
Probably simply changing it to detekt/.*/build/.* or similar

@3flex
Copy link
Member Author

3flex commented Oct 9, 2018

Can do for Travis, yeah. But I'm also going to open a new issue to see if behaviour should change - I'm surprised that it's not just the relative path where the filter applies.

@Mauin
Copy link
Collaborator

Mauin commented Oct 9, 2018

True, that would be the overall better fix for it. Which makes me wonder. Did we change this behavior at some point? (absolute vs relative path considered for excluding paths)

Or did Travis change the directory projects get cloned into...?

@3flex
Copy link
Member Author

3flex commented Oct 9, 2018

I know there have been some recent changes to path filtering in detekt, so my guess is a change was made that inadvertently changed the behaviour.

Opened #1212 to track.

@Mauin
Copy link
Collaborator

Mauin commented Oct 9, 2018

Looking at PathFilter it seems that it did check the absolute path for quite some time.

@3flex
Copy link
Member Author

3flex commented Oct 9, 2018

Do you want to close this in favour of a proper fix for #1212, or implement a workaround?

I'm inclined to close this since root cause is identified and an issue opened to track the issue. AppVeyor appears to run detekt just fine as part of the build so any non-compliant code will still fail CI.

@Mauin
Copy link
Collaborator

Mauin commented Oct 9, 2018

👍 Thanks for opening the concrete issue. We should definitely fix this properly.

@Mauin Mauin closed this as completed Oct 9, 2018
@arturbosch arturbosch added this to the RC10 milestone Nov 2, 2018
@lock
Copy link

lock bot commented Jun 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants