diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 00000000..dc91b0bd --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,21 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - name: Pre-commit + uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..d834be0b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-json + - id: pretty-format-json + args: + - "--autofix" + - "--indent=2" + - "--no-sort-keys" + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/psf/black + rev: 24.3.0 + hooks: + - id: black diff --git a/bal_addresses/requirements-dev.txt b/bal_addresses/requirements-dev.txt index c3b82fe9..3f8c66f0 100644 --- a/bal_addresses/requirements-dev.txt +++ b/bal_addresses/requirements-dev.txt @@ -2,3 +2,4 @@ pytest-mock responses pytest-cov pytest==7.4.0 +pre-commit