- Include or exclude specific packages.
- Include or exclude specific directories.
- Include or exclude with a Glob style expressions.
- Use include and exclude patterns together to exclude specific directories such as a test directory from a scan.
- Use multiple include and exclude patterns together to exclude or include specific directories or file paths.
Scoping scans with endorctl
To include or exclude a package based on its file name when you scan with endorctl.- Include path
- Exclude path
- Include Directory
- Exclude Directory
Examples of scoping scan
The following examples show how you can use scoping scans. Use--exclude-path="src/java/**" to exclude all files under src/java, including all its subdirectories.
--exclude-path="src/java/**" to only exclude the files under src/java, but not its subdirectories.
--include-path and --exclude-path together to exclude specific directories such as test directories.
- Use multiple exclusion patterns together.
Best practices of scoping scans
Here are a few best practices of using scoping scans:- Ensure that you enclose your exclude pattern in double quotes to avoid shell expansion issues. For example, do not use
--exclude-path=src/test/**, instead, use--exclude-path="src/test/**". - Inclusion patterns are not designed for documentation or example directories. You cannot explicitly include documentation or example directories:
docs/documentation/groovydoc/javadocman/examples/demos/inst/doc/samples/
- The specified paths must be relative to the root of the directory.
- If you are using JavaScript workspaces, Endor Labs automatically detects workspace roots and their lock files:
- You can scan individual workspace packages without explicitly including the root package. The scanner automatically detects the workspace root and locates the lock file.
- For example, to scan only a specific workspace package:
endorctl scan --include-path="packages/utils/**"- the scanner automatically finds and uses the lock file at the workspace root. - You can still exclude specific child packages from your scan while the workspace root is automatically detected.