From d98ffdf7b479e263a4b79da8d28e8b46afbeb537 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Fri, 13 Dec 2024 12:15:27 -0500 Subject: [PATCH] chore: update pre commit configuration - change from local install to the standard repo based config and remove the various pre-commit tools from requirements.dev - bump versions from most tools - add an exception for feat_params.json which will never comply --- .pre-commit-config.yaml | 56 ++++++++++++++++++----------------------- requirements.dev.txt | 9 ------- 2 files changed, 24 insertions(+), 41 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 789d5ad6..d9bc099b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,37 +1,29 @@ repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 hooks: - - id: check-yaml - - id: check-json - - id: end-of-file-fixer - - id: trailing-whitespace + - id: check-yaml + - id: check-json + exclude: feat_params.json + - id: end-of-file-fixer + - id: check-added-large-files + - id: trailing-whitespace exclude: \.svg$ -- repo: local - # Using local repos because these won't work for me from remote repo -EJ - # They're also more convenient because we install them via requirements.dev.txt - # and they are then available on the command line as well as in pre-commit. + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 hooks: - - id: isort - name: isort - entry: isort - language: system - types: [python] - stages: [pre-commit] - - id: black - name: black - entry: black - language: system - types: [python] - stages: [pre-commit] - - id: mypy - name: mypy - entry: mypy - language: system - types: [python] - stages: [pre-commit] -- repo: https://github.com/pycqa/flake8 - # do flake8 last to avoid duplicate reports - rev: 7.0.0 + - id: isort + args: [--profile=black] + - repo: https://github.com/psf/black + rev: 24.8.0 hooks: - - id: flake8 + - id: black + - repo: https://github.com/pycqa/flake8 + rev: 7.1.1 + hooks: + - id: flake8 + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.13.0 + hooks: + - id: mypy + additional_dependencies: [pydantic, types-requests, types-python-slugify] diff --git a/requirements.dev.txt b/requirements.dev.txt index fddc063c..8f20771f 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,14 +1,5 @@ # This is a set of development dependencies -black~=24.3 -flake8>=4.0.1 gitlint-core>=0.17.0 httpx>=0.24.1 -isort>=5.10.1 -mypy>=1.4.1 -mypy>=1.5.1; python_version >= "3.8" pep440>=0.1.2 pre-commit>=2.6.0 -types-python-slugify>=5.0.3 -types-pyyaml>=6.0.5 -types-requests>=2.31.0 -types-setuptools>=57.4.9