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

--hang-closing does not work for non-indented lines #612

Closed
ortk95 opened this issue Oct 6, 2021 · 2 comments · Fixed by #618
Closed

--hang-closing does not work for non-indented lines #612

ortk95 opened this issue Oct 6, 2021 · 2 comments · Fixed by #618
Assignees
Labels
Milestone

Comments

@ortk95
Copy link

ortk95 commented Oct 6, 2021

When --hang-closing is used, closing brackets for variables on non-indented lines are not corrected.


Python Code

Input

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
x = [
    None
]  # Not corrected by autopep8

if True:
    y = [
        None
    ]  # Corrected by autopep8

Output

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
x = [
    None
]  # Not corrected by autopep8

if True:
    y = [
        None
        ]  # Corrected by autopep8

Command Line and Configuration

Command Line

$ autopep8 --hang-closing test.py

Your Environment

  • Python version: Python 3.9.1
  • autopep8 version: autopep8 1.5.7 (pycodestyle: 2.7.0)
  • Platform: macOS 11.6
@hhatto hhatto added the bug label Oct 21, 2021
@hhatto hhatto self-assigned this Oct 21, 2021
@hhatto hhatto added this to the 1.6 milestone Oct 21, 2021
@hhatto
Copy link
Owner

hhatto commented Oct 21, 2021

@ortk95
Thanks for reporing.
fix this on latest master branch. 68ad200

We will be releasing version 1.6 within the next few days.

@ortk95
Copy link
Author

ortk95 commented Oct 21, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants