Skip to content
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

[WIP] - feat: add pre-commit framework #5078

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jbampton
Copy link
Member

@jbampton jbampton commented Mar 11, 2021

Official -> "Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By pointing these issues out before code review, this allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks."

https://pre-commit.com/

Description

Using a pre-commit framework speeds up development as a lot of tests can be run on the local machine giving instant feedback. So we don't have to wait for the CI / GitHub actions to run to get feedback. The pre-commit automatically fixes some of the issues when you do git commit and if there are any issues the tests are marked as red failed and the commit fails. Then you will need to commit again so that all the tests pass green.

There are many more pre-commit checks listed here -> https://pre-commit.com/hooks.html

Lets get this PR merged and then I will look at adding more pre-commit tests 👍

The next image shows some of the final pre-commit run for all files -> running on my local machine:

Screen Shot 2021-03-11 at 11 35 30 am

Related issue and scope

  • I opened an issue to propose and discuss this change (#????)

My changes affect the following components

  • API
  • Controller
  • Message Bus (e.g., Kafka)
  • Loadbalancer
  • Scheduler
  • Invoker
  • Intrinsic actions (e.g., sequences, conductors)
  • Data stores (e.g., CouchDB)
  • Tests
  • Deployment
  • CLI
  • General tooling
  • Documentation

Types of changes

  • Bug fix (generally a non-breaking change which closes an issue).
  • Enhancement or new feature (adds new functionality).
  • Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).
  • I added tests to cover my changes.
  • My changes require further changes to the documentation.
  • I updated the documentation where necessary.

@jbampton jbampton force-pushed the add-pre-commit-framework branch 3 times, most recently from bce1f5d to 643a13e Compare March 11, 2021 02:39
@jbampton jbampton changed the title feat: add pre-commit framework [WIP] - feat: add pre-commit framework Mar 11, 2021
@codecov-io
Copy link

codecov-io commented Mar 11, 2021

Codecov Report

Merging #5078 (bc83947) into master (659b762) will decrease coverage by 46.60%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #5078       +/-   ##
===========================================
- Coverage   81.92%   35.31%   -46.61%     
===========================================
  Files         213      206        -7     
  Lines       10316    10051      -265     
  Branches      452      449        -3     
===========================================
- Hits         8451     3550     -4901     
- Misses       1865     6501     +4636     
Impacted Files Coverage Δ
...a/org/apache/openwhisk/common/ConfigMapValue.scala 0.00% <0.00%> (-100.00%) ⬇️
.../apache/openwhisk/core/controller/Namespaces.scala 0.00% <0.00%> (-100.00%) ⬇️
...pache/openwhisk/core/controller/CorsSettings.scala 0.00% <0.00%> (-100.00%) ⬇️
...che/openwhisk/core/entitlement/RateThrottler.scala 0.00% <0.00%> (-100.00%) ⬇️
...he/openwhisk/core/entitlement/KindRestrictor.scala 0.00% <0.00%> (-100.00%) ⬇️
...penwhisk/core/database/cosmosdb/CosmosDBUtil.scala 0.00% <0.00%> (-100.00%) ⬇️
.../openwhisk/core/entitlement/ActionCollection.scala 0.00% <0.00%> (-100.00%) ⬇️
.../openwhisk/core/entitlement/LocalEntitlement.scala 0.00% <0.00%> (-100.00%) ⬇️
...nwhisk/core/database/cosmosdb/CosmosDBConfig.scala 0.00% <0.00%> (-100.00%) ⬇️
...openwhisk/core/entitlement/PackageCollection.scala 0.00% <0.00%> (-100.00%) ⬇️
... and 140 more

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 659b762...bc83947. Read the comment docs.

@jbampton jbampton force-pushed the add-pre-commit-framework branch 11 times, most recently from 4dfb131 to 99d6e86 Compare March 14, 2021 16:27
@jbampton jbampton force-pushed the add-pre-commit-framework branch from 99d6e86 to bc83947 Compare March 14, 2021 16:31
@jbampton jbampton marked this pull request as draft October 18, 2024 01:19
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.

2 participants