Skip to content

Commit

Permalink
Use standard pre-commit config (#15)
Browse files Browse the repository at this point in the history
* Add standard pre-commit config

* pre-commit fixes
  • Loading branch information
dstansby authored Feb 13, 2023
1 parent e93fc18 commit 8f5dc7e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 29 deletions.
18 changes: 5 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
types: [text]
types_or: [python, cython]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand All @@ -17,15 +11,12 @@ repos:
args: [--fix=lf]
- id: requirements-txt-fixer
- id: trailing-whitespace
# bump2version produces whitespace in setup.cfg, so exclude to
# not inferfere with versioning
exclude: setup.cfg
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.240
hooks:
- id: flake8
- id: ruff
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
Expand All @@ -34,3 +25,4 @@ repos:
- id: mypy
additional_dependencies:
- types-setuptools
- types-requests
22 changes: 8 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
[tool.black]
target-version = ['py38', 'py39', 'py310']
skip-string-normalization = false
line-length = 79
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''

[tool.ruff]
line-length = 79
exclude = ["__init__.py","build",".eggs"]
select = ["I", "E", "F"]
fix = true
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ commit = True
tag = True
tag_name = {new_version}
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<rc>\d+))?
serialize =
serialize =
{major}.{minor}.{patch}-{release}{rc}
{major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = prod
first_value = rc
values =
values =
rc
prod

Expand Down

0 comments on commit 8f5dc7e

Please sign in to comment.