Precommit is one of my favorite tools to leverage in your DevOps toolchain.

Precommit Website

repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
    -   id: check-yaml
    -   id: end-of-file-fixer
    -   id: trailing-whitespace
-   repo: https://github.com/psf/black
    rev: 21.12b0
    hooks:
    -   id: black
- repo: https://github.com/enchanted-ghost/git-secrets-pre-commit
  rev: main
  hooks:
    - id: git-secrets-scan
    - id: git-secrets-commit-msg
    - id: git-secrets-merge-check