For the complete documentation index, see llms.txt. This page is also available as Markdown.

Scanning a Build

In order to collect coverage information SeaLights agents need to first scan the Python script files for the build information.

See 'Generating an Agent token' for instructions on how to generate a token.

Scanning a build

Scanning a build in Python is done using the Python agent with the scan flag:

sl-python scan

you can also use the command with explicit parameters

sl-python scan --tokenFile ./sltoken.txt --buildSessionIdFile ./path-to/buildSessionId.txt --scmType none

See Command Reference for command details.

Using .slignore to Exclude Files or Directories

Use a .slignore file to exclude specific Python files or directories from being scanned. It works like a .gitignore, giving you finer control than CLI‑only exclusions.

Create a .slignore file in the project root:

# Comments start with #

# Exclude virtual environments
**/venv/**
**/.venv/**

# Exclude test folders (default behavior also excludes "*tests*")
**/tests/**

# Exclude Python caches
**/__pycache__/**
**/*.pyc

# Exclude generated or vendored code
**/generated/**
**/site-packages/**

# Exclude specific legacy files
legacy/old_script.py

Pattern Syntax

.slignore follows .gitignore rules (same as other SeaLights agents): [docs.sealights.io], [docs.sealights.io]

  • ** matches any directory depth

  • * matches any characters within a directory

  • Lines starting with # are comments

  • Empty lines are ignored

  • Prefix ! to include something inside an excluded area

Merge and Precedence (Simple Rules)

The Python Agent resolves configuration values using the following precedence order (highest to lowest):

  1. Environment variables

  2. CLI parameters (--excludeFiles, --includeFiles, and others)

  3. .slignore file

Important Notes

  • Environment variables always take precedence over all other configuration sources.

  • CLI parameters override values defined in the .slignore file and default settings.

  • The .slignore file is applied during every scan operation (test and runtime execution).

  • Python Agent defaults are applied only when no explicit configuration is provided.

Tips

  • Start with minimal patterns and add more as needed.

  • Inspect what’s being scanned by running the scan with high‑verbosity logs.

  • Use .slignore for file‑level control when CLI excludes are too coarse.

Last updated

Was this helpful?