wemake-services / flake8-broken-line

🚨 Flake8 plugin to forbid backslashes (\) for line breaks
https://pypi.org/project/flake8-broken-line/
MIT License
112 stars 77 forks source link

How to chain methods without arguments? #147

Open b0g3r opened 4 years ago

b0g3r commented 4 years ago

Thank you for your great strict linting job! I have an IRL question, and maybe it's a good idea to add more examples to README.

For example I have long chain of methods without arguments:

some_object \
  .call_method() \
  .call_other() \
  .finalize()

So it should be:

some_objects.call_method(

).call_other(

).finalize()

or

some_objects.call_method(
).call_other(
).finalize()

?

sobolevn commented 4 years ago

I would say that this is the solution:

(
   some_object
      .call_method()
      .call_other()
      .finalize()
)

But, I don't like it. Any other ideas?