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

Autoformatting with black? #752

Closed
consideRatio opened this issue Oct 28, 2021 · 2 comments
Closed

Autoformatting with black? #752

consideRatio opened this issue Oct 28, 2021 · 2 comments

Comments

@consideRatio
Copy link
Member

Would a black autoformatting PR be acceptable? I've done it in a few repos at this point, some parts typically gets a bit uglier, a few gets better, but the key feature is a very consistent formatting. There are not many, but a few tricks to influence formatting to look better when black sometimes makes it look worse.

  • Influence formatting
    • For example, you can force a function call with arguments to format the arguments over multiple lines by adding a trailing comma, or make it shrink to a single line by removing the trailing comma if it can fit in a single line.
  • Adjust to formatting
    If you before had a list of args to call some CLI in an array, and some elements of the list were associated like ["--version", "1.2.3"], then you can avoid having them break into two lines in a larger list by adjusting to a single string flag like this: ["--version=1.2.3"].

To conclude, I'd appreciate going for black autoformatting in this repo, as all repo's I work really. I appreciate the forced consistency no matter who makes a PR, and the reduced amounts of changes in PRs after its been applied systematically.

Would it be okay if I applied black autoformatting to this repo, and then also did my best to make it look good?

@manics
Copy link
Member

manics commented Oct 28, 2021

Based on
jupyterhub/team-compass#454 (comment)
black should be fine.

@raybellwaves
Copy link
Contributor

Closed via #755 ?

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

No branches or pull requests

3 participants