Skip to content

Commit

Permalink
pre-commit: Replace flake8, isort, and pyupgrade with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Feb 28, 2023
1 parent 2ea9442 commit 4200898
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
16 changes: 4 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@ repos:
- id: end-of-file-fixer
exclude: '.*\.pth$'
- id: debug-statements
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.253
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
- id: ruff
# args: [--fix, --exit-non-zero-on-fix]
26 changes: 26 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# [tool.ruff] # <- TODO Uncomment when migrating to pyproject.toml
exclude = [
".eggs",
".tox",
"build",
"ci/templates",
"dist",
]
line-length = 140
select = [
"E",
"F",
"I",
"PLC",
"PLE",
"UP",
"W",
]
target-version = "py37"

# [tool.ruff.isort] # <- TODO Uncomment when migrating to pyproject.toml
[isort]
# default-section = "THIRDPARTY"
force-single-line = true
forced-separate = ["test_pytest_cov"]
known-first-party = ["pytest_cov"]
8 changes: 4 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ prune examples/adhoc-layout/*.egg-info
prune examples/src-layout/src/*.egg-info

graft .github/workflows
graft src
graft ci
graft src
graft tests

include .bumpversion.cfg
include .cookiecutterrc
include .coveragerc
include .editorconfig
include tox.ini
include .readthedocs.yml
include .pre-commit-config.yaml
include .readthedocs.yml
include .ruff.toml
include AUTHORS.rst
include CHANGELOG.rst
include CONTRIBUTING.rst
include LICENSE
include README.rst

include tox.ini

global-exclude *.py[cod] __pycache__/* *.so *.dylib

0 comments on commit 4200898

Please sign in to comment.