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

Add husky pre-commit hook #625

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

JeffGreiner-eaton
Copy link
Collaborator

@JeffGreiner-eaton JeffGreiner-eaton commented Sep 26, 2024

Fixes BLUI-6037.

Changes proposed in this Pull Request:

  • added husky with pre-commit
  • set jest config to include coverage thresholds
  • pre-commit will run cd ./components && yarn && yarn prettier:check && yarn lint && yarn coverage

Screenshots / Screen Recording (if applicable)

rn-husky-hook.mov

To Test:

  • clone fresh copy git clone https://github.com/etn-ccis/blui-react-native-component-library.git
  • git checkout feature/blui-6037-husky-pre-commit-hook
  • run yarn install:components
  • make a change somewhere to generate change set (readme)
  • depending on your normal commits

a.) use the vs code source control panel to stage and commit.
(the husky pre-commit runs in the background and when complete your commit will compete)

OR

b.) use the terminal git add . && git commit -m 'my commit' (running in terminal will display what pre-commit runs)

Next test

  • edit the jest.config file in components directory and update line 14 to be "lines": 76
  • make additional change in readme
  • repeat step (a) from above and when vs code modal opens select open git log.

OR

  • repeat step (b) from above and view output

Any specific feedback you are looking for?

@github-actions github-actions bot added the brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering label Sep 26, 2024
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.46%. Comparing base (3e615ae) to head (2799da7).
Report is 3 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #625   +/-   ##
=======================================
  Coverage   70.46%   70.46%           
=======================================
  Files          67       67           
  Lines        1236     1236           
  Branches      183      183           
=======================================
  Hits          871      871           
  Misses        337      337           
  Partials       28       28           
Flag Coverage Δ
unittests 70.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JeffGreiner-eaton JeffGreiner-eaton merged commit e3771e8 into dev Sep 30, 2024
12 checks passed
@JeffGreiner-eaton JeffGreiner-eaton deleted the feature/blui-6037-husky-pre-commit-hook branch September 30, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering
Development

Successfully merging this pull request may close these issues.

3 participants