Skip to content

Commit

Permalink
Merge pull request #305 from JamesParrott/Synced_with_PyShp
Browse files Browse the repository at this point in the history
Add ruff format hook to pre-commit config, target Python 3.7, turn it off (for Python 2) where it adds trailing comma after *args
  • Loading branch information
JamesParrott authored Sep 19, 2024
2 parents 35ad714 + eee6180 commit 7fbbd8e
Show file tree
Hide file tree
Showing 4 changed files with 1,310 additions and 738 deletions.
5 changes: 4 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ repos:
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
hooks:
- id: ruff-format
66 changes: 66 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,72 @@
requires = ["setuptools"]
build-backend = "setuptools.build_meta"


[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

# Same as Black.
line-length = 88
indent-width = 4

# Assume Python 3.9
target-version = "py37"

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
select = ["E4", "E7", "E9", "F"]
ignore = []

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"



[tool.pylint.MASTER]
load-plugins=[
"pylint_per_file_ignores",
Expand Down
Loading

0 comments on commit 7fbbd8e

Please sign in to comment.