Skip to content
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

comments and --trailing-comma can generate invalid code #1302

Closed
benjaminp opened this issue Jul 8, 2020 · 1 comment
Closed

comments and --trailing-comma can generate invalid code #1302

benjaminp opened this issue Jul 8, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@benjaminp
Copy link

$ isort --version

                 _                 _
                (_) ___  ___  _ __| |_
                | |/ _/ / _ \/ '__  _/
                | |\__ \/\_\/| |  | |_
                |_|\___/\___/\_/   \_/

      isort your imports, so you don't have to.

                    VERSION 5.0.5
$  cat > example.py 
from somewhere import very_very_very_very_very_very_long_symbol # some comment
$ isort -l 50 --tc example.py
$ python3 example.py
  File "example.py", line 2
    very_very_very_very_very_very_long_symbol,  # some comment
    ^
SyntaxError: trailing comma not allowed without surrounding parentheses
$ cat example.py
from somewhere import \
    very_very_very_very_very_very_long_symbol,  # some comment
@timothycrosley timothycrosley added the bug Something isn't working label Jul 9, 2020
@timothycrosley
Copy link
Member

Thanks for reporting! This is fixed with an additional regression test added in 5.0.6.

Thanks!

~Timothy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants