diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d0197a8f..ae315bfb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -72,3 +72,10 @@ repos: language: python types: [python] args: ["--fail-under", "100", "--ignore-module", "--ignore-init-method", "--ignore-nested-functions", "--verbose"] + + - id: unit-tests + name: Run unit tests before push + entry: bash -c 'pytest unit_tests/' + language: system + pass_filenames: false + stages: [push] diff --git a/README.rst b/README.rst index c204c2a3..8fed1254 100644 --- a/README.rst +++ b/README.rst @@ -99,10 +99,13 @@ Setup and Installation 4. **Install Pre-Commit Hooks**: + Pre-commit hooks are used to enforce code formatting, linting, and unit testing before code is committed or pushed for review. + .. code-block:: bash - # Install pre-commit hooks for linting and formatting (run in the repository's root directory) - pre-commit install + # Install hooks for commit-time (linting, formatting) and push-time (unit test enforcement) + pre-commit install --hook-type pre-commit + pre-commit install --hook-type pre-push Configuration -------------