Run Ruff on `doc/usage/extensions/`

This commit is contained in:
Adam Turner 2025-01-02 23:59:48 +00:00
parent 013dcdc3b8
commit ff2693242d
3 changed files with 13 additions and 5 deletions

View File

@ -6,7 +6,6 @@ extend-exclude = [
"tests/roots/*",
"build/*",
"doc/_build/*",
"doc/usage/extensions/example*.py",
]
[format]
@ -276,6 +275,13 @@ select = [
"FURB118",
"T201"
]
"doc/usage/extensions/example_{google,numpy}.py" = [
"D416", # Section name should end with a colon ("{name}")
"I002", # Missing required import: {name}
"INP001", # File {filename} is part of an implicit namespace package. Add an __init__.py.
"PLW3201", # Dunder method {name} has no special meaning in Python 3
]
"sphinx/domains/**" = ["FURB113"]
"tests/test_domains/test_domain_cpp.py" = ["FURB113"]

View File

@ -121,7 +121,8 @@ def module_level_function(param1, param2=None, *args, **kwargs):
"""
if param1 == param2:
raise ValueError('param1 may not be equal to param2')
msg = 'param1 may not be equal to param2'
raise ValueError(msg)
return True
@ -235,7 +236,7 @@ class ExampleClass:
@readwrite_property.setter
def readwrite_property(self, value):
value
_ = value
def example_method(self, param1, param2):
"""Class methods are similar to regular functions.

View File

@ -154,7 +154,8 @@ def module_level_function(param1, param2=None, *args, **kwargs):
"""
if param1 == param2:
raise ValueError('param1 may not be equal to param2')
msg = 'param1 may not be equal to param2'
raise ValueError(msg)
return True
@ -288,7 +289,7 @@ class ExampleClass:
@readwrite_property.setter
def readwrite_property(self, value):
value
_ = value
def example_method(self, param1, param2):
"""Class methods are similar to regular functions.