From eba15876e1791f894800881f6465d943d361a233 Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Wed, 10 Jan 2024 21:11:18 -0500 Subject: [PATCH] Update pre-commit config --- .github/workflows/main.yaml | 7 ---- .isort.cfg | 2 - .pre-commit-config.yaml | 75 +++++++++++++++++-------------------- 3 files changed, 34 insertions(+), 50 deletions(-) delete mode 100644 .isort.cfg diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 400d172..c75df18 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -34,10 +34,3 @@ jobs: name: Running Tests run: | for nb in **/*.ipynb; do echo $nb; time jupyter nbconvert --to notebook --execute $nb; done - - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4.2.0 - - uses: pre-commit/action@v3.0.0 diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index 0fc010f..0000000 --- a/.isort.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[settings] -known_third_party = diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43aa4cc..2cb5379 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,62 +1,55 @@ +ci: + # autoupdate_schedule: quarterly + autofix_prs: false + repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-docstring-first - id: check-json - id: check-yaml - - id: pretty-format-json - args: ['--autofix', '--indent=2', '--no-sort-keys'] + - id: debug-statements + - id: mixed-line-ending - - repo: https://github.com/ambv/black - rev: 20.8b1 + - repo: https://github.com/asottile/pyupgrade + rev: v3.3.1 hooks: - - id: black - args: ['--line-length', '100'] + - id: pyupgrade + args: + - '--py38-plus' - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + - repo: https://github.com/psf/black + rev: 23.3.0 hooks: - - id: flake8 + - id: black - - repo: https://github.com/asottile/seed-isort-config - rev: v2.2.0 - hooks: - - id: seed-isort-config - - repo: https://github.com/pre-commit/mirrors-isort - rev: v5.6.4 + - repo: https://github.com/keewis/blackdoc + rev: v0.3.8 hooks: - - id: isort + - id: blackdoc - - repo: https://github.com/deathbeds/prenotebook - rev: f5bdb72a400f1a56fe88109936c83aa12cc349fa + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: 'v0.0.260' hooks: - - id: prenotebook + - id: ruff + args: ['--fix'] - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.2.1 + rev: v3.0.0-alpha.6 hooks: - id: prettier - files: "\\.(\ - css|less|scss\ - |graphql|gql\ - |html\ - |js|jsx\ - |json\ - |ts|tsx\ - |vue\ - |yaml|yml\ - )$" - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.2.1 - hooks: - - id: prettier - name: prettier-markdown - entry: prettier --write --parser mdx - files: "\\.(\ - |md|markdown|mdown|mkdn\ - |mdx\ - )$" + - repo: https://github.com/nbQA-dev/nbQA + rev: 1.7.0 + hooks: + - id: nbqa-ruff + args: ['--fix'] + - id: nbqa-isort + args: ['--profile=black'] + additional_dependencies: [isort==5.6.4] + - id: nbqa-black + - id: nbqa-pyupgrade + args: ['--py37-plus']