wemake-python-styleguide icon indicating copy to clipboard operation
wemake-python-styleguide copied to clipboard

Forbid to use `some .method()`

Open sobolevn opened this issue 5 years ago • 2 comments

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:

» flake8 ex.py

ex.py

  1:1      C101  Coding magic comment not found
  some .set(1, 2)
  ^

  1:1      F821  undefined name 'some'
  some .set(1, 2)
  ^

This is insane!

Original issue: https://github.com/django/django/pull/12426

This might be a consistency rule. I guess that we should use tokenize or libcst for this.

sobolevn avatar Feb 06 '20 12:02 sobolevn

I'll add this rule

PrVrSs avatar Feb 08 '20 10:02 PrVrSs

Awesome! Thanks a lot.

sobolevn avatar Feb 08 '20 11:02 sobolevn