Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support different rules in different modules/classes #33

Open
ariebovenberg opened this issue Jan 14, 2022 · 1 comment
Open

Support different rules in different modules/classes #33

ariebovenberg opened this issue Jan 14, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@ariebovenberg
Copy link
Owner

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)

@ariebovenberg
Copy link
Owner Author

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

@ariebovenberg ariebovenberg added the enhancement New feature or request label Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant