Closed javulticat closed 1 year ago
@gaborschulz introduced pre-commit in the pull request below. It has a conflict and hasn't been merged in yet.
This looks good, I'm ok with getting this in, and the requesting conflict resolution when this is in.
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.