Replies: 1 comment
-
No, I'm sorry. There's currently no way of disabling rules on a per-function level. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
tldr: How can we require docstrings on all functions, except those with names prefixed with
test_
?Usually we write test functions with names that describe the purpose of the test: e.g.
test_fries_eggs()
andtest_adds_ketchup()
. We don't write docstrings on these test functions because the name of the test should be descriptive enough to tell us what the test is doing, so they would be redundant.We do however want docstrings on all other functions.
At the moment we use the
tool.ruff.lint.per-file-ignores
config option to disable the docstring-related lints on files namedtest_*.py
, but this unfortunately means that any other function within the test files is not required to have docstrings, which is not what we want.Is there a way of telling ruff to ignore lints on functions with names matching a specific pattern?
Beta Was this translation helpful? Give feedback.
All reactions