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: Added functionality to specify a custom scan when using the scan command #565

Merged

Conversation

ian-bowden-slalom
Copy link
Contributor

@ian-bowden-slalom ian-bowden-slalom commented Jun 11, 2024

secureli-XXX

Changes

This PR improves the scan action by adding new functionality allowing users to specify a custom scan id instead of only being able to specify pre-commit hook ids. For example, you can now do secureli scan -t check-pii to run the pii scan.

A new service was introduced, CustomScannersService to help orchestrate which custom scans should be run. Either a specific scan if an Id is specified, all custom scans if no id is specified, or a None result is returned if the specified id doesn't match a value in the new CustomScanId enum. 

There was also some refactoring done. modules/core/core_services/scanner.py is now modules/core/core_services/hook_scanner.py to more accurately describe its function. The pii scanner and custom_regex_scanner directories have been moved into a new directory; secureli/modules/custom_scanners/

Testing

Added unit tests and performed manual testing to confirm that pre-commit hooks can be specified, custom scans can be specified, and when no id is specified, then all scans are done

Clean Code Checklist

  • Meets acceptance criteria for issue
  • New logic is covered with automated tests
  • Appropriate exception handling added
  • Thoughtful logging included
  • Documentation is updated
  • Follow-up work is documented in TODOs
  • TODOs have a ticket associated with them
  • No commented-out code included

@ian-bowden-slalom ian-bowden-slalom marked this pull request as ready for review June 12, 2024 14:03
.secureli.yaml Outdated Show resolved Hide resolved
@ian-bowden-slalom ian-bowden-slalom merged commit 385803d into main Jun 14, 2024
5 checks passed
@ian-bowden-slalom ian-bowden-slalom deleted the feature/secureli-489-update-specific-test-flag-on-scan branch June 14, 2024 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update specific-test flag on scan command to include custom hooks
2 participants