Skip to content

build(pre-commit): Add pre-commit to make pr #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

michaelbrewer
Copy link
Contributor

@michaelbrewer michaelbrewer commented Mar 27, 2021

Issue #, if available:

Description of changes:

pre-commit runs additional checks that make pr does not perform like trailing-whitespace

Changes:

  • Add pre-commit as a target in the Makefile

Checklist

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-io
Copy link

codecov-io commented Mar 27, 2021

Codecov Report

Merging #368 (cce89b3) into develop (7c9a319) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #368   +/-   ##
========================================
  Coverage    99.94%   99.94%           
========================================
  Files           96       96           
  Lines         3643     3643           
  Branches       175      175           
========================================
  Hits          3641     3641           
  Partials         2        2           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c9a319...cce89b3. Read the comment docs.

@michaelbrewer michaelbrewer changed the title build(pre-commit): Add pre-commit to make pr build(pre-commit): Add pre-commit to make pr Mar 27, 2021
@heitorlessa
Copy link
Contributor

Hey Michael, out of curiosity, did you run into those before?

make dev installs pre-commit hooks so they're run upon a commit.

That said, these are not run in CI and this is an improvement - is that what you intended?

Thanks ;)

@michaelbrewer
Copy link
Contributor Author

@michaelbrewer yes I do run "make dev" and the pre-commit does run, but "make lint" does not include all of the same logic as "pre-commit".

So what happens is:

$ git add .
stage my commit
$ make pr
passes 
$ git commit -m "..."
fail due to white spaces 
$ git add .
$ git commit -m "..."

@michaelbrewer
Copy link
Contributor Author

@heitorlessa maybe there is an alternative solution with the same intent :)

@heitorlessa
Copy link
Contributor

Gotcha, that's what I thought. Sadly there is no alternative, as the pre-commit project decided not to add them as it deems to be a non-safe operation. I was thinking on perhaps removing some of them, but there are higher priority tasks now.

Merging this now ;) Thank you!

@heitorlessa heitorlessa added the internal Maintenance changes label Mar 29, 2021
@heitorlessa heitorlessa added this to the 1.14.0 milestone Mar 29, 2021
@heitorlessa heitorlessa merged commit 3bd0e46 into aws-powertools:develop Mar 29, 2021
heitorlessa referenced this pull request in heitorlessa/aws-lambda-powertools-python Apr 4, 2021
* develop:
  fix(idempotent): Correctly raise IdempotencyKeyError (#378)
  feat(event-handler): Add AppSync handler decorator (#363)
  feat(parameter): add dynamodb_endpoint_url for local_testing (#376)
  fix(parser): S3Model support empty keys (#375)
  fix(data-classes): Add missing operationName (#373)
  fix: perf tests for Logger and fail str msgs
  feat(parser): Add S3 Object Lambda Event (#362)
  build(pre-commit): Add pre-commit to make pr (#368)
  fix(tracer): Correct type hint for MyPy (#365)
  fix(metrics): AttributeError raised by MediaManager and Typing and docs (#357)

Signed-off-by: heitorlessa <lessa@amazon.co.uk>
@michaelbrewer michaelbrewer deleted the build-pre-commit branch April 18, 2021 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Maintenance changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants