Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pre-commit-template

  1. Install packages
    pip install pre-commit detect-secrets
  2. Initialize global git template directory
    git config --global init.templateDir ~/.git-template
  3. Install pre-commit into the git template
    pre-commit init-templatedir ~/.git-template
  4. Create initial secret scan with custom plugins
    detect-secrets scan --plugin hf-token-plugin.py > .secrets.baseline
    • detect-secrets may expand an absolute file path for the custom plugin, you can edit it to be relative (see our example)
    • Update the baseline as needed
      detect scan --baseline .secrets.baseline
  5. Use git as normal, hooks should run when you get to
    git commit [...]
    • If you see the below warning, the file permissions from the git template did not copy correctly (I think this is system dependent and may be a umask issue? not exactly sure):
      hint: The '.git/hooks/pre-commit' hook was ignored because it's not set as executable.
      
    • Fix this by changing the file permissions of the hooks
      chmod +x .git/hooks/pre-commit

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages