Black code formatting #33
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request formats all of the code using the Black code formatter, as well as automatically removing unused imports.
The one functional change I made manually was that in
unittest/unit_test.py, intest_selector_expr, there was an invalid lambda function that was stopping automatic formatting from working. Other than that, all changes in this pull request are automatic or adding configuration files that drive automatic changes.Main details about Black from its README:
The main reason to use it is that it makes everything formatted in a clean way, makes diffs smaller and more readable, and eliminates arguments about code styling.
I've set automatic formatting to work via git pre-commit hooks by using the pre-commit project, which makes using them trivial via
.pre-commit-config.yaml, which even has free continuous integration support via pre-commit.ci which can do things like automatically formatting new pull requests.I am planning on making more pull requests based off of the changes in this one, but I think consistent formatting is a must for any project in my opinion.