https://github.com/wemake-services/wemake-python-styleguide/issues/3397
#ast #wemake_python_styleguide
#ast #wemake_python_styleguide
GitHub
WPS432 should ignore literal types · Issue #3397 · wemake-services/wemake-python-styleguide
Rule request (I am not sure whether this is a bug or a rule request, sorry if I picked the wrong one.) Thesis WPS432 currently is applied to magic numbers within literal types. foobar: Literal[9001...
https://github.com/wemake-services/wemake-python-styleguide/issues/3404
#ast #wemake_python_styleguide
#ast #wemake_python_styleguide
GitHub
Forbid comments in `f` and `t` string · Issue #3404 · wemake-services/wemake-python-styleguide
This code should raise a violation: >>> x = f'{ 1 # comment ... }' Because comments make f string implicilty multiline. And comments must not be present in strings. This is not right.
👍1
https://github.com/wemake-services/wemake-python-styleguide/issues/3413
#wemake_python_styleguide #ast
#wemake_python_styleguide #ast
GitHub
WPS212 counts return-statements from inner definitions · Issue #3413 · wemake-services/wemake-python-styleguide
What's wrong def foobar() -> Any: def inner_func(x: Any) -> Any: return x class Foobar: def __init__(self: Self): self.x = 1 def get_x(self: Self) -> int: return self.x return inner_fu...
https://github.com/wemake-services/wemake-python-styleguide/issues/3458
#python #wemake_python_styleguide #ast
#python #wemake_python_styleguide #ast
GitHub
Forbid "fat" finally · Issue #3458 · wemake-services/wemake-python-styleguide
Rule request Allow finally block to have simple content only. It can contain few lines of code, but it shouldn't contain untrivial logic, which can not be understand very quickly at code readin...
😭5❤2
https://github.com/wemake-services/wemake-python-styleguide/issues/2340
#wemake_python_styleguide #ast
#wemake_python_styleguide #ast
GitHub
Detect leaking `for` loops in `ClassDef` and `Module` · Issue #2340 · wemake-services/wemake-python-styleguide
Right now we can have two problems: class Some(object): for x in [1, 2]: print(x) print(Some.x) # oups, will show you `2` and with modules: # some.py for x in [1, 2]: print(x) # __main__ import som...
👍3❤1
https://github.com/wemake-services/wemake-python-styleguide/issues/3493
#ast #wemake_python_styleguide
#ast #wemake_python_styleguide
GitHub
Make `WPS222` configurable · Issue #3493 · wemake-services/wemake-python-styleguide
Currently we use MAX_CONDITIONS: Final = 4 as a constant in constants.py. There's no way to configure MAX_CONDITIONS. However, there might be projects where 5 or even 8 might be reasonable. So,...
👎1
https://github.com/wemake-services/wemake-python-styleguide/issues/3500
#ast #wemake_python_styleguide
#ast #wemake_python_styleguide
GitHub
Allow set comprehensions in `WPS335` · Issue #3500 · wemake-services/wemake-python-styleguide
We don't allow list and set to be used as iterable parts of for, because we only allow tuples there. We need to allow SetComp in for iterable: 118:22 WPS335 Found incorrect `for` loop iter type...
Не самая простая задача, но прикольная: https://github.com/wemake-services/wemake-python-styleguide/issues/3501
Подойдет тем, кто уже делает не первый PR :)
#ast #wemake_python_styleguide
Подойдет тем, кто уже делает не первый PR :)
#ast #wemake_python_styleguide
GitHub
False positive for `WPS529` · Issue #3501 · wemake-services/wemake-python-styleguide
Code like this def func(**kwargs): if 'a' in kwargs: assert 'a_kwargs' not in kwargs else: kwargs['a'] = other( **kwargs.pop('a_kwargs', {}), ) raises WPS529 I don&#...
https://github.com/wemake-services/wemake-python-styleguide/issues/3506
Поправить описание того, что мы считаем "сложным" кодом внутри
#wemake_python_styleguide #docs
Поправить описание того, что мы считаем "сложным" кодом внутри
f
строк#wemake_python_styleguide #docs
GitHub
False positive for `WPS237` · Issue #3506 · wemake-services/wemake-python-styleguide
What's wrong I encountered this error in one of my functions for a game on Pygame, and after reviewing the WPS documentation, I believe it is a false positive. Please review the function yourse...