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

The command line is too long(windows) #147

Closed
sudo-suhas opened this issue Apr 15, 2017 · 38 comments · Fixed by #149
Closed

The command line is too long(windows) #147

sudo-suhas opened this issue Apr 15, 2017 · 38 comments · Fixed by #149

Comments

@sudo-suhas
Copy link
Collaborator

sudo-suhas commented Apr 15, 2017

I ran my project through prettier and ended up with 99+ modified files. Am using cmder on windows 8 and I got this while trying to commit:

λ git commit -m "Make it prettier"
25l[20:30:20] Running tasks for src/**/*.js [started]
[20:30:20] eslint --fix [started]
[20:30:20] eslint --fix [failed]
[20:30:20] → 🚫 eslint --fix found some errors. Please fix them and try committing again.
The command line is too long.
Stack Trace
{ Error: Command failed: E:\Projects\repos\elastic-builder\node_modules\.bin\eslint.CMD --fix -- E:\Projects\repos\elastic-builder\src\queries\term-level-queries\wildcard-query.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\value-term-query-base.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\type-query.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\terms-query.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\term-query.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\regexp-query.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\range-query.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\prefix-query.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\ids-query.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\fuzzy-query.js E:\Projects\repos\elastic-builder\src\queries\term-level-queries\exists-query.js E:\Projects\repos\elastic-builder\src\queries\specialized-queries\script-query.js E:\Projects\repos\elastic-builder\src\queries\specialized-queries\percolate-query.js E:\Projects\repos\elastic-builder\src\queries\specialized-queries\more-like-this-query.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-within-query.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-term-query.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-or-query.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-not-query.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-near-query.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-multi-term-query.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-little-big-base.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-first-query.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-field-masing-query.js E:\Projects\repos\elastic-builder\src\queries\span-queries\span-containing-query.js E:\Projects\repos\elastic-builder\src\queries\match-none-query.js E:\Projects\repos\elastic-builder\src\queries\match-all-query.js E:\Projects\repos\elastic-builder\src\queries\joining-queries\parent-id-query.js E:\Projects\repos\elastic-builder\src\queries\joining-queries\nested-query.js E:\Projects\repos\elastic-builder\src\queries\joining-queries\joining-query-base.js E:\Projects\repos\elastic-builder\src\queries\joining-queries\has-parent-query.js E:\Projects\repos\elastic-builder\src\queries\joining-queries\has-child-query.js E:\Projects\repos\elastic-builder\src\queries\geo-queries\geo-shape-query.js E:\Projects\repos\elastic-builder\src\queries\geo-queries\geo-query-base.js E:\Projects\repos\elastic-builder\src\queries\geo-queries\geo-polygon-query.js E:\Projects\repos\elastic-builder\src\queries\geo-queries\geo-distance-query.js E:\Projects\repos\elastic-builder\src\queries\geo-queries\geo-bounding-box-query.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\simple-query-string-query.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\query-string-query.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\query-string-query-base.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\multi-match-query.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\mono-field-query-base.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\match-query.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\match-phrase-query.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\match-phrase-query-base.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\match-phrase-prefix-query.js E:\Projects\repos\elastic-builder\src\queries\full-text-queries\common-terms-query.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\score-functions\script-score-function.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\score-functions\score-function.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\score-functions\random-score-function.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\score-functions\field-value-factor-function.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\score-functions\decay-score-function.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\function-score-query.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\dis-max-query.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\constant-score-query.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\boosting-query.js E:\Projects\repos\elastic-builder\src\queries\compound-queries\bool-query.js E:\Projects\repos\elastic-builder\src\index.js E:\Projects\repos\elastic-builder\src\core\util.js E:\Projects\repos\elastic-builder\src\core\sort.js E:\Projects\repos\elastic-builder\src\core\script.js E:\Projects\repos\elastic-builder\src\core\rescore.js E:\Projects\repos\elastic-builder\src\core\request-body-search.js E:\Projects\repos\elastic-builder\src\core\query.js E:\Projects\repos\elastic-builder\src\core\inner-hits.js E:\Projects\repos\elastic-builder\src\core\indexed-shape.js E:\Projects\repos\elastic-builder\src\core\highlight.js E:\Projects\repos\elastic-builder\src\core\geo-shape.js E:\Projects\repos\elastic-builder\src\core\geo-point.js E:\Projects\repos\elastic-builder\src\core\consts.js E:\Projects\repos\elastic-builder\src\core\aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\sum-bucket-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\stats-bucket-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\serial-differencing-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\pipeline-aggregation-base.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\percentiles-bucket-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\moving-average-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\min-bucket-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\max-bucket-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\extended-stats-bucket-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\derivative-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\cumulative-sum-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\bucket-selector-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\bucket-script-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\pipeline-aggregations\avg-bucket-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\value-count-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\top-hits-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\sum-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\stats-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\scripted-metric-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\percentiles-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\percentile-ranks-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\min-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\metrics-aggregation-base.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\max-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\geo-centroid-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\geo-bounds-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\extended-stats-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\cardinality-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\metrics-aggregations\avg-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\matrix-aggregations\matrix-stats-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\terms-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\terms-aggregation-base.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\significant-terms-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\sampler-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\reverse-nested-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\range-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\range-aggregation-base.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\nested-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\missing-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\ip-range-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\histogram-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\histogram-aggregation-base.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\global-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\geo-hash-grid-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\geo-distance-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\filters-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\filter-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\diversified-sampler-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\date-range-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\date-histogram-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\children-aggregation.js E:\Projects\repos\elastic-builder\src\aggregations\bucket-aggregations\bucket-aggregation-base.js
The command line is too long.

    at Promise.all.then.arr (E:\Projects\repos\elastic-builder\node_modules\execa\index.js:210:11)
    at process._tickCallback (internal/process/next_tick.js:103:7)
  code: 1,
  killed: false,
  stdout: '',
  stderr: 'The command line is too long.\r\n',
  failed: true,
  signal: null,
  cmd: 'E:\\Projects\\repos\\elastic-builder\\node_modules\\.bin\\eslint.CMD --fix -- E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\wildcard-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\value-term-query-base.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\type-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\terms-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\term-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\regexp-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\range-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\prefix-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\ids-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\fuzzy-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\term-level-queries\\exists-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\specialized-queries\\script-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\specialized-queries\\percolate-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\specialized-queries\\more-like-this-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-within-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-term-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-or-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-not-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-near-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-multi-term-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-little-big-base.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-first-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-field-masing-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\span-queries\\span-containing-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\match-none-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\match-all-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\joining-queries\\parent-id-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\joining-queries\\nested-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\joining-queries\\joining-query-base.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\joining-queries\\has-parent-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\joining-queries\\has-child-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\geo-queries\\geo-shape-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\geo-queries\\geo-query-base.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\geo-queries\\geo-polygon-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\geo-queries\\geo-distance-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\geo-queries\\geo-bounding-box-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\simple-query-string-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\query-string-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\query-string-query-base.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\multi-match-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\mono-field-query-base.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\match-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\match-phrase-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\match-phrase-query-base.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\match-phrase-prefix-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\full-text-queries\\common-terms-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\score-functions\\script-score-function.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\score-functions\\score-function.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\score-functions\\random-score-function.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\score-functions\\field-value-factor-function.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\score-functions\\decay-score-function.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\function-score-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\dis-max-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\constant-score-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\boosting-query.js E:\\Projects\\repos\\elastic-builder\\src\\queries\\compound-queries\\bool-query.js E:\\Projects\\repos\\elastic-builder\\src\\index.js E:\\Projects\\repos\\elastic-builder\\src\\core\\util.js E:\\Projects\\repos\\elastic-builder\\src\\core\\sort.js E:\\Projects\\repos\\elastic-builder\\src\\core\\script.js E:\\Projects\\repos\\elastic-builder\\src\\core\\rescore.js E:\\Projects\\repos\\elastic-builder\\src\\core\\request-body-search.js E:\\Projects\\repos\\elastic-builder\\src\\core\\query.js E:\\Projects\\repos\\elastic-builder\\src\\core\\inner-hits.js E:\\Projects\\repos\\elastic-builder\\src\\core\\indexed-shape.js E:\\Projects\\repos\\elastic-builder\\src\\core\\highlight.js E:\\Projects\\repos\\elastic-builder\\src\\core\\geo-shape.js E:\\Projects\\repos\\elastic-builder\\src\\core\\geo-point.js E:\\Projects\\repos\\elastic-builder\\src\\core\\consts.js E:\\Projects\\repos\\elastic-builder\\src\\core\\aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\sum-bucket-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\stats-bucket-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\serial-differencing-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\pipeline-aggregation-base.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\percentiles-bucket-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\moving-average-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\min-bucket-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\max-bucket-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\extended-stats-bucket-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\derivative-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\cumulative-sum-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\bucket-selector-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\bucket-script-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\pipeline-aggregations\\avg-bucket-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\value-count-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\top-hits-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\sum-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\stats-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\scripted-metric-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\percentiles-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\percentile-ranks-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\min-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\metrics-aggregation-base.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\max-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\geo-centroid-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\geo-bounds-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\extended-stats-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\cardinality-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\metrics-aggregations\\avg-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\matrix-aggregations\\matrix-stats-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\terms-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\terms-aggregation-base.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\significant-terms-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\sampler-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\reverse-nested-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\range-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\range-aggregation-base.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\nested-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\missing-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\ip-range-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\histogram-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\histogram-aggregation-base.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\global-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\geo-hash-grid-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\geo-distance-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\filters-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\filter-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\diversified-sampler-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\date-range-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregation� eslint --fix found some errors. Please fix them and try committing again.
s\\bucket-aggregations\\date-histogram-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\children-aggregation.js E:\\Projects\\repos\\elastic-builder\\src\\aggregations\\bucket-aggregations\\bucket-aggregation-base.js',
The command line is too long.
  timedOut: false }
@okonet
Copy link
Collaborator

okonet commented Apr 15, 2017

Good one! I think you could solve it by hacking windows. I don't think I can offer a solution. You should probably skip the pre-commit hook for this one. If you find a better solution please let me know.

@sudo-suhas
Copy link
Collaborator Author

sudo-suhas commented Apr 16, 2017

I did skip it for that one. However, might be worthwhile to fix it though. Would it be possible to split up the task and spawn multiple child processes if the number of files exceeds a certain limit?

@okonet
Copy link
Collaborator

okonet commented Apr 17, 2017

Feel free to create a PR and we can discuss it. I'm open for any improvements.

@sudo-suhas
Copy link
Collaborator Author

This is what I am thinking. In findBin.js, instead of returning an object, I could return an array of objects which would have chunks of paths created using lodash.chunk. These tasks could be run in parallel in runScript.js and Promise.all would resolve with ✅ ${ linter } passed! or the error message.

Few questions:

  1. Splitting up the task and running it in parallel should be a win right? Although non-windows systems probably won't have the command length issue, they can still benefit from parallelism right? Or is there something that will break when we do this? Tests will probably provide a good safety net.
  2. What should be the size of the chunk? I was thinking 42 - the answer to everything. However this is not bullet proof. Another method would be to calculate the chunk sizes based on actual string length to keep under some limit. For windows systems, it should be 8191
  3. Can we reliably use Promise.all in all node envs? travis will probably asnwer this question definitively.
  4. If we are spawning tasks, how do we control concurrency? I usually use bluebird map for this but adding bluebird as a dependency might be overkill?

@okonet
Copy link
Collaborator

okonet commented Apr 18, 2017

  1. Yes, I think it's worth exploring. I think it might be a conflict with concurrent option: https://github.com/okonet/lint-staged/blob/master/src/index.js#L33. See https://github.com/okonet/lint-staged#options But I think we could drop it.
  2. I don't think 42 is a good number here and it should be based on performance/OS limitations. So this max length windows limitation is a good baseline for me. We could even try running tasks in parallel for each file and see if this is faster. But I don't think so.
  3. Don't know please look up for yourself. I believe so.
  4. Listr support that AFAIK so no need in bluebird.

@sudo-suhas
Copy link
Collaborator Author

sudo-suhas commented Apr 21, 2017

@okonet I am facing issue with execa mocking while I am trying to modify the code. Should I make a pull request with tests failing?

EDIT: I was able to successfully run lint-staged on 147 files with my local copy of lint-staged(using npm link)

@okonet
Copy link
Collaborator

okonet commented Apr 24, 2017

Create a PR and let's discuss there.

sudo-suhas added a commit to sudo-suhas/lint-staged that referenced this issue May 12, 2017
package.json - Add lodash.chunk, p-map dependency
calcChunkSize
  Add helper function for bullet proof chunk size calculation
  Add calcChunkSize.spec.js with tests
findBin
  Modify signature, remove paths from input
  Return {bin, args}, file paths should be appended before passing to execa
  Modify tests to match new signature
index
  Use readConfigOption for reading option concurrent
  Pass config to runScript options for reading subTaskConcurrency, chunkSize
readConfigOption
  Add generic helper function for reading config option
  Add readConfigOption.spec.js with tests
runScript
  Use p-map to run runnables returned from findBin with configured concurrency
  Use readConfigOption for reading config, subTaskConcurrency, chunkSize
  Default chunkSize to Number.MAX_SAFE_INTEGER to minimise number of chunks
  Default subTaskConcurrency to 2
  Use lodash.chunk to generate file path chunks
  Cache execaOptions and use Object.assign for cloning
  Combine findBin.args and file paths before passing to execa
  Update runScript.spec.js to always pass files as an array to `runScript`

Closes lint-staged#147
sudo-suhas added a commit to sudo-suhas/lint-staged that referenced this issue May 24, 2017
package.json - Add lodash.chunk, p-map dependency
calcChunkSize
  Add helper function for bullet proof chunk size calculation
  Add calcChunkSize.spec.js with tests
findBin
  Modify signature, remove paths from input
  Return {bin, args}, file paths should be appended before passing to execa
  Modify tests to match new signature
index
  Use readConfigOption for reading option concurrent
  Pass config to runScript options for reading subTaskConcurrency, chunkSize
readConfigOption
  Add generic helper function for reading config option
  Add readConfigOption.spec.js with tests
runScript
  Use p-map to run runnables returned from findBin with configured concurrency
  Use readConfigOption for reading config, subTaskConcurrency, chunkSize
  Default chunkSize to Number.MAX_SAFE_INTEGER to minimise number of chunks
  Default subTaskConcurrency to 2
  Use lodash.chunk to generate file path chunks
  Cache execaOptions and use Object.assign for cloning
  Combine findBin.args and file paths before passing to execa
  Update runScript.spec.js to always pass files as an array to `runScript`
Setup babel-preset-env + transform-runtime for async in node 4

Closes lint-staged#147

Closes lint-staged#147
okonet pushed a commit that referenced this issue May 25, 2017
If the amount of staged files is big, passing them as arguments can exceed a max string limit (on Windows it's `8191`). This PR addresses it by splitting work into chunks based on this limit and running linters in parallel.

Closes #147
@ForsakenHarmony
Copy link

Uhh, this seems to have been removed again?

@okonet
Copy link
Collaborator

okonet commented Oct 18, 2019

Afaik we have a different check now.

@iiroj
Copy link
Member

iiroj commented Oct 18, 2019

The current functionality is to check the length of the string containing all staged filenames, and print a warning: https://github.com/okonet/lint-staged/blob/403f80b74468dd5682f27bfbeabdd779d492f0e8/src/runAll.js#L61

Now that I look at it, it might be inaccurate as the that file list is relative to the git root, but by default the paths are resolved as absolute. It would be better to move this check a bit further in the code.

A function linter can be implemented with custom logic to circumvent too long commands: https://github.com/okonet/lint-staged#example-run-eslint-on-entire-repo-if-more-than-10-staged-files

@ForsakenHarmony
Copy link

Yeah I saw that one after I posted it, but I don't really think it's ideal, I feel like it would be more user friendly for lint-staged to handle this as it did before

Had this commit with 288 files

Didn't see a warning, only thing I saw after running it 5 times (didn't notice it before that) is the message in the last line (after 2 newlines) "The command line is too long."

@joejordan
Copy link

Just got bit by this one as well. Large commit with 200+ changes on Windows. Never had this happen before, when was this change made?

@iiroj
Copy link
Member

iiroj commented Oct 20, 2019

The previous behavior was problematic for functional linter configurations. The change was introduced in v9.0.0.

I supposed it would be possible to chunk the file list and create multiple runs from the function linters as well, but it would be take some refactoring.

PR is welcome, otherwise I can fix this when I have the time. Since I don’t use Windows, a repo reproducing a fail would be convenient.

@okonet
Copy link
Collaborator

okonet commented Oct 22, 2019

I think chunking which we had before introduces a lot of complexity to the code base and it was quite hard to maintain because of that. I'd say, since committing big amount of files usually happens after a merge, there is no need to run lint-staged on it usually and users can just skip doing so. We could improve warning message and print better instructions, though.

@joejordan
Copy link

There are plenty of situations where one might accidentally hit the command line length limit on non-trivial projects, so having builds fail, identify the failure as part of the staged linter, and then having to circumvent it for larger commits is simply not a viable option for us on a growing team of developers.

Our use case is that we're running eslint with airbnb, prettier, and a few custom rules. I reverted to 8.2.1 and the commit was handled fine. I would think that this is one of the most common usage scenarios for lint-staged but I could be wrong.

@iiroj
Copy link
Member

iiroj commented Oct 22, 2019

I am willing to make a PR that ”reverts” this behaviour and goes back to chunking. Since now we generate a list of task from a large array of files, we could instead split the array into chunks and generate tasks for all the chunks. This is, as I can see, the only way to support both the function linters and chunking. For listr instead of the ”running tasks...” step we could show multiple ”running tasks (chunk 1)...”.

What do you think, @okonet?

@Ethorsen
Copy link

Ethorsen commented Nov 5, 2019

Having the same issue here. It does not take a lot of files to hit that windows cmd length limit. It has become a nuisance for our developers. Will revert back to 8.2.1 for now.

@Splaktar
Copy link

My team just hit this as well, after only enabling lint-staged for 3 days. It's taken quite a while to track it through various levels and repos to finally find the issue here.

Since this issue is closed, should we open a new issue?

@iiroj iiroj reopened this Nov 15, 2019
@iiroj iiroj added this to the v10 milestone Nov 15, 2019
@iiroj
Copy link
Member

iiroj commented Nov 15, 2019

I added this ”back” to the v10 milestone. Testing anything Windows-specific is a bit of a chore, but I’ll manage with Appveyor.

@iiroj
Copy link
Member

iiroj commented Nov 15, 2019

One specific thing I’d like to know though: is this also an issue with WSL, or only on native Windows shells?

@Splaktar
Copy link

Splaktar commented Nov 15, 2019

It was an issue with Cygwin Bash and PowerShell (😬). We resolved it for now by using 8.2.1.

@Ethorsen
Copy link

We are using git-bash that came with https://conemu.github.io/
Screenshot_1

@okonet
Copy link
Collaborator

okonet commented Nov 20, 2019

🎉 This issue has been resolved in version 10.0.0-beta.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iiroj
Copy link
Member

iiroj commented Nov 21, 2019

Maybe someone could find the time to test a commit with a large number of staged files on Windows using 10.0.0-beta.4? I think I implemented a nice chunking to it, but since I don't have an actual Windows environment set up, I can't tell for sure.

@ForsakenHarmony
Copy link

Yup, seems to have worked fine

@lennoncork
Copy link

Also yes, ran into this problem today, tested the beta and everything worked great.

@vincentpalita
Copy link

I confirm that 10.0.0-beta.4 works fine on Windows with a large monorepo and a big staged files list.

@iiroj
Copy link
Member

iiroj commented Nov 25, 2019

Thanks a lot testing! I think v10 is soon ready to merge, but I’m a bit busy myself until next week.

@gaborluk
Copy link

@iiroj, I'm afraid the issue may still persist, unless I'm messing something up majorly. Trying to commit 180 files at once, I get this even after updating to 10.0.0-beta.4:

√ Preparing...
  > Running tasks (chunk 0/2)...
    > Running tasks for *.{js,jsx}
      × eslint
        cross-env CI=true jest --bail --findRelatedTests
  √ Running tasks (chunk 1/2)...
  ↓ Applying modifications... [skipped]
    → Skipped because of errors from tasks
  √ Reverting to original state...
  √ Cleaning up...

× eslint found some errors. Please fix them and try committing again.

The command line is too long.

Is there anything more useful I can give you for looking into this?

@iiroj
Copy link
Member

iiroj commented Nov 26, 2019

@gaborluk Please post your config, and debug logs by running with lint-staged --debug. Note that the logs might contain absolute file paths.

@gaborluk
Copy link

@iiroj, here's the relevant part of package.json:

"lint-staged": {
  "*.{js,jsx}": [
    "eslint",
    "cross-env CI=true jest --bail --findRelatedTests"
  ]
},
"husky": {
  "hooks": {
    "pre-commit": "lint-staged"
  }
},
...
"devDependencies": {
  ...
  "babel-eslint": "^10.0.3",
  "cross-env": "^6.0.3",
  "cypress": "^3.4.1",
  "eslint": "^6.7.1",
  "eslint-config-standard": "^14.1.0",
  "eslint-config-standard-react": "^9.2.0",
  "eslint-plugin-import": "^2.18.2",
  "eslint-plugin-node": "^10.0.0",
  "eslint-plugin-promise": "^4.2.1",
  "eslint-plugin-react": "^7.14.3",
  "eslint-plugin-react-hooks": "^2.0.1",
  "eslint-plugin-standard": "^4.0.1",
  "husky": "^3.0.8",
  "jest": "^24.9.0",
  "lint-staged": "^10.0.0-beta.4",
  ...
}

And this is .eslintrc.json:

{
  "env": {
    "browser": true,
    "es6": true
  },
  "extends": [
    "standard",
    "standard-react"
  ],
  "globals": {
    "Atomics": "readonly",
    "SharedArrayBuffer": "readonly"
  },
  "ignorePatterns": [
    "cypress/support",
    "dist",
    "node_modules"
  ],
  "overrides": [
    {
      "files": [
        "*.spec.js",
        "*.spec.jsx",
        "*.test.js",
        "*.test.jsx"
      ],
      "env": {
        "jest": true
      },
      "globals": {
        "Cypress": "readonly",
        "cy": "readonly"
      }
    }
  ],
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 2018,
    "sourceType": "module"
  },
  "plugins": [
    "react",
    "react-hooks"
  ],
  "rules": {
    "react/no-did-mount-set-state": "off",
    "react/no-did-update-set-state": "off",
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn"
  }
}

I sent you the debug log via email, hope that's alright. Let me know if you need anything else.

@iiroj
Copy link
Member

iiroj commented Nov 27, 2019

Thanks for the logs, @gaborluk! I think you hit a case where the chunks' length was so close to the max arg length that when combined with your actual command, the resulting string was too long. I improved debug logging and halved the maxArgLength so that in your case it now creates four instead of two chunks. Let me know if it helps!

EDIT: This is in v10.0.0-beta.5

@gaborluk
Copy link

Works like a charm now, @iiroj, thanks a lot for the quick turnaround. Much appreciated.

@iiroj
Copy link
Member

iiroj commented Dec 3, 2019

Cool. I will leave this open until v10 releases.

@okonet
Copy link
Collaborator

okonet commented Jan 19, 2020

🎉 This issue has been resolved in version 10.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iiroj
Copy link
Member

iiroj commented Jan 19, 2020

v10.0.0 has been released so this should be closed from the milestone.

@kokushkin
Copy link

kokushkin commented Apr 6, 2022

So, at the moment it was introduced (V10) there was an argument maxArgLength . But it didn't matter what you assign to this argument cause it was changed internally right in the beginning of the algorithm. Then the argument disappeared (around 10.4.2) to avoid the unnecessary confusion I suppose.
Is my understanding correct? 🤔

Now, I'm on 10.5.4 and I'm still getting this bug time to time on big merges (not the end of the world, honestly I'd opt for --no-verify in case of merges I think it's fine 🤷‍♂️). Am I doing something wrong?

Just wanted to clarify 🙂

@phuochau
Copy link

phuochau commented May 7, 2022

For anyone who has this issue, I solved it by splitting the files into chunks, it works on my projects. Hope it helps.

.lintstagedrc.js

const _ = require('lodash')

const chunkFileSize = 5

module.exports = {
    'src/**/*.{ts,scss,css,html}': (filenames) => {
        if (filenames.length > chunkFileSize) {
            const chunkArrays = _.chunk(filenames, chunkFileSize)
            let commands = []
            for (const arr of chunkArrays) {
              commands = commands.concat([`prettier ${arr.join(' ')} --write`, `eslint ${arr.join(' ')}`])
            }
            return commands;
        }
        return [`prettier ${filenames.join(' ')} --write`, `eslint ${filenames.join(' ')}`];
    }
};

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

Successfully merging a pull request may close this issue.