-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add logic to handle overwriting existing pre-commit hooks (#410)
secureli-372 closes #372 Handles overwriting existing pre-commit install in the user's repo on new install ## Changes * Adds logic to check if pre-commit hook exists and if so, creates a backup of the current file and overwrites it with SeCureLI's pre-commit content * Print a warning to the user to let them know that the file is being overwritten and that a backup is created ## Testing Initialize SeCureLI on a git repo with an existing pre-commit file <img width="677" alt="Screenshot 2024-01-30 at 2 01 42 PM" src="https://github.com/slalombuild/secureli/assets/58826693/11240502-db9b-4b29-a3aa-87b400518638"> ## Clean Code Checklist <!-- This is here to support you. Some/most checkboxes may not apply to your change --> - [x] Meets acceptance criteria for issue - [x] New logic is covered with automated tests - [x] Appropriate exception handling added - [x] Thoughtful logging included - [ ] Documentation is updated - [ ] Follow-up work is documented in TODOs - [ ] TODOs have a ticket associated with them - [x] No commented-out code included <!-- Github-flavored markdown reference: https://docs.github.com/en/get-started/writing-on-github --> --------- Co-authored-by: Tyler D <[email protected]>
- Loading branch information
1 parent
6049985
commit 7741740
Showing
4 changed files
with
170 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters