Skip to content

Automatic formatting.#481

Merged
jonasbardino merged 1 commit intonextfrom
addition/automatic-formatting
Mar 20, 2026
Merged

Automatic formatting.#481
jonasbardino merged 1 commit intonextfrom
addition/automatic-formatting

Conversation

@albu-diku
Copy link
Copy Markdown
Contributor

Integrate black into the Makefile replacing previous autopep8 attempt.

We are currently trying to have consistent formatting in the codebase but
here is currently no standardised way to do this. Based on some growing
consensus bring in black and switch local formatting and linting to it.

A new `make fmt` target will format files with the appropriate style. The
`make lint` target (broken/unused) invokes the same but in checking mode
and thus will report violations.

Given we are likely to adopt this in stages we define a variable in the
Makefile listing the directories we wish to enforce cleanliness for.

@jonasbardino jonasbardino added the refactor Non-functional changes to simplify or clean up label Mar 11, 2026
Copy link
Copy Markdown
Contributor

@jonasbardino jonasbardino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far.
I would really like to also have isort included as black screws with all our imports and adding it later will give another round of significant diffs.

While it's nice to see the results being sane I'm slightly uncertain if we actually want to merge with the fmt target applied in the same PR, and more so if isort is not included.
What do you think?

Just to clarify I'll gladly help adding isort to the mix unless you prefer to do that yourself.
https://github.com/ucphhpc/migrid-sync/tree/addition/automatic-formatting-plus-isort
has my simple attempt to do so.

jonasbardino added a commit that referenced this pull request Mar 11, 2026
…elation to

vindicating the style changes in PR #481.
@jonasbardino
Copy link
Copy Markdown
Contributor

The lint errors are not new as seen in
#482
so they are not show stoppers.

@albu-diku
Copy link
Copy Markdown
Contributor Author

Looks good so far. I would really like to also have isort included as black screws with all our imports and adding it later will give another round of significant diffs.

While it's nice to see the results being sane I'm slightly uncertain if we actually want to merge with the fmt target applied in the same PR, and more so if isort is not included. What do you think?

Just to clarify I'll gladly help adding isort to the mix unless you prefer to do that yourself. https://github.com/ucphhpc/migrid-sync/tree/addition/automatic-formatting-plus-isort has my simple attempt to do so.

Happy to add isort too and make it part of this - kept it to this initially only as a caution to do only what we want (although only in one portion of the tree so perhaps less an issue).

Yah, my sense is it comes down to what level of assurance we as part of this really. On the one hand, we’re using extremely robust tools for all this so there’s no particular concern on my part about how much we include. So perhaps it’s more, do we see any value in going in stages or would it be preferable to change logic files to how we want in one go.

The advantage we have with this branch is it’ll let us see the results of tweaks. Let’s try i sort and see where we land - and perhaps the import thing mentioned earlier is another candidate modulo consensus.

jonasbardino added a commit that referenced this pull request Mar 12, 2026
* Initially just triggered existing lint errors for wsgisupp in relation to vindicating
 the style changes in PR #481.

* Fix lint errors by retiring legacy PY2 imports and add missing self arg to the
`_errors` class `close` method.
Add missing a couple of docstrings while at it and adjust imports slightly.
@albu-diku albu-diku force-pushed the addition/automatic-formatting branch from 98ee6b2 to e1f0355 Compare March 14, 2026 19:08
@jonasbardino
Copy link
Copy Markdown
Contributor

Could you split this one up into just the mechanics and a follow-up with the actual reformat please?

@albu-diku albu-diku force-pushed the addition/automatic-formatting branch from e1f0355 to 4f2e5fa Compare March 20, 2026 11:55
We are currently trying to have consistent formatting in the codebase but
here is currently no standardised way to do this. Based on some growing
consensus bring in black and switch local formatting and linting to it.

A new `make fmt` target will format files with the appropriate style. The
`make lint` target (broken/unused) invokes the same but in checking mode
and thus will report violations.

Given we are likely to adopt this in stages we define a variable in the
Makefile listing the directories we wish to enforce cleanliness for.
@albu-diku albu-diku force-pushed the addition/automatic-formatting branch from 4f2e5fa to 8e6b89d Compare March 20, 2026 12:10
@albu-diku albu-diku marked this pull request as ready for review March 20, 2026 12:12
@jonasbardino jonasbardino merged commit 6e34732 into next Mar 20, 2026
23 checks passed
@jonasbardino jonasbardino deleted the addition/automatic-formatting branch March 20, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Non-functional changes to simplify or clean up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants