cloudtools / troposphere

troposphere - Python library to create AWS CloudFormation descriptions
BSD 2-Clause "Simplified" License
4.93k stars 1.45k forks source link

pre-commit checks for black+isort #1989

Closed sirrus233 closed 2 years ago

sirrus233 commented 2 years ago

Got bitten by this on my last PR - so figured I'd give it a little automation for the next person to come along (especially if that should happen to be me!)

Pretty simple to start, but can be expanded with additional checks down the line if desired.

sirrus233 commented 2 years ago

FWIW - pre-commit only runs against files that are changed in the commit. Since there's no source code in this PR, nothing was actually checked when I committed it. Out of curiosity, however, I ran it against the whole repo with pre-commit run -a. Looks like there are currently a handful of black violations checked in:

    modified:   docs/conf.py
    modified:   scripts/cfn
    modified:   scripts/cfn2py
    modified:   troposphere/kinesis.py

I figured the change would be easier to review if I left these alone, but if it's helpful I can add a commit with the (automated) fixes to these files.

markpeek commented 2 years ago

Nice! Thanks! Also, I've been meaning to update the github action to catch these as well.