flake8-bugbear icon indicating copy to clipboard operation
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.

Results 86 flake8-bugbear issues
Sort by recently updated
recently updated
newest added

```python class CustomException(Exception): def __init__(self, custom: int, arguments: str) -> None: self.msg = f"Something specific happened with custom: {custom} and {arguments}" ``` Above exception class has an issue, in my...

enhancement
help wanted

Often when defining custom objects we end up testing that the `__eq__` raises a particular error for unsupported comparisons. In practice, this means we have an unused comparison that triggers...

Note Rule B909 originally was B038, but after some discussion, it was decided that we make it optional and it's B909 now (see #456). I have not updated the content...

I recently ran into the following bug and was surprised it wasn't flagged by B018: ``` def some_funcion(a, b, c, d): result = a * b +c * d return...

bug
help wanted

This project's unit tests are sort of annoying to work with as you have to manually type out line numbers in the test file. This is especially bad if we...

I had a few thoughts for some more linter checks I'd like to have. Would be happy to implement them here if you guys are interested. ### 1. `return `...

enhancement
help wanted

```python arr = ['a', 'b', 'c', 'd', 'e', 'f'] mydict = {} for i in range(0, len(arr)): def foo(): mydict[arr[i]] = 0 foo() ``` This example is obviously too simple...

bug
enhancement
help wanted

``` from abc import ABCMeta class CustomMeta(ABCMeta): def __new__(mcs, name: str, bases: tuple[type, ...], namespace: dict[str, object], /, **kwargs) -> type: cls = super().__new__(mcs, name, bases, namespace, **kwargs) return cls...

bug

In various languages, `ALL_CAPS` variable names are _conventionally_ used to denote constants. Pre-python 3.8's `final` property, there is no standard solution for denoting constants, so in some instances the developers'...

I'm seeing some false-positives from B906 where we have node visitors that are not using the stdlib `ast` library: ```python import libcst class CSTVisitor(libcst.CSTVisitor): def visit_ClassDef(self, node): pass ``` ```console...