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)**: SIM113 * **Adjustment**: The rule must be ignored if the counter variable is modified inside the loop and does not just count the loops ##...

enhancement

## Desired change * **Rule(s)**: SIM110 * **Adjustment**: A false positive ## Example ```python def _check_libalternatives_presence(pkg, alts_requirement): for path in pkg.files: if path.startswith('/usr/share/libalternatives/'): return True return any(req[0] == alts_requirement for...

enhancement

## Desired change * **Rule(s)**: SIM222 * **Adjustment**: The rule `Use 'True' instead of '... or True'` is wrong ## Example `'foo' or True` gives `'foo'` but not `True`, `1...

enhancement

## Desired change * **Rule(s)**: SIM300 (However it likely affects more rules) * **Adjustment**: Use repr when printing the strings ## Explanation With an if statement like this: ```py if...

enhancement

## Desired change * **Rule**: SIM105 * **Adjustment**: `suppress` should not be used inside `try`/`finally` statement ## Explanation The code is not simplified because the `try` statement is still necessary...

enhancement

## Explanation Using `Path`s requires much less code, particularly if `Path`s are already being used to represent paths. The necessary methods were added in Python 3.5, so shouldn’t be a...

enhancement

## Desired change * **Rule(s)**: SIM986, SIM987 * **Adjustment**: In which way should it/they be adjusted? ## Explanation * Invalid transformation for t ## Example This is an example where...

enhancement

## Explanation Find consecutive slices which can be replaced by just one slice. ## Example ```python foo = [1,2,3,4] # Bad foo[1:][:2] foo[1:][2:] # Good foo[1:3] foo[3:] ```

enhancement

## Desired change * **Rule(s)**: SIM113 * **Adjustment**: Do not trigger SIM113 if the counter is used outside the loop. ## Explanation A `for` loop only assigns the value variables...

enhancement

Hi, first of all, thanks for the great tool. I have several apps with a lot of yoda-conditions and I wanted to see if there is a way to make...