Teamcity code inspections include exclude patterns not working

Answered

I have a complex Android Java / Kotlin code base with multiple sub-modules and also there are tests in the sub module.

I want to run the code inspection on specific parts of the code base, i tried the include excludes patterns in different combinations without any success.

These are the different combinations that i tried

file[app]:src/main/java//*||file[library]:src/main/java//*||file[library]:src/main/kotlin//*||file[library]:src/main//*;
[library]/src/main/java/**;[library]/src/main/kotlin/**;[app]/src/main/java/**;[library]/src/main/AndroidManifest.xml;[app]/src/main/AndroidManifest.xml;
library/src/main/java/*;library/src/main/kotlin/*;app/src/main/java/*;library/src/main/AndroidManifest.xml;**.java;**.kt;
app/src/main/java/**;library/src/main/java/**;library/src/main/kotlin/**;

But this doesn't seem to work, files from other parts of the project are also inspected. I use TeamCity Enterprise 2019.2.1 (build 71758)


What am i doing wrong in here ?

0
7 comments

Hi,

 

there are a few wrong things on those patterns. First of all, the description of the field right below it already describes the pattern, for a much more detailed description click on the "?" icon on it. The icon links to the docs here: https://www.jetbrains.com/help/teamcity/2019.2/inspections.html#Inspections-IdeaPatterns

 

In particular:

-The list is not a ";" separated list, but a newline-delimited one.

-The patterns do not support file-level patterns, are forced to end either on "**" or "*". This is described in the article linked in that button

 

If you have troubles getting the patterns to work, we'd recommend starting with a single pattern to ensure that they are working properly on your setup, then move forward with them.

0

This is what I gave in the the include exclude patterns, it is still in vain. No success.

+:app/src/main/java/**
+:library/src/main/java/**
+:library/src/main/kotlin/**
-:app/src/androidTest/**
-:app/src/test/**
-:library/src/test/**
-:library/src/androidTest/**
-:DemoApp/**
-:buildSrc/**
-:artifacts/**
-:testTools/**

0

Hi,

 

thanks for the follow up. Once you add include patterns (+:app/src/main/java/**), everything not added in an include pattern is excluded (there is an exception to everything on the folder directly above it), so your exclusion rules seem like they're not needed, and they might be interfering with the rest. Could you remove the exclusion patterns, leave only the inclusion ones and try again? If it still doesn't work, does it show any error message?

0

Sorry for the delay. There are lot of warnings. But the project can build successfully.


2020-05-13 22:47:42,937 [ 147509] WARN - asspathModuleGradleDataService - Gradle SDK distribution type was not configured for the project at /home/xxx/TeamCity/buildAgent/fasterHDD/work/f9674900e92e3422
22:47:42
2020-05-13 22:47:42,942 [ 147514] WARN - asspathModuleGradleDataService - Gradle SDK distribution type was not configured for the project at /home/xxx/TeamCity/buildAgent/fasterHDD/work/f9674900e92e3422
22:47:42
2020-05-13 22:47:42,944 [ 147516] WARN - asspathModuleGradleDataService - Gradle SDK distribution type was not configured for the project at /home/xxx/TeamCity/buildAgent/fasterHDD/work/f9674900e92e3422
22:47:42
2020-05-13 22:47:42,944 [ 147516] WARN - asspathModuleGradleDataService - Gradle SDK distribution type was not configured for the project at /home/xxx/TeamCity/buildAgent/fasterHDD/work/f9674900e92e3422
22:47:42
2020-05-13 22:47:42,945 [ 147517] WARN - asspathModuleGradleDataService - Gradle SDK distribution type was not configured for the project at /home/xxx/TeamCity/buildAgent/fasterHDD/work/f9674900e92e3422
22:47:43
2020-05-13 22:47:43,145 [ 147717] WARN - ule.android.SdkModuleSetupStep - Path to Android SDK not set
22:47:43
2020-05-13 22:47:43,151 [ 147723] WARN - ule.android.SdkModuleSetupStep - # of eligible SDKs: 0
22:47:43
2020-05-13 22:47:43,698 [ 148270] WARN - ule.android.SdkModuleSetupStep - Path to Android SDK not set
22:47:43
2020-05-13 22:47:43,698 [ 148270] WARN - ule.android.SdkModuleSetupStep - # of eligible SDKs: 0
22:47:44
2020-05-13 22:47:44,130 [ 148702] WARN - ule.android.SdkModuleSetupStep - Path to Android SDK not set
22:47:44
2020-05-13 22:47:44,130 [ 148702] WARN - ule.android.SdkModuleSetupStep - # of eligible SDKs: 0
0

Do the correct inspections appear now? or do you only have the warnings? This warnings seem to come from gradle rather than teamcity, so I'm not sure how they are relevant here. Would you mind expanding please?

0

Hi

I facing with same issue Teamcity 2021.1.2 (build 92869)

exclude patterns is

but after checking inspections, there is files from excluded directory

0

Is there some argument to logging processing of patterns?

0

Please sign in to leave a comment.