Skip to content

Adding precommit with black and pyupgr#119

Merged
tonybaloney merged 1 commit into
microsoft:mainfrom
pamelafox:precommit
Oct 16, 2022
Merged

Adding precommit with black and pyupgr#119
tonybaloney merged 1 commit into
microsoft:mainfrom
pamelafox:precommit

Conversation

@pamelafox

Copy link
Copy Markdown
Member

As suggested in #109, this PR adds pre-commit hooks using the pre-commit package. To start off with, it has the yaml-fixer hook, the black hook, and the pyupgrade hook. I think it's nice to run pyupgrade on tests too, so I didn't exclude the tests from it, but I can exclude them if you feel otherwise.

I'll send a follow-up PR adding isort since that'll change a bunch of files.

@pamelafox
pamelafox requested a review from tonybaloney October 13, 2022 16:22
Comment thread .pre-commit-config.yaml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed two hooks that are fairly standard, end-of-file-fixer and trailing-whitespace, since they touched so many files, and I don't feel strongly about them. But I can add those in a follow-up PR if you like those checks.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #119 (f2d67a6) into main (2d06a87) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #119   +/-   ##
=======================================
  Coverage   88.94%   88.94%           
=======================================
  Files          11       11           
  Lines        2098     2098           
=======================================
  Hits         1866     1866           
  Misses        232      232           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

if data:
try:
super(DelegatingUDPRequestHandler, self).finish()
super().finish()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)

@tonybaloney
tonybaloney merged commit 6da2c18 into microsoft:main Oct 16, 2022
@tonybaloney tonybaloney mentioned this pull request Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants