Properties
| Property | Type | Description |
|---|---|---|
| path | string | File path pattern for matching (inherited from base rules) |
| purl | string | Package URL for component matching (inherited from base rules) |
| start_line | number | Starting line number for filtering (scanoss.java only) |
| end_line | number | Ending line number for filtering (scanoss.java only) |
Line Number Matching (scanoss.java only)
When using scanoss.java, the remove rule extends the base matching system with line-range filtering capabilities:- If
start_lineandend_lineare specified, the rule will match components whose local line numbers overlap with the specified range - Line matching is based on the component’s local line numbers, not the OSS file line numbers
- A match occurs when there is any overlap between the specified line range and the component’s lines
Example
Here’s an example that demonstrates removing test files and specific line ranges:-
Removes any component that matches both:
- Path starting with “test/”
- PURL “pkg:github/example/lib@1.0.0”
-
In scanoss.java scans, also removes matches in:
src/main.javabetween lines 100-150
Note: When a match occurs, the component is replaced with a non-match result that maintains the file structure. The output will look like this:This format preserves the file entry while indicating the content was filtered out.
Warning: Line number filtering is only available when using scanoss.java. Other scanners will ignore thestart_lineandend_lineproperties.