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

Misleading error message when no input files are detected #104

Open
arvigeus opened this issue Jul 3, 2020 · 4 comments
Open

Misleading error message when no input files are detected #104

arvigeus opened this issue Jul 3, 2020 · 4 comments

Comments

@arvigeus
Copy link

arvigeus commented Jul 3, 2020

Continued from markdownlint#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 suggests I entered invalid command.

@MrBra1nwash
Copy link

+1

@micahjsmith
Copy link

This same symptom occurs if the user provides a path to a specific existing file but that file is ignored via any of the ignore mechanisms.

My two cents is that either of these two situations should be a 0 exit code -- the tool has considered all 0 files and none of them had any lint issues

@jrwagz
Copy link

jrwagz commented Mar 13, 2023

This is related to #370 but it seems like if the user explicity provides a path to a file to lint, and the file doesn't exist, then we should exit with 1 to indicate the error.

@moltar
Copy link

moltar commented Jan 25, 2024

This same symptom occurs if the user provides a path to a specific existing file but that file is ignored via any of the ignore mechanisms.

My two cents is that either of these two situations should be a 0 exit code -- the tool has considered all 0 files and none of them had any lint issues

This totally got me and I've spent quite a bit of time trying to understand why the glob was not working.

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

No branches or pull requests

6 participants