wemake-python-styleguide
wemake-python-styleguide copied to clipboard
The strictest and most opinionated python linter ever!
# Rule request ## Thesis Sometimes you can find a code like this: ```python for ... in ...: if ...: return False # or True return True # or False...
# Rule request ## Thesis Coupling is a very important concept in programming. Currently, we don't enforce any rules about cohesion and coupling. But, we totally need to! And while...
# Rule request ## Thesis There are several tools from which we can copy several checks to enforce better security: 1. https://github.com/landscapeio/dodgy/blob/master/dodgy/checks.py 2. https://github.com/Yelp/detect-secrets/tree/master/detect_secrets/plugins There are several simple regexes to...
# Rule request ## Thesis This code should raise: ```python x = 0 for i in items: x += 1 print(items[x]) ``` But, it is not! Why is it a...
# Rule request ## Thesis One can write: ```python x = (original, ) ``` And also: ```python x = (original,) ``` There are two options: with and without whitespace after...
# Rule request ## Thesis Python shocks me everyday. I found out (the hard way) that one can write `some .method()` and even `some . method()` Here's what `WPS` says:...
When using [pytest fixtures](https://docs.pytest.org/en/latest/fixture.html), you are supposed to just declare them as input arguments, and they will be automagically loaded. For example: ```python import pytest from myapp import meaning_of_life @pytest.fixture...
We need to find all violations that we do cover with this project and send PSs with the links to our docs from the problem's page. Website: https://docs.quantifiedcode.com/python-anti-patterns Repo: https://github.com/quantifiedcode/python-anti-patterns...
# Rule request ## Thesis One can write this code: ```python if "list" not in dictionary: dictionary["list"] = [] dictionary["list"].append("list_item") ``` But, it is an anti-pattern. Instead one should write:...
# Rule request ## Thesis ```python # bad a[1:4:] # good a[1:4] # bad a[1::] # good a[1:] # bad a[1:4:1] # good a[1:4] # bad a[1::1] # good a[1:]...