[GH-ISSUE #304] Misleading error message when no input files are detected #260

Closed
opened 2026-03-03 01:25:12 +03:00 by kerem · 2 comments
Owner

Originally created by @arvigeus on GitHub (Jul 3, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/304

markdownlint --fix '**/*.md'

When running this command in a project without any md files, it gives me confusing error:

  Usage: markdownlint [options] <files|directories|globs>

  MarkdownLint Command Line Interface

  Options:

    -h, --help                                  output usage information
    -V, --version                               output the version number
    -f, --fix                                   fix basic errors (does not work with STDIN)
    -s, --stdin                                 read from STDIN (does not work with files)
    -o, --output [outputFile]                   write issues to file (no console)
    -c, --config [configFile]                   configuration file (JSON, JSONC, JS, or YAML)
    -i, --ignore [file|directory|glob]          file(s) to ignore/exclude
    -p, --ignore-path [file]                    path to file with ignore pattern(s)
    -r, --rules  [file|directory|glob|package]  custom rule files

It was my mistake to forget to add a readme file, but I think in this case the output should be something more specific, like No valid files found. Now it suggest I entered invalid command.

Originally created by @arvigeus on GitHub (Jul 3, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/304 ```sh markdownlint --fix '**/*.md' ``` When running this command in a project without any md files, it gives me confusing error: ```sh Usage: markdownlint [options] <files|directories|globs> MarkdownLint Command Line Interface Options: -h, --help output usage information -V, --version output the version number -f, --fix fix basic errors (does not work with STDIN) -s, --stdin read from STDIN (does not work with files) -o, --output [outputFile] write issues to file (no console) -c, --config [configFile] configuration file (JSON, JSONC, JS, or YAML) -i, --ignore [file|directory|glob] file(s) to ignore/exclude -p, --ignore-path [file] path to file with ignore pattern(s) -r, --rules [file|directory|glob|package] custom rule files ``` It was my mistake to forget to add a readme file, but I think in this case the output should be something more specific, like `No valid files found`. Now it suggest I entered invalid command.
kerem 2026-03-03 01:25:12 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Jul 3, 2020):

Agreed. Please open this issue in the CLI project because I can’t transfer it: https://github.com/igorshubovych/markdownlint-cli

<!-- gh-comment-id:653626617 --> @DavidAnson commented on GitHub (Jul 3, 2020): Agreed. Please open this issue in the CLI project because I can’t transfer it: https://github.com/igorshubovych/markdownlint-cli
Author
Owner

@arvigeus commented on GitHub (Jul 3, 2020):

Closed in favor of markdownlint-cli#104

<!-- gh-comment-id:653653827 --> @arvigeus commented on GitHub (Jul 3, 2020): Closed in favor of [markdownlint-cli#104](https://github.com/igorshubovych/markdownlint-cli/issues/104)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#260
No description provided.