Remove decorators named validator and root_validator from B902 checks#459
Merged
cooperlees merged 1 commit intoPyCQA:mainfrom Feb 7, 2024
Merged
Remove decorators named validator and root_validator from B902 checks#459cooperlees merged 1 commit intoPyCQA:mainfrom
cooperlees merged 1 commit intoPyCQA:mainfrom
Conversation
jakkdl
approved these changes
Feb 5, 2024
Contributor
jakkdl
left a comment
There was a problem hiding this comment.
In hindsight I should've added methods to tests/b902.py with @validator and @root_validator to check that the defaults were properly parsed. You could perhaps add those now and mark them as failing in tests.test_bugbear.test_b902, but /shrug.
If I could approve the test run I would. I know @Zac-HD likes championing for only requiring approval for test runs if first-time contributors are new to github, as opposed to default where all first-time project contributors require approvals.
| ```console | ||
| cd flake8-bugbear | ||
| /path/to/venv/bin/pip install -e .[dev] | ||
| /path/to/venv/bin/pip install -e '.[dev]' |
Contributor
There was a problem hiding this comment.
This is only required in some shells (zsh in particular) afaik, but doesn't hurt in other shells, so seems fine to bundle in what's otherwise an unrelated PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This removes methods named
validatorandroot_validatorfrom the B902 checkWhy
Fixes #413
Removes false positives for common cases, like using attrs validators
Testing
ran
toxand all tests are passing