Run pre-commit for all files and add instructions for installing pre-commit to dev environments #1757
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.
Currently, the pre-commit checks only run on Github Actions for changes to
_shared_utils. In my work migrating away from siuba and other tech debt cleanup, I've noticed a ton of files in this repo with unused imports and unsorted imports. Since the hook hasn't been running for any files outside of_shared_utilsthese have really stacked up. In addition to checking for and, when possible, auto-correcting unused and unsorted imports, pre-commit will run black for consistent code style, lint with flake8, check that files have an end-of-file newline, and encourage other standard code recommendations that will make for easier collaboration on the team.I've configured the GH Action workflow to on run pre-commit on files that have changed in the pull request. Without that, it was running against all files in the repo and produced auto-corrections for 800+ files, which would be impossible to review. 😬 This way, we're only running it on files as we're working in those files–a lot more manageable.