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

Move to using black auto-formatting to enforce PEP8. #2904

Closed
3 of 4 tasks
MicahGale opened this issue Mar 10, 2024 · 2 comments
Closed
3 of 4 tasks

Move to using black auto-formatting to enforce PEP8. #2904

MicahGale opened this issue Mar 10, 2024 · 2 comments

Comments

@MicahGale
Copy link
Contributor

MicahGale commented Mar 10, 2024

Description

In the OpenMC style guide automated formatting of C++ code is required, and PEP8 compliance is required for python, however no autoformatting is used for python AFAIK. Black is a PEP8 formatting tool for python.

Suggestion for using black:

  1. Add black as an optional dependency
  2. Update style guide to require using black
  3. Reformat all python using black. This would be a large commit
  4. Implement a GHA test that checks if any python files need reformatting.

Alternatives

Do nothing, and continue relying on reviewers determining if code is PEP8.

Compatibility

No API changes would be needed. This would add an additional test, and would reformat the whole code base.

@shimwell
Copy link
Member

Super keen to see this

Some similar discussions in this related issue #2002

By the way I think Ruff is perhaps also good option to consider

@MicahGale
Copy link
Contributor Author

Oh I didn't see that issue. I'll close this one.

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

No branches or pull requests

2 participants