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

Reformat code using the latest stable version of black #1635

Merged

Conversation

Nick-Hall
Copy link
Member

Version 24.1.0 was released earlier today.

Version 24.1.0 was released earlier today.
@Nick-Hall Nick-Hall merged commit af47b1f into gramps-project:maintenance/gramps52 Jan 26, 2024
2 checks passed
@jralls
Copy link
Member

jralls commented Jan 26, 2024

The "code quality" claim is dubious at best considering the moving around of gratuitous parentheses in long chains of foo = bar = … = quux = None.

@Nick-Hall
Copy link
Member Author

Yes. The main reason for the PR (and the quick merge) was to fix the failing lint check.

An alternative would be to force the action to use an older version of black as described here in the documentation.

It seems that they do a major upgrade like this once a year that may change some formatting. How should we handle this now and in the future?

@jralls
Copy link
Member

jralls commented Jan 26, 2024

An alternative would be to force the action to use an older version of black as described here in the documentation.

That's illusory: It says the version has to be on PyPi and the PyPi has only the latest version.

How should we handle this now and in the future?

Split up the lines so that Black doesn't want to add parentheses to make a line continuation. e.g:

self.begin_progress = self.end_progress = yes
self.step_progress = self._default_callback = yes

is clearer than either

    self.begin_progress = (
           self.end_progress
      ) = self.step_progress = self._default_callback = yes

or

self.begin_progress = self.end_progress = self.step_progress = (
       self._default_callback
) = yes

and will be immune to getting reformatted every time the Black team's whim changes about where the line should break.

@Nick-Hall Nick-Hall deleted the black-reformat branch January 26, 2024 20:34
@QuLogic
Copy link
Contributor

QuLogic commented Jan 27, 2024

That's illusory: It says the version has to be on PyPi and the PyPi has only the latest version.

I don't love black either, but there are plenty of older releases on PyPI.

@kulath
Copy link
Member

kulath commented Jan 27, 2024 via email

@jralls
Copy link
Member

jralls commented Jan 27, 2024

I don't love black either, but there are plenty of older releases on PyPI.

Ah, I stand corrected. I expected history to be a simple list, not installable links.

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

Successfully merging this pull request may close these issues.

4 participants