diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 52aea8b..23ed168 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -33,10 +33,13 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Lint with flake8 + - name: Install dependencies run: | - python -m pip install flake8 - flake8 . --max-complexity=14 --max-line-length=127 --statistics + python3 -m pip install --upgrade pip + python3 -m pip install pre-commit + - name: Run pre-commit hooks + run: | + pre-commit run --all-files - name: Verify sorted imports run: | python -m pip install isort diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..f5e8132 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +# .pre-commit-config.yaml +repos: + - repo: https://github.com/pre-commit/mirrors-isort + rev: v5.9.3 + hooks: + - id: isort + args: [ '-m', 'HANGING_INDENT', '-l', '120','--check-only' ] + files: src/client + + - repo: https://github.com/pycqa/flake8 + rev: "7.0.0" + hooks: + - id: flake8 + args: [ '--max-line-length=127' ] + files: src/client \ No newline at end of file