Skip to content

Commit

Permalink
use ruff for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jGaboardi committed Jul 2, 2024
1 parent 58407eb commit 68e615f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
9 changes: 2 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
files: "giddy\/"
repos:
- repo: https://github.com/psf/black
rev: "24.3.0"
hooks:
- id: black
language_version: python3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.5"
rev: "v0.5.0"
hooks:
- id: ruff
- id: ruff-format

ci:
autofix_prs: false
Expand Down
2 changes: 1 addition & 1 deletion giddy/directional.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def permute(self, permutations=99, alternative="two.sided"):
P = NEG * L + (1 - NEG) * S
self.p = P
else:
print("Bad option for alternative: %s." % alternative)
print(f"Bad option for alternative: {alternative}")

def _calc(self, Y, w, k):
wY = weights.lag_spatial(w, Y)
Expand Down
16 changes: 4 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Repository = "https://github.com/pysal/giddy"

[project.optional-dependencies]
dev = [
"black",
"ruff",
"pre-commit",
]
Expand All @@ -65,20 +64,12 @@ include = [
"giddy.*",
]

[tool.black]
line-length = 88
extend-exclude = '''
(
docs/conf.py
)
#'''

[tool.ruff]
line-length = 88
select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
target-version = "py39"
lint.select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
exclude = ["giddy/tests/*", "docs/*"]
[tool.ruff.per-file-ignores]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401" # imported but unused
]
Expand All @@ -97,6 +88,7 @@ exclude = ["giddy/tests/*", "docs/*"]
"E501", # Line too long
]


[tool.coverage.run]
source = ["./giddy"]

Expand Down

0 comments on commit 68e615f

Please sign in to comment.