The -lf option allows user to scan only the files listed in a provided text file. This is useful to speed up scans and restrict results to only the relevant files.User can provide a text file containing relative file paths (one per line), and Embold will scan only those files for code issues.

Note: This is only supported in remote scan

The file which is provided with -lf option contain path in following format

src/main/java/com/example/Calculator.java
src/test/java/com/example/CalculatorTest.java

User can use the following git command to generate a list of files that changed between two commits in a specific repository directory:
git -C /absolute/path/to/repo diff --name-only <old_commit>^ <new_commit> > /absolute/path/to/changedfiles.txt

Example:

git -C /home/user/my-repo diff --name-only 1d2d347c3b3acfcab31d830f1a67908cb00dc9df^ 057209443711b927d2e7ae7d40dc51d7fc22c93f > /home/user/changedfiles.txt

  • Replace /home/user/my-repo with the absolute path to your Git repository.
  • Replace /home/user/changedfiles.txt with the desired absolute path where you want to save the list of changed files.

Now run Embold scan using -lf option

Syntax:

./embold-scanner analyse -c <config-file> -u <embold_url> -t <embold_token> -lf <path-to-the-file-list.txt>

  • <config-file>: Path to your Embold configuration JSON.
  • <embold-url>: Your Embold server URL.
  • <embold-token>: Your access token.
  • <path-to-file-list.txt>: Text file listing relative paths of files to be scanned.

Example:

./embold-scanner analyse \
-c /Users/user/repository-configuration.json \
-u \
-t \
-lf /Users/user/changedfiles.txt

This will scan only the files listed in changedfiles.txt and publish issues relevant to them.