-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Z317 incorrect multi-line parameters in nested data types #454
Comments
Needs investigation. |
@nndii yes, that a bug indeed. And a very complex one. Oh man, I hate this rule. |
The problem is with print(( # should start from here
1, 2, 3, # actually starts from here
)) and print([
('Allow', 'group:editors', ('edit', 'create')), # tuple starts from here
])
|
Maybe we can treat it as a single line? And just force all elements of these tuples to be on line with Like
|
@nndii ok, here's what's wrong. Later, I will rewrite this check from Any help is highly appreciated. If you can handle this task - it would be the most significant contribution to the project ever. |
@sobolevn |
@kxepal here's what's wrong:
Why is it hard?
|
Another false positive example:
|
@ffedoroff this is not false positive. Correct one should be: class Meta(object):
model = User
fields = (
'id',
'username',
'first_name',
'last_name',
...
) |
Related: jsfehler/flake8-multiline-containers#9 (comment) I guess, that we can switch to |
Bug report
What's wrong
Z317 enforces me to split nested tuples in multiple lines.
Code sample that causes that issue
How is that should be
There is "special case" in docs but its not actually clear whether I should follow it strictly or nested data types in one line is also allowed.
flake8 information
The text was updated successfully, but these errors were encountered: