Skip to content

Conversation

@ahyangyi
Copy link
Contributor

@ahyangyi ahyangyi commented Sep 1, 2025

black supports storing configuration in pyproject.toml. This pull request moves the existing command-line options to the file.

I think this change has a few advantages:

  • The current command-line options are duplicated in two places (Makefile and Github Actions), the pyproject.toml is a unified place.
  • By putting the configuration in pyproject.toml, running black . anywhere within the repository would produce correct results. This guards against a lot of surprises.
    • Caveat: running black <a file name that's excluded> still formats what should not be formatted. This is a special case that's no worse than before though.

I also included setup.py in the excludes just in case people run black . instead of black nml in the repository root.

@glx22 glx22 merged commit 03705d2 into OpenTTD:master Sep 1, 2025
21 checks passed
@ahyangyi ahyangyi deleted the black-pyproject branch September 1, 2025 17:06
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

Successfully merging this pull request may close these issues.

3 participants