question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[input] is required: supply via stdin, or --env or --edit or --from and --to

See original GitHub issue

Expected Behavior

Linter should work correctly

Current Behavior

Gives a help message

husky > pre-commit (node v14.8.0)
ℹ No staged files match any configured task.
husky > commit-msg (node v14.8.0)
@commitlint/cli@9.1.2 - Lint your commit messages

[input] reads from stdin if --edit, --env, --from and --to are omitted
...
[input] is required: supply via stdin, or --env or --edit or --from and --to
husky > commit-msg hook failed (add --no-verify to bypass)

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

Played from version @commitlint/cli@9.1.2 in version @commitlint/cli@9.1.1 works stably

.huskyrc

.huskyrc

{
  "hooks": {
    "commit-msg": "commitlint --extends=@commitlint/config-angular -e"
  }
}

Context

Your Environment

Executable Version
commitlint --version v9.1.2
git --version v2.25.0
node --version v14.8.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
chrisguttandincommented, Aug 19, 2020

I hope this helps with identifying the issue. If you explicitly specify the default value it works as expected.

commitlint --edit ./.git/COMMIT_EDITMSG

An empty string works as well.

commitlint --edit ''

Therefore my guess is that it is somehow related to the switch from meow to yargs. Maybe yargs handles default arguments a little different.

4reactions
chrisguttandincommented, Sep 5, 2020

I just updated some of my repos and can confirm that it works again. Thanks a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Write Good Commit Messages with Commitlint
Firstly, we need to install the commitlint CLI and add a commitlint config (in this case the default Conventional Commits Config).
Read more >
How do I pass a string into subprocess.Popen (using the stdin ...
#!/usr/bin/env python3 from subprocess import run, PIPE p = run(['grep', 'f'], ... Use the input argument instead of the stdin argument, which accepts...
Read more >
Package Diff: @commitlint/cli @ 7.5.2 .. 7.6.0
throw new Error(`Using format ${moduleName}, but cannot find the module. ... new Error(\n\t\t\t'[input] is required: supply via stdin, or --env or --edit or ......
Read more >
docker run - Docker Documentation
The docker run command first creates a writeable container layer over the specified image, and then starts it using the specified command.
Read more >
AWS CLI skeletons and input files
These templates can be generated using the generate-cli-skeleton option. ... template that are not required and for which you don't want to supply...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found