Skip to content

Commit

Permalink
Update ruff versions (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulf81 authored Feb 11, 2025
1 parent f3f42ed commit a3a5b6e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.241
rev: v0.9.6
hooks:
- id: ruff

Expand Down
2 changes: 1 addition & 1 deletion floris/floris_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@ def merge_floris_models(fmodel_list, reference_wind_height=None):
or general solver settings.
"""

if not all( type(fm) == FlorisModel for fm in fmodel_list ):
if not all( type(fm) is FlorisModel for fm in fmodel_list ):
raise TypeError(
"Incompatible input specified. fmodel_list must be a list of FlorisModel objects."
)
Expand Down
19 changes: 10 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ develop = [
"pytest~=8.0",
"pytest-benchmark~=5.1",
"pre-commit~=4.0",
"ruff~=0.7",
"ruff~=0.9",
"isort~=5.0"
]

Expand Down Expand Up @@ -141,20 +141,20 @@ filterwarnings = [
[tool.ruff]
src = ["floris", "tests"]
line-length = 100
target-version = "py310"
target-version = "py313"

# See https://github.com/charliermarsh/ruff#supported-rules
# for rules included and matching to prefix.
select = ["F", "E", "W", "C4", ] #"T20", "I"
lint.select = ["F", "E", "W", "C4", ] #"T20", "I"
# I - isort is not fully implemented in ruff so there is not parity. Consider disabling I.

# F401 unused-import: Ignore until all used isort flags are adopted in ruff
ignore = ["F401"]
lint.ignore = ["F401"]

# Allow autofix for all enabled rules (when `--fix`) is provided.
# fixable = ["A", "B", "C", "D", "E", "F"]
fixable = ["F", "E", "W", "C4"] #"T20", "I"
unfixable = []
lint.fixable = ["F", "E", "W", "C4"] #"T20", "I"
lint.unfixable = []

# Exclude a variety of commonly ignored directories.
exclude = [
Expand All @@ -178,12 +178,13 @@ exclude = [
"dist",
"node_modules",
"venv",
"docs",
]

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

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
# F841 unused-variable: ignore since this file uses numexpr and many variables look unused
"floris/core/wake_deflection/jimenez.py" = ["F841"]
"floris/core/wake_turbulence/crespo_hernandez.py" = ["F841"]
Expand All @@ -198,7 +199,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# import dependencies
"floris/core/__init__.py" = ["I001"]

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["floris"]
order-by-type = false
Expand Down

0 comments on commit a3a5b6e

Please sign in to comment.