flake8-simplify icon indicating copy to clipboard operation
flake8-simplify copied to clipboard

❄ A flake8 plugin that helps you to simplify code

Results 53 flake8-simplify issues
Sort by recently updated
recently updated
newest added

## Desired change * **Rule(s)**: SIM108 * **Adjustment**: in the following case the issue was not recognised ## Explanation this was correctly recognized by `ruff` nut missing here so in...

enhancement

## Desired change * **Rule(s)**: SIM115 * **Adjustment**: should not be triggered when not referencing the return ## Explanation Why is the adjustment necessary / better? When not referencing the...

enhancement

## Explanation The methods `Path.mkdir` and `os.makedirs` will fail if the target directory already exists. One approach is use a try-except block to handle that issue gracefully. While this is...

enhancement

The `SIM208` rule should be updated to only emit errors for `not not x` in boolean contexts, since changing it to just `x` can cause different results under certain circumstances....

enhancement

## Desired change * **Rule(s)**: SIM901 * **Adjustment**: the below code snippet is a false positive SIM901 ## Explanation ```python from typing import Literal, TypeAlias Sign: TypeAlias = Literal[-1, 0,...

enhancement

## Version: `flake8-simplify==0.19.3` ## Desired change * **Rule(s)**: SIM401 * **Adjustment**: SIM401 should not apply to non-constant default values. ## Explanation When the default value in `SIM401` statement isn't constant,...

enhancement

## Explanation Functions that are not part of the public API which have default values for arguments, but which are never used without specifying values for those arguments, can be...

enhancement

## Explanation Looking at one's own old, bad code can be a source of great cringe. - I remember prepending `if incidents is not None` because if incidents _is_ None,...

enhancement

## Explanation raw strings are more readable and maintainable for humans in many cases. Prior art: * [flake8-strings](https://pypi.org/project/flake8-strings/) (MIT license) * [flake8-quotes](https://github.com/zheller/flake8-quotes) (MIT license) ## Example ```python # Bad path...

enhancement

## Desired change * **Rule(s)**: SIM908 * **Adjustment**: should work reliable across different python versions ## Explanation For python3.7 the rule doesn't work when f-strings are somehow used in functions....

enhancement