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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

pretty-quick --staged should give better indication of which file failed #45

Closed
jcollum-nike opened this issue Oct 11, 2018 · 4 comments
Labels
enhancement New feature or request Hacktoberfest

Comments

@jcollum-nike
Copy link

馃攳  Finding changed files since git revision 1973849.
馃幆  Found 26 changed files.
/Users/jcol53/work/orders/node_modules/prettier/index.js:24285
      throw error;
      ^

SyntaxError: Unexpected token (1:1)
> 1 | 
    | ^
    at createError (/Users/jcol53/work/orders/node_modules/prettier/parser-babylon.js:1:110)
    at Object.parse (/Users/jcol53/work/orders/node_modules/prettier/parser-babylon.js:1:986)
   at Object.parse$4 [as parse] (/Users/jcol53/work/orders/node_modules/prettier/index.js:24274:19)
    at formatWithCursor (/Users/jcol53/work/orders/node_modules/prettier/index.js:33650:27)
    at format (/Users/jcol53/work/orders/node_modules/prettier/index.js:33695:10)
    at format (/Users/jcol53/work/orders/node_modules/prettier/index.js:33945:12)
    at exports.default (/Users/jcol53/work/orders/node_modules/pretty-quick/dist/formatFiles.js:18:41)
    at exports.default (/Users/jcol53/work/orders/node_modules/pretty-quick/dist/index.js:47:29)
    at Object.<anonymous> (/Users/jcol53/work/orders/node_modules/pretty-quick/bin/pretty-quick.js:12:1)

Seems clear that there is a syntax error but I have 25 files staged (big merge). It would be helpful if there was a --verbose flag that would output the name of each file as they were processed, that way I can quickly figure out which file is causing the issues.

@jcollum-nike
Copy link
Author

Workaround:

  1. git diff --name-only --cached
  2. run ./node_modules/.bin/prettier on every file from item 1 in a bash script

xargs or join each line with && might help too

@azz
Copy link
Member

azz commented Oct 11, 2018

Definitely a good idea.

@azz azz added enhancement New feature or request Hacktoberfest labels Oct 11, 2018
@flurmbo
Copy link
Contributor

flurmbo commented Oct 11, 2018

Can I try this one?

@flurmbo flurmbo mentioned this issue Oct 12, 2018
@azz azz closed this as completed in #46 Oct 12, 2018
@azz
Copy link
Member

azz commented Oct 12, 2018

Released in 1.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest
Projects
None yet
Development

No branches or pull requests

3 participants