Skip to content

Commit

Permalink
Even more rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Willemsen committed Nov 30, 2024
1 parent e30b3a7 commit 5abe9dc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
20 changes: 12 additions & 8 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ indent-width = 4
preview = true
extend-select = [
"N", # pep8-naming
"D", # pydocstyle (can use this later but for now causes too many errors)
"D", # pydocstyle
"I", # isort (for imports)
"E501", # Line too long ({width} > {limit})
"E",
"F",
"W",
"ANN",
"E", # Pycodestyle errors
"W", # Pycodestyle warnings
"F", # Pyflakes
"PL", # Pylint
"B", # Flake8-bugbear
"PIE", # Flake8-pie
"ANN", # Annotations
"ASYNC", # Asyncio-specific checks
"B",
"NPY", # Numpy-specific rules
"RUF", # Ruff-specific checks, include some useful asyncio rules
"FURB", # Rules from refurb
Expand All @@ -22,7 +24,8 @@ extend-select = [
"LOG", # Logging-specific rules
"G", # Logging-specific rules
"UP", # Pyupgrade
"PL", # Rules from pylint
"SLF", # Private-member usage
"PERF", # Performance-related rules
]
ignore = [
"D406", # Section name should end with a newline ("{name}")
Expand All @@ -34,13 +37,14 @@ ignore = [
]
[lint.per-file-ignores]
"tests/*" = [
"N802",
"N802", # Allow test names to be long / not pep8
"D", # Don't require method documentation for test methods
"ANN", # Don't require tests to use type annotations
"PLR2004", # Allow magic numbers in tests
"PLR0915", # Allow complex tests
"PLR0914", # Allow complex tests
"PLC2701", # Allow tests to import "private" things
"SLF001", # Allow tests to use "private" things
]
"doc/conf.py" = [
"D100"
Expand Down
2 changes: 0 additions & 2 deletions src/ibex_bluesky_core/callbacks/fitting/fitting_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def model(cls, *args: int) -> lmfit.Model:
(x-values: NDArray, parameters: np.float64 -> y-values: NDArray)
"""
pass

@classmethod
@abstractmethod
Expand All @@ -47,7 +46,6 @@ def guess(
(x-values: NDArray, y-values: NDArray -> parameters: Dict[str, lmfit.Parameter])
"""
pass

@classmethod
def fit(cls, *args: int) -> FitMethod:
Expand Down
2 changes: 1 addition & 1 deletion tests/callbacks/test_document_logging_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def basic_plan() -> Generator[Msg, None, None]:
result: RunEngineResult = RE(basic_plan())
filepath = log_location / f"{result.run_start_uids[0]}.log"

for i in range(0, 2):
for i in range(2):
assert m.call_args_list[i].args == (filepath, "a")
# Checks that the file is opened 2 times, for open and then stop

Expand Down

0 comments on commit 5abe9dc

Please sign in to comment.