flake8-bugbear
flake8-bugbear copied to clipboard
A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.
Closes #254
flake8-bugbear already find duplicate exeptions in the same tuple, but across different except's this is not done **Examples**: ```python try: pass except ValueError: pass except ValueError: pass ``` ```python try:...
I have small framework, which has `Depends` function simialr to fastapi feature. In my projects I want flake8-bubear to ignore only this funcion, but not any other function with same...
I realized that when using Python built-in dataclasses, the following scenario is not detected: ```python3 from dataclasses import dataclass @dataclass class MyClass: val = [] # Mutable data structure ```...
This code: ```python class MyModel: value: int class A: model_instance = MyModel() test_suite = [1, 2, 3] def method(self): for self.model_instance.value in self.test_suite: print(self.model_instance.value) ``` results in a `B020`, but...
Correct code: ```python try: from foo import bar from spam import eggs except ImportError: from another_foo import bar from another_spam import eggs ``` Bad code: ```python try: from foo import...
`with pytest.raises(Exception):` is very similar to `assertRaises`, and all the justification of B017 applies to that too.
Hi, Python doesn't scope variables from a for loop, which I don't think I've ever intentionally used as a language feature, and has only been a source of bugs for...
Recently I "fixed" issue #171 (by which I mean, let bugbear not crash when encountering function calls in a except statement). But maybe that pattern shouldn't be allowed at all?...
This goes further than the existing lint against `except:`. The rationale is that in many codebases (celery task bodies and request handlers, in our case) it's extremely unlikely that `except...