Skip to content

Commit

Permalink
Add pre-commit and remove unsupported os
Browse files Browse the repository at this point in the history
  • Loading branch information
netanelc305 committed Jun 18, 2024
1 parent b7ff1f0 commit b99406c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,24 @@ jobs:
strategy:
matrix:
python-version: [ 3.8, 3.9, "3.10", "3.11" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ macos-latest ]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
- name: Install dependencies
run: |
python -m pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82,F401,E741 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Verify sorted imports
brew install ipsw
python3 -m pip install --upgrade pip
python3 -m pip install pre-commit
- name: Run pre-commit hooks
run: |
python -m pip install isort
isort . -m HANGING_INDENT -l 120 --check-only
pre-commit run --all-files
- name: Test install
run: |
python -m pip install --upgrade pip
python -m pip install -U .
- name: Test show usage
run: |
Expand Down
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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: \.py$

- repo: https://github.com/pycqa/flake8
rev: "7.0.0"
hooks:
- id: flake8
args: [ '--count', '--select=E9,F63,F7,F82,F401,E741', '--show-source', '--statistics', '--max-complexity=10', '--max-line-length=127' ]
files: \.py$

0 comments on commit b99406c

Please sign in to comment.