Skip to content

fix: concurrent option is not working correctly - #950

Merged
iiroj merged 1 commit into
lint-staged:masterfrom
jay-es:fix-concurrent-option
Feb 5, 2021
Merged

iiroj merged 1 commit into
lint-staged:masterfrom
jay-es:fix-concurrent-option

Conversation

@jay-es

@jay-es jay-es commented Feb 5, 2021

Copy link
Copy Markdown
Contributor

Hello.

The value of --concurrent CLI option is passed as string like 'true' and '2'.
And tasks run serially when this option is set (even --concurrent true).

This is because the code to assign concurrency looks like this.

// node_modules/listr2/dist/listr.js:34-40 
this.concurrency = 1;
if (this.options.concurrent === true) {
    this.concurrency = Infinity;
}
else if (typeof this.options.concurrent === 'number') {
    this.concurrency = this.options.concurrent;
}

I have fixed this behavior.
Please review this PR, thanks.

before → after.
image

@iiroj

iiroj commented Feb 5, 2021

Copy link
Copy Markdown
Member

@jay-es very nice catch! Thanks.

@codecov

codecov Bot commented Feb 5, 2021

Copy link
Copy Markdown

Codecov Report

Merging #950 (89739d9) into master (29a0b68) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #950   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines          611       611           
  Branches       144       144           
=========================================
  Hits           611       611           

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 29a0b68...89739d9. Read the comment docs.

@iiroj
iiroj merged commit 4383815 into lint-staged:master Feb 5, 2021
@iiroj

iiroj commented Feb 5, 2021

Copy link
Copy Markdown
Member

@jay-es thanks again, merged!

@jay-es

jay-es commented Feb 5, 2021

Copy link
Copy Markdown
Contributor Author

@iiroj Thank you!

@github-actions

github-actions Bot commented Feb 5, 2021

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 10.5.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

This was referenced Mar 11, 2021
zeekay pushed a commit to hanzoai/lint-staged that referenced this pull request Sep 9, 2026
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.

2 participants