Skip to content

Commit

Permalink
Merge pull request #361 from afuetterer/342-remove-yapf-from-pre-commit
Browse files Browse the repository at this point in the history
chore: remove yapf from pre-commit config
  • Loading branch information
huberrob committed Aug 23, 2023
2 parents 7462287 + 9411f88 commit b37283b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 529 deletions.
38 changes: 7 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,50 +51,26 @@ jobs:
# TODO: add W flag back after fixing warnings
SPHINXOPTS='-n' make -C docs html
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
matrix:
include:
- name: pre-commit-errors
skip-hooks: pylint-warnings
strict: false
- name: pre-commit-warnings
skip-hooks: pylint-errors
strict: true

name: ${{ matrix.name }}
continue-on-error: ${{ matrix.strict }}

lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
path: |
~/.cache/pip
~/.cache/pre-commit
key: pip-pre-commit-${{ hashFiles('.pre-commit-config.yaml', 'pyproject.toml') }}
restore-keys: |
pip-pre-commit-
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install python dependencies
run: |
pip install .[testing]
pip freeze
pip show fuji
- run: pip install pre-commit
- name: Run pre-commit
run: |
SKIP=${{ matrix.skip-hooks }} pre-commit run --all-files || (git status --short; git diff ; exit 1)
run: pre-commit run --all-files --color=always

tests:

Expand Down
25 changes: 2 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,11 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: double-quote-string-fixer
types: [python]
- id: end-of-file-fixer
- id: fix-encoding-pragma
exclude_types: [json]
- id: mixed-line-ending
types: [python]
- id: trailing-whitespace
types: [python]
types_or: [markdown, json, python, yaml]
- id: check-yaml
- id: check-json

- repo: https://github.com/google/yapf
rev: v0.40.1
hooks:
- id: yapf
name: yapf
types: [python]
exclude: &exclude_files >
(?x)^(
docs/.*|
)$
args: ["-i"]

# TODO: reenable and work through the massive list of errors and warnings
# - repo: https://github.com/pycqa/pylint
# rev: pylint-2.8.0
# hooks:
# - id: pylint
# exclude: '^(docs/)|(examples/)|(fuji_server/models/)'
Loading

0 comments on commit b37283b

Please sign in to comment.