Configures 'pre-commit' hooks for Zappa's development tools #1284
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.
Adds
pre-commit
hooks for all of the major linting/formatting tools currently used in Zappa development.Two choices I intentionally made to keep the scope of this PR small, low-risk, and easy to review:
pre-commit
hooks to remain as close as possible to the currently defined behavior of the tools in ourMAKEFILE
, even though, in many cases, that behavior is sub-optimal, or even, in some cases, entirely useless (for example, ourMAKEFILE
hasflake8
currently running with the--exit-zero
arg always enabled, meaning that our CI always thinks it succeeds, despite the fact thatflake8
does, in fact, not actually ever succeed when currently run on our repo and in fact, ends up finding a number of errors that thisMAKEFILE
configuration has hidden for... likely years at this point). I plan on properly configuring our dev tools to actually provide the value they are meant to in follow up PRs..py
files are adding comments that instructmypy
to ignore certain lines that don't currently passmypy
's checks. Again, modernizing the codebase to better conform to all of the best practices imposed by tools likeflake8
andmypy
can wind up being massive undertakings on big, old, largely untyped codebases like ours that have seemingly never prioritized best practices too highly... So, I wanted to leave any code changes for the sake of pleasing our linting tools (and, thereby hopefully making our code much more readable and easy to follow) to be done via separate PR(s) as well so this one could be safely merged and begin making our contributors' lives easier sooner rather than later.For more, see Issue #1282, which will be resolved by this PR.