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

feat(precommit): support lint-staged --config CLI flag #31

Merged
merged 1 commit into from
Jan 22, 2018

Conversation

macklinu
Copy link
Contributor

What:

This commit refactors the precommit script to use lint-staged's --config CLI flag and adds related
tests.

Why:

This PR resolves #24.

How:

I moved some of the contents of src/scripts/precommit/index.js to src/scripts/precommit.js, removing the need to fake cosmiconfig and modeling passing a --config flag to the precommit script by looking at other script files (e.g. lint). The tests should confirm what commands are being run under the hood when executing the precommit script.

Checklist:

  • Documentation - N/A
  • Tests
  • Ready to be merged
  • Added myself to contributors table

I wasn't sure which commit message to use - feat, fix, refactor. Feel free to merge this with a different commit message or let me know if you'd like to me to change it for semantic-release purposes. Thanks. 😄

This commit refactors the precommit script to use lint-staged's --config CLI flag and adds related
tests.

Resolves kentcdodds#24
@codecov
Copy link

codecov bot commented Jan 22, 2018

Codecov Report

Merging #31 into master will increase coverage by 5.8%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #31     +/-   ##
=========================================
+ Coverage   67.06%   72.86%   +5.8%     
=========================================
  Files          22       21      -1     
  Lines         337      328      -9     
  Branches       80       79      -1     
=========================================
+ Hits          226      239     +13     
+ Misses         83       66     -17     
+ Partials       28       23      -5
Impacted Files Coverage Δ
src/scripts/precommit.js 84.61% <84.61%> (ø)
src/utils.js 92.42% <0%> (+3.03%) ⬆️

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 d30389c...07f1c1c. Read the comment docs.

Copy link
Owner

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks a bunch!

@kentcdodds kentcdodds merged commit 18730c0 into kentcdodds:master Jan 22, 2018
@macklinu macklinu deleted the lint-staged-config branch January 22, 2018 21:16
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.

lint-staged now supports config CLI flag
2 participants