Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: SP-1856 scanoss py update scanoss settings file schema #84

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6c7b3db
feat: SP-1856 Modify scanoss settings schema
matiasdaloia Nov 19, 2024
d827f66
feat: SP-1856 Initialize scan filter class
matiasdaloia Nov 19, 2024
a86361b
feat: SP-1856 Refactor to pattern matching
matiasdaloia Nov 19, 2024
58bd5c1
feat: SP-1856 Fix scan folder method
matiasdaloia Nov 19, 2024
12c80b8
feat: SP-1856 Fix skip dir
matiasdaloia Nov 20, 2024
f351b13
feat: SP-1856 Update changelog
matiasdaloia Nov 20, 2024
057519e
feat: SP-1856 Fix and add tests
matiasdaloia Nov 20, 2024
b156a24
feat: SP-1856 Handle when scanoss settings file is skipped or does no…
matiasdaloia Nov 20, 2024
8c77580
feat: SP-1856 Fix tests
matiasdaloia Nov 20, 2024
9b5dd93
feat: SP-1856 Add support for skipping default filtered extensions, f…
matiasdaloia Nov 20, 2024
df5d105
feat: SP-1856 Update docs
matiasdaloia Nov 20, 2024
2d8bb46
feat: SP-1856 Add json schema validation
matiasdaloia Dec 2, 2024
6db2001
feat: SP-1856 Use scan filters in wfp_folder
matiasdaloia Dec 3, 2024
e82f29d
feat: SP-1856 Use scan filters in scan_files
matiasdaloia Dec 3, 2024
0a302ef
feat: SP-1856 Fix unit tests
matiasdaloia Dec 3, 2024
fcee407
feat: SP-1856 Fix unit tests
matiasdaloia Dec 3, 2024
614a3db
feat: SP-1856 Update scanoss settings schema
matiasdaloia Dec 9, 2024
14da941
feat: SP-1856 Update docs
matiasdaloia Dec 9, 2024
3a778a6
feat: SP-1856 Add check for hidden files, remove unused functions
matiasdaloia Dec 12, 2024
6a3fc55
feat: SP-1856 Add case insensitive for dir names
matiasdaloia Dec 12, 2024
5e2b515
feat: SP-1856 Add copyright to scan_filter class
matiasdaloia Dec 12, 2024
86e31f2
feat: SP-1856 Use fast winnowing
matiasdaloia Dec 12, 2024
3da9929
feat: SP-1856 Make scan_filter case insensitive
matiasdaloia Dec 12, 2024
d16506a
feat: SP-1856 Adapt filter logic to new settings json schema
matiasdaloia Dec 13, 2024
c9539b4
feat: SP-1856 Fix relative paths when filtering folders
matiasdaloia Dec 13, 2024
6015329
feat: SP-1856 Add debug logs
matiasdaloia Dec 13, 2024
7c4972b
feat: SP-1856 Make sure path matching is case insensitive
matiasdaloia Dec 13, 2024
2e74940
feat: SP-1856 Fix file_filters tests
matiasdaloia Dec 13, 2024
88282fd
feat: SP-1856 Add scanoss settings to wfp method
matiasdaloia Dec 13, 2024
898a64b
feat: SP-1856 Skip hidden files
matiasdaloia Dec 16, 2024
fe87f90
feat: SP-1856 Use previous logic for default filters instead of pathspec
matiasdaloia Dec 17, 2024
3636744
feat: SP-1856 Fix and add more unit tests
matiasdaloia Dec 17, 2024
3f77e7c
filtering cleanup
eeisegn Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ docs/build

!tests/data/*.json
!docs/source/_static/*.json
!scanoss-settings-schema.json
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Upcoming changes...

## [1.19.0] - 2024-11-20
### Fixed
- Check if legacy sbom file before post processing
### Added
- Use scanoss.json as default settings file if no argument is supplied
- Add —skip-settings-file flag
- Update scanoss settings schema to allow skipping specific folders, files, and extensions
- Add FileFilters class to handle filtering of files and folders based on settings

## [1.18.1] - 2024-11-19
### Added
- Added 'component' field in CycloneDX output
Expand Down Expand Up @@ -408,4 +417,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[1.17.4]: https://github.com/scanoss/scanoss.py/compare/v1.17.3...v1.17.4
[1.17.5]: https://github.com/scanoss/scanoss.py/compare/v1.17.4...v1.17.5
[1.18.0]: https://github.com/scanoss/scanoss.py/compare/v1.17.5...v1.18.0
[1.18.1]: https://github.com/scanoss/scanoss.py/compare/v1.17.5...v1.18.1
[1.18.1]: https://github.com/scanoss/scanoss.py/compare/v1.18.0...v1.18.1
[1.19.0]: https://github.com/scanoss/scanoss.py/compare/v1.18.1...v1.19.0
122 changes: 122 additions & 0 deletions docs/source/_static/scanoss-settings-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,127 @@
}
}
},
"settings": {
"type": "object",
"description": "Scan settings and other configurations",
"properties": {
"skip": {
"type": "object",
"description": "Set of rules to skip files from fingerprinting and scanning",
"properties": {
"patterns": {
"type": "object",
"properties": {
"scanning": {
"type": "array",
"description": "List of glob patterns to skip files from scanning",
"items": {
"type": "string",
"examples": [
"path/to/folder",
"path/to/folder/**",
"path/to/folder/**/*",
"path/to/file.c",
"path/to/another/file.py",
"**/*.ts",
"**/*.json"
]
},
"uniqueItems": true
},
"fingerprinting": {
"type": "array",
"description": "List of glob patterns to skip files from fingerprinting",
"items": {
"type": "string",
"examples": [
"path/to/folder",
"path/to/folder/**",
"path/to/folder/**/*",
"path/to/file.c",
"path/to/another/file.py",
"**/*.ts",
"**/*.json"
]
},
"uniqueItems": true
}
}
},
"sizes": {
"type": "object",
"description": "Set of rules to skip files based on their size.",
"properties": {
"scanning": {
"type": "array",
"items": {
"type": "object",
"properties": {
"patterns": {
"type": "array",
"description": "List of glob patterns to apply the min/max size rule",
"items": {
"type": "string",
"examples": [
"path/to/folder",
"path/to/folder/**",
"path/to/folder/**/*",
"path/to/file.c",
"path/to/another/file.py",
"**/*.ts",
"**/*.json"
]
}
},
"min": {
"type": "integer",
"description": "Minimum size of the file in bytes"
},
"max": {
"type": "integer",
"description": "Maximum size of the file in bytes"
}
}
}
},
"fingerprinting": {
"type": "array",
"items": {
"type": "object",
"properties": {
"patterns": {
"type": "array",
"description": "List of glob patterns to apply the min/max size rule",
"items": {
"type": "string"
},
"examples": [
"path/to/folder",
"path/to/folder/**",
"path/to/folder/**/*",
"path/to/file.c",
"path/to/another/file.py",
"**/*.ts",
"**/*.json"
]
},
"min": {
"type": "integer",
"description": "Minimum size of the file in bytes"
},
"max": {
"type": "integer",
"description": "Maximum size of the file in bytes"
}
}
}
}
}
}
}
}
}
},
"bom": {
"type": "object",
"description": "BOM Rules: Set of rules that will be used to modify the BOM before and after the scan is completed",
Expand Down Expand Up @@ -130,3 +251,4 @@
}
}
}

Loading
Loading