From 89bba87faf08c83b8c722baabf2a541d3826cf49 Mon Sep 17 00:00:00 2001 From: Eric Miguel Date: Mon, 29 Jan 2024 18:09:39 -0300 Subject: [PATCH] chore: pre-commit hooks fix (#14) * chore: fix pre-commit config file * feat: pre-commit test/ manual run via pdm command --- .pre-commit-config.yaml | 20 +++++++++++--------- pyproject.toml | 10 ++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d1ddbb9..bb31b89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,47 +7,49 @@ repos: hooks: - id: flake8 name: flake8 - entry: flake8 missil sample tests + entry: pdm run flake8 language: system always_run: true pass_filenames: false - id: pyupgrade name: pyupgrade - entry: pyupgrade missil/__init__.py missil/bearers.py missil/exceptions.py missil/jwt_utilities.py --py310-plus --py311-plus --py312-plus + entry: pdm run pyupgrade language: system always_run: true pass_filenames: false - id: black name: black - entry: black missil sample tests + entry: pdm run black language: system always_run: true pass_filenames: false - id: refurb name: refurb - entry: refurb missil sample tests + entry: pdm run refurb language: system always_run: true pass_filenames: false - id: isort name: isort - entry: isort missil sample tests + entry: pdm run isort language: system always_run: true pass_filenames: false - id: mypy name: mypy - entry: mypy missil sample + entry: pdm run mypy language: system always_run: true pass_filenames: false - id: pydocstyle name: pydocstyle - entry: pydocstyle missil sample + entry: pdm run pydocstyle language: system always_run: true pass_filenames: false - id: test name: test - entry: pytest --cov=missil tests/ - \ No newline at end of file + entry: pdm run pytest --cov=missil tests/ + language: system + always_run: true + pass_filenames: false \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b045c7e..3d15bcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,10 +30,7 @@ classifiers = [ "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP", ] -dependencies = [ - "fastapi>=0.104.1", - "python-jose[cryptography]>=3.3.0", -] +dependencies = ["fastapi>=0.104.1", "python-jose[cryptography]>=3.3.0"] requires-python = ">=3.10" readme = "README.md" license = { text = "MIT" } @@ -150,19 +147,20 @@ pyupgrade = { cmd = [ "sample/main.py", "--py310-plus", "--py311-plus", - "--py312-plus" + "--py312-plus", ] } pydocstyle = { cmd = ["pydocstyle", "missil", "sample"] } improve = { composite = ["flake8", "pyupgrade", "refurb"] } format = { composite = ["autoflake", "black", "isort"] } test = { cmd = ["pytest", "--cov=missil", "tests/"] } code-quality = { composite = [ - "improve", "format", + "improve", "mypy", "pydocstyle", "test", ] } +pre-commit-test-run = { cmd = ["pre-commit", "run", "--all-files"] } [build-system] requires = ["pdm-backend"]