Skip to content

Drop black for ruff format #3420

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

Merged
merged 8 commits into from
Oct 24, 2023
Merged

Drop black for ruff format #3420

merged 8 commits into from
Oct 24, 2023

Conversation

janosh
Copy link
Member

@janosh janosh commented Oct 24, 2023

ruff format was just released as part of v0.1.2. It's in preview but considered production-ready. About 30x faster than black and 99% compatible (counted by lines of code with conflicting format in empirical testing). Appears to be much more than 99% compatible in pymatgen.

@janosh janosh added linting Linting and quality assurance housekeeping Moving around or cleaning up old code/files ci Continuous integration labels Oct 24, 2023
@janosh janosh enabled auto-merge (squash) October 24, 2023 19:52
@janosh janosh merged commit 3ec73a7 into master Oct 24, 2023
@janosh janosh deleted the drop-black-for-ruff-format branch October 24, 2023 20:35
@shyuep
Copy link
Member

shyuep commented Oct 24, 2023

Black literally takes milliseconds for pymatgen. I think making this change took possibly 1000000 iterations of black time.

@janosh
Copy link
Member Author

janosh commented Oct 24, 2023

You know most of these are auto-changes? Just ran time black pymatgen --check. Takes 2 sec on my machine and several times that to install in CI.

@janosh
Copy link
Member Author

janosh commented Oct 25, 2023

ruff has ~10x the development speed of black, is committed to supporting mojo (which imo is the most promising avenue for making pymatgen more performant in the future). black will likely never support mojo since it's written in Python and so relies on Python to parse Python. Dropping it means one less tool for contributors to install and know about. I also noticed ruff-format is faster and appears to be less buggy than black in auto-format on save in VS Code.

@shyuep
Copy link
Member

shyuep commented Oct 25, 2023

I don't have a problem with this change being made. So go ahead. I am merely pointing out that there are bigger things to deal with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration housekeeping Moving around or cleaning up old code/files linting Linting and quality assurance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants