diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 0000000..e48ea73 --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,25 @@ +name: Format and Lint Checks +on: + push: + branches: + - master + paths: + - '*.py' + - '*.ipynb' + pull_request: + types: [ assigned, opened, synchronize, reopened ] +jobs: + check: + name: Format and Lint Checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: 'pip' + - run: python -m pip install --upgrade pip + - run: python -m pip install -r requirements/dev.txt + - run: python -m flake8 maploc + - run: python -m isort maploc *.ipynb --check-only --diff + - run: python -m black maploc *.ipynb --check --diff diff --git a/requirements/dev.txt b/requirements/dev.txt new file mode 100644 index 0000000..acae39b --- /dev/null +++ b/requirements/dev.txt @@ -0,0 +1,3 @@ +black[jupyter]==24.2.0 +isort +flake8