Skip to content

Commit

Permalink
Add pre-commit, replace GHA workflows, remove flake8 config
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews committed Oct 15, 2023
1 parent a218a97 commit 3fe3544
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 49 deletions.
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

49 changes: 2 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,12 @@ on:
- cron: '0 6 * * 1'

jobs:
black:
name: black
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup
run: pip install black
- name: Lint with black
run: black --check --diff .

flake8:
name: flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup
run: pip install flake8
- name: Lint with flake8
run: flake8

isort:
name: isort
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup
run: pip install isort[colors]
- name: Lint with isort
run: isort --check --diff .

mypy:
name: mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup
run: pip install mypy pytest
- name: Lint with mypy
run: mypy .
- uses: pre-commit/[email protected]

conda:
name: Conda ${{ matrix.python-version }} - ${{ matrix.os }}
Expand Down
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy

0 comments on commit 3fe3544

Please sign in to comment.