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

Support multi inputs (yet a prototype) #178

Closed

Conversation

kenji-miyake
Copy link
Contributor

Overview

Resolves #78

Supported multi inputs like markdown-link-check file1.md file2.md.

Note: As I'm almost a newbie of Javascript, the code is not so good, but I guess it worked. I'll appreciate it if somebody would improve my code.

How to test

With This PR (pre-commit)

$ git clone git@github.com:kenji-miyake/markdown-link-check.git -b support-multi-inputs-prototype
$ cd markdown-link-check
$ pre-commit clean
$ pre-commit run -a
[WARNING] The 'rev' field of repo '.' appears to be a mutable reference (moving tag / branch).  Mutable references are never updated after first install and are not supported.  See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details.  Hint: `pre-commit autoupdate` often fixes this.
markdown-link-check......................................................Failed
- hook id: markdown-link-check
- exit code: 1


FILE: test-2.md

1 links checked.

FILE: test-1.md

1 links checked.

FILE: test-3.md
[✖] http://common-invalid-link.example.com
[✖] http://invalid-link3.example.com

3 links checked.

ERROR: 2 dead links found!
[✖] http://common-invalid-link.example.com → Status: 0
[✖] http://invalid-link3.example.com → Status: 0

FILE: test-4.md

1 links checked.

With This PR (CLI)

# Run git clone as above
$ sudo npm install -g . # Or something like that to install the local package
$ markdown-link-check test-1.md test-2.md test-3.md test-4.md

FILE: test-1.md
[✓] http://google.com

1 links checked.

FILE: test-2.md
[✓] http://google.com

1 links checked.

FILE: test-3.md
[✓] http://google.com
[✖] http://common-invalid-link.example.com
[✖] http://invalid-link3.example.com

3 links checked.

ERROR: 2 dead links found!
[✖] http://common-invalid-link.example.com → Status: 0
[✖] http://invalid-link3.example.com → Status: 0

FILE: test-4.md
[✓] http://google.com

1 links checked.

Without This PR (pre-commit)

$ git clone git@github.com:kenji-miyake/markdown-link-check.git -b support-multi-inputs-prototype
$ cd markdown-link-check
$ git checkout 7b3ad2c1ce5e49d03ff29cbebd6951006b0ccf4a
$ pre-commit clean
$ pre-commit run -a
[WARNING] The 'rev' field of repo '.' appears to be a mutable reference (moving tag / branch).  Mutable references are never updated after first install and are not supported.  See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details.  Hint: `pre-commit autoupdate` often fixes this.
[INFO] Initializing environment for ..
[INFO] Installing environment for ..
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
markdown-link-check......................................................Passed

Without This PR (CLI)

# Run git clone as above
$ markdown-link-check test-1.md test-2.md test-3.md test-4.md && echo "Passed"

FILE: test-1.md
[✓] http://google.com

1 links checked.
Passed

Kenji Miyake added 3 commits November 24, 2021 00:48
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
@kenji-miyake
Copy link
Contributor Author

Refactored in #179.

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

Successfully merging this pull request may close these issues.

Allow specifying multiple files on the command line
1 participant