Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ doc = [
]
lint = [
"pyright==1.1.411",
"ruff==0.15.21",
"ruff==0.15.22",
]
test = [
"lewis",
Expand Down
32 changes: 16 additions & 16 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extend-select = [
"N", # pep8-naming
"D", # pydocstyle
"I", # isort (for imports)
"E501", # Line too long ({width} > {limit})
"line-too-long", # Line too long ({width} > {limit})
"E", # Pycodestyle errors
"W", # Pycodestyle warnings
"F", # Pyflakes
Expand All @@ -28,28 +28,28 @@ extend-select = [
"PERF", # Performance-related rules
]
ignore = [
"D406", # Section name should end with a newline ("{name}")
"D407", # Missing dashed underline after section ("{name}")
"D213", # Incompatible with D212
"D203", # Incompatible with D211
"PLR6301", # Too noisy
"BLE001", # Need to prevent arbitrary exceptions from terminating FastCS update loops
"PLW0717", # Need broad try-excepts to stop program from terminating
"missing-new-line-after-section-name", # Section name should end with a newline ("{name}")
"missing-dashed-underline-after-section", # Missing dashed underline after section ("{name}")
"multi-line-summary-second-line", # Incompatible with D212
"incorrect-blank-line-before-class", # Incompatible with D211
"no-self-use", # Too noisy
"blind-except", # Need to prevent arbitrary exceptions from terminating FastCS update loops
"too-many-statements-in-try-clause", # Need broad try-excepts to stop program from terminating
]
[lint.per-file-ignores]
"tests/*" = [
"N802", # Allow test names to be long / not pep8
"invalid-function-name", # 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
"RUF067", # Standard pattern for LEWiS emulators
"magic-value-comparison", # Allow magic numbers in tests
"too-many-statements", # Allow complex tests
"too-many-locals", # Allow complex tests
"import-private-name", # Allow tests to import "private" things
"private-member-access", # Allow tests to use "private" things
"non-empty-init-module", # Standard pattern for LEWiS emulators
]
"doc/conf.py" = [
"D100"
"undocumented-public-module"
]

[lint.pylint]
Expand Down
8 changes: 4 additions & 4 deletions src/fastcs_secop/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
logger = getLogger(__name__)


T: TypeAlias = int | float | str | bool | Enum | npt.NDArray[Any] # noqa: UP040 (sphinx doesn't like it)
T: TypeAlias = int | float | str | bool | Enum | npt.NDArray[Any] # ruff:ignore[non-pep695-type-alias] (sphinx doesn't like it)
"""Generic type parameter for SECoP IO."""


Expand Down Expand Up @@ -96,7 +96,7 @@ class SecopRawAttributeIORef(AttributeIORef):
accessible_name: str = ""


def decode(raw_value: str, datainfo: dict[str, Any], attr: AttrR[T]) -> T: # noqa ANN401
def decode(raw_value: str, datainfo: dict[str, Any], attr: AttrR[T]) -> T: # ruff:ignore[undocumented-param] ANN401
"""Decode the transported value into a python datatype.

Args:
Expand Down Expand Up @@ -207,7 +207,7 @@ async def send(self, attr: AttrW[T, SecopAttributeIORef], value: T) -> None:
)
# Ugly, but I can't find a public alternative...
# https://github.com/DiamondLightSource/FastCS/pull/292
await attr._call_sync_setpoint_callbacks(value) # noqa: SLF001
await attr._call_sync_setpoint_callbacks(value) # ruff:ignore[private-member-access]
except ConnectionError:
# Reconnect will be attempted in a periodic scan task
pass
Expand Down Expand Up @@ -252,7 +252,7 @@ async def send(self, attr: AttrW[str, SecopRawAttributeIORef], value: str) -> No
)
# Ugly, but I can't find a public alternative...
# https://github.com/DiamondLightSource/FastCS/pull/292
await attr._call_sync_setpoint_callbacks(value) # noqa: SLF001
await attr._call_sync_setpoint_callbacks(value) # ruff:ignore[private-member-access]
except ConnectionError:
# Reconnect will be attempted in a periodic scan task
pass
Expand Down
Loading