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

Bail on fatal errors #208

Merged
merged 1 commit into from Jul 6, 2017
Merged

Bail on fatal errors #208

merged 1 commit into from Jul 6, 2017

Conversation

mojodna
Copy link
Contributor

@mojodna mojodna commented Jul 5, 2017

E.g. when invoked by a package.json in a subdirectory:

$ git commit -m "Reformat-on-commit"
Found '/Users/seth/src/hotosm/osm-export-tool2/ui/.nvmrc' with version <6>
Now using node v6.11.0 (npm v3.10.10)
Found '/Users/seth/src/hotosm/osm-export-tool2/ui/.nvmrc' with version <6>
Now using node v6.11.0 (npm v3.10.10)
husky > npm run -s precommit (node v6.11.0)

Error: fatal: Not a git repository: '.git'

    at ChildProcess.<anonymous> (/Users/seth/src/hotosm/osm-export-tool2/ui/node_modules/staged-git-files/index.js:85:19)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:891:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)
/Users/seth/src/hotosm/osm-export-tool2/ui/node_modules/lint-staged/src/index.js:46
            files.forEach((file) => {
                 ^

TypeError: Cannot read property 'forEach' of undefined
    at sgf (/Users/seth/src/hotosm/osm-export-tool2/ui/node_modules/lint-staged/src/index.js:46:18)
    at /Users/seth/src/hotosm/osm-export-tool2/ui/node_modules/staged-git-files/index.js:13:13
    at /Users/seth/src/hotosm/osm-export-tool2/ui/node_modules/staged-git-files/index.js:38:13
    at ChildProcess.<anonymous> (/Users/seth/src/hotosm/osm-export-tool2/ui/node_modules/staged-git-files/index.js:88:9)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:891:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)

husky > pre-commit hook failed (add --no-verify to bypass)

@codecov
Copy link

codecov bot commented Jul 5, 2017

Codecov Report

Merging #208 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #208   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines          69     69           
  Branches       10     10           
=====================================
  Hits           69     69

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 a97faab...39cb718. Read the comment docs.

@okonet okonet merged commit ca85d82 into lint-staged:master Jul 6, 2017
@okonet
Copy link
Collaborator

okonet commented Jul 6, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants