Skip to content

style: Apply Black styling to the entire Python codebase#8800

Closed
jennifer-richards wants to merge 2 commits intoietf-tools:feat/reformat-everythingfrom
jennifer-richards:reformat-everything
Closed

style: Apply Black styling to the entire Python codebase#8800
jennifer-richards wants to merge 2 commits intoietf-tools:feat/reformat-everythingfrom
jennifer-richards:reformat-everything

Conversation

@jennifer-richards
Copy link
Copy Markdown
Member

@jennifer-richards jennifer-richards commented Apr 14, 2025

This appears to work for me with a couple notes:

  1. If we do a squash merge, we'll need to change the commit hash in .git-blame-ignore-revs.
  2. Requires per-user configuration by running git config --local blame.ignoreRevsFile .git-blame-ignore-revs. Maybe we can automate this as part of checkout/config, but I haven't found an automatic way to use this file at the git level.
  3. I had to invalidate caches in my IDE to get it to register the git config change, but this is probably tool-specific

Also, very important: we'll need to modify our actions to accommodate the change from single quotes to double quotes in ietf/__init__.py (see the comments there)

Restyled all files with

$ black ietf
$ black tzparse.py
@richsalz
Copy link
Copy Markdown
Collaborator

Is there documentation on what the default black styling is? We should add a pointer in the README to it.

If we do this, we should add a GH action that checks for black styling and either auto-fixes or blocks the PR. And consider telling people how to run black in their own workspace to avoid such PR blockage.

@richsalz
Copy link
Copy Markdown
Collaborator

At some point we should seriously think about the #7725 and #7690 PR's.

@jennifer-richards
Copy link
Copy Markdown
Member Author

At some point we should seriously think about the #7725 and #7690 PR's.

Good point - what we sort out here as far as keeping the git history/blame clean will apply to those as well.

Black's rules are linked from here

@richsalz
Copy link
Copy Markdown
Collaborator

I think you should add a reference to the style in README.md

@jennifer-richards
Copy link
Copy Markdown
Member Author

Enough changes are going to be needed both to method and managing change attribution that I'm going to close this PR to reduce noise. Thanks for the comments, @richsalz, they have been captured.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants