slotscheck
slotscheck copied to clipboard
Support different rules in different modules/classes
Currently it's possible to filter out modules/classes. However it'd be nice to have different sets of rules per part of the code.
For example, enforcing slots strictly within a particular module, but not elsewhere (in a non-performance critical part)
A possible implementation (in pyproject.toml
):
[tool.slotscheck]
# default settings (fallback)
strict-imports = true
require-superclass = true
[[tool.slotscheck.run]]
# more strict checks in a certian module
include-modules = 'my\.specific\.submodule.*'
require-subclass = true
[[tool.slotscheck.run]]
# turn off class inheritance check only for classes ending in `Foo`
include-classes = '.*Foo'
require-subclass = false