Skip to content

Fast Precommit#4171

Draft
MicahMaphet wants to merge 2 commits into
bitpay:masterfrom
MicahMaphet:fast-precommit
Draft

Fast Precommit#4171
MicahMaphet wants to merge 2 commits into
bitpay:masterfrom
MicahMaphet:fast-precommit

Conversation

@MicahMaphet
Copy link
Copy Markdown
Contributor

Description

Only run eslint on staged files

Changelog

  • precommit.sh shell script to filter files based on
  1. Modified or new staged files (not deleted files as those can show up in diffs)
  2. Either JavaScript or TypeScript files
  3. Files in bitcore-cli, bitcore-client, bitcore-logging, bitcore-node, bitcore-wallet-client, bitcore-wallet-service, crypto-rpc, or crypto-wallet-core
  4. Files in a src, test, lib, or scripts folder
  • Swapped lerna script with ./precommit.sh in packages.json precommit script
  • Removed precommit from all packages

Testing Notes

Test Basic Functionality

  1. Add random characters to a file in a package that is checked (like bitcore-node)
  2. Add the file in git (perhaps run git add .)
  3. Run git commit, the precommit script should fail stopping the commit from being created

Edge Cases

The commit should work according to the first bullet point in the Cangelog above


Checklist

  • I have read CONTRIBUTING.md and verified that this PR follows the guidelines and requirements outlined in it.

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.

1 participant