Skip to content

Commit 5c3f0bd

Browse files
authored
Remove decorators named validator and root_validator from B902 checks (#459)
1 parent 64fcdfd commit 5c3f0bd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

DEVELOPMENT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ python3 -m venv /path/to/venv
3939

4040
```console
4141
cd flake8-bugbear
42-
/path/to/venv/bin/pip install -e .[dev]
42+
/path/to/venv/bin/pip install -e '.[dev]'
4343
```
4444

4545
## Running Tests

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ This could be useful, when using other libraries that provide more immutable cal
315315
beside those already handled by ``flake8-bugbear``. Calls to these method will no longer
316316
raise a ``B008`` warning.
317317

318-
``classmethod-decorators``: Specify a list of decorators to additionally mark a method as a ``classmethod`` as used by B902. Default values are ``classmethod, validator, root_validator``, and when an ``@obj.name`` decorator is specified it will match against either ``name`` or ``obj.name``.
318+
``classmethod-decorators``: Specify a list of decorators to additionally mark a method as a ``classmethod`` as used by B902. The default only checks for ``classmethod``. When an ``@obj.name`` decorator is specified it will match against either ``name`` or ``obj.name``.
319319
This functions similarly to how `pep8-naming <https://github.com/PyCQA/pep8-naming>` handles it, but with different defaults, and they don't support specifying attributes such that a decorator will never match against a specified value ``obj.name`` even if decorated with ``@obj.name``.
320320

321321
For example::

bugbear.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"assertWarnsRegex",
4242
}
4343

44-
B902_default_decorators = {"classmethod", "validator", "root_validator"}
44+
B902_default_decorators = {"classmethod"}
4545

4646
Context = namedtuple("Context", ["node", "stack"])
4747

0 commit comments

Comments
 (0)