Home

Awesome

PyPI version Code on Github Actions Status Code style: black

flake8-scream

A flake8 plugin that helps you scream your code.

Rules

Disabling Rules

You might have good reasons to ignore some flake8 rules. To do that, use the standard Flake8 configuration. For example, within the setup.cfg file:

[flake8]
ignore = SCR106, SCR113, SCR119, SCR9

Examples

SCR119

Dataclasses were introduced with PEP 557 in Python 3.7. The main reason not to use dataclasses is to support legacy Python versions.

Dataclasses create a lot of the boilerplate code for you:

A lot of projects use them:

SCR902

# Bad
foo(False)
bar(True)

# Good
foo(verbose=False)
bar(enable_magic=True)

The false-positives that are currentl not possible to fix are in positional-only arguments. There is no way to determine in the AST given by Flake8 if a function has positional-only arguments.

SCR903

# Bad
foo(42, 1.234)

# Good
foo(the_answer=42, flux_compensation=1.234)

The false-positives that are currentl not possible to fix are in positional-only arguments. There is no way to determine in the AST given by Flake8 if a function has positional-only arguments.