How do you get code-quality to only scan a specified directory?

Viewed 456

From reading the documentation here I was able to get a working code-quality CI job added to my pipeline. The YAML looks like this

include:
  - template: Code-Quality.gitlab-ci.yml

code_quality:
  stage: test
  variables:
    SOURCE_CODE: "/src"
  artifacts:
    paths: [gl-code-quality-report.json]

However, even though I specify SOURCE_CODE: /src the job scans the entire project, not just the "src/" directory

How do I go about setting up .gitlab-ci.yml such that the Code-Quality CI job will only scan the "/src" directory? (The /src directory is located in the root of the project)

1 Answers

You need a pattern to match all the files inside the src directory.

SOURCE_CODE: src/** will match all the files in the src directory tree.

Example Matches:

src/foo/bar/xyz.java

src/abc.java

Related