Skip to content

Commit

Permalink
chore: pre-commit hooks fix (#14)
Browse files Browse the repository at this point in the history
* chore: fix pre-commit config file
* feat: pre-commit test/ manual run via pdm command
  • Loading branch information
ericmiguel authored Jan 29, 2024
1 parent f59f654 commit 89bba87
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
20 changes: 11 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/

entry: pdm run pytest --cov=missil tests/
language: system
always_run: true
pass_filenames: false
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit 89bba87

Please sign in to comment.