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

Configuration file reading is broken in 3.11.0 #246

Closed
pgrawehr opened this issue Mar 18, 2023 · 9 comments
Closed

Configuration file reading is broken in 3.11.0 #246

pgrawehr opened this issue Mar 18, 2023 · 9 comments

Comments

@pgrawehr
Copy link

After updating to V3.11.0, the -c or --config option no longer works. It is just ignored, and hence any configuration options (like links to ignore) are uneffective.

The tool doesn't even attempt to read the config file. Running

 markdown-link-check.cmd -c .\a-non-existing-file.json -v Documentation\creating-new-release.md

does not produce an error about a missing json file (but only because there's a broken link in that file in my case).

Reverting back to V3.10.3 fixes this.

@laurit
Copy link

laurit commented Mar 18, 2023

I think this is caused by updating commander dependency.

input.opts.showProgressBar = (program.progress === true); // force true or undefined to be true or false.
input.opts.quiet = (program.quiet === true);
input.opts.verbose = (program.verbose === true);
input.opts.retryOn429 = (program.retry === true);
input.opts.aliveStatusCodes = program.alive;
relies on the default behaviour described in https://github.com/tj/commander.js/tree/release/6.x#avoiding-option-name-clashes which seems to have been removed in later versions.

@MarcelMue
Copy link

Can only confirm that it's broken and fails silently. cc @tcort if you haven't seen the issue yet ❤️

@belorenz
Copy link

Can confirm timeout parameter is ignored in v.3.11.0. Also quiet, which is not part of the config.json.

kevinvalleau added a commit to kevinvalleau/markdown-link-check that referenced this issue Mar 23, 2023
The options passed as command line arguments were ignored.
Fixes issue tcort#248 and tcort#246.
@maTraxion
Copy link

Confirming that ignorePatterns and aliveCodes are currently ignored, haven't validated other configuration as of yet.

@RaimondB
Copy link

I can also confirm the issue. Both running via mega-linter, or using the markdown-link-check directly, do not use the igorePatterns as specified in the .markdown-link-check.json. This also does not work when explicitly providing the config file location via the -c option.

This currently break my build, so I will try to use a previous image that does not contain the bug.

@Kurt-von-Laven
Copy link

In response to user feedback, I downgraded markdown-link-check to v3.10.3 in MegaLinter v6.22.0. We will unpin markdown-link-check once a fix to this issue is released.

holamgadol added a commit to holamgadol/foliant-md-linter that referenced this issue Apr 7, 2023
@tcort
Copy link
Owner

tcort commented Apr 11, 2023

should be fixed in 3.11.1. If not, please re-open.

@tcort tcort closed this as completed Apr 11, 2023
@nhinze23
Copy link

nhinze23 commented Apr 11, 2023

No specified config file now returns an error in 3.11.1

docker run ghcr.io/tcort/markdown-link-check:3.11.1                                         
/src/markdown-link-check:99
		input.opts.config = program.opts().config.trim();
		                                         ^

TypeError: Cannot read properties of undefined (reading 'trim')
    at getInputs (/src/markdown-link-check:99:44)
    at main (/src/markdown-link-check:232:20)

Node.js v19.8.1

@vordimous
Copy link

vordimous commented Apr 19, 2023

Node.js v19.9.0
/Users/adanelz/Library/pnpm/global/5/.pnpm/markdown-link-check@3.11.1/node_modules/markdown-link-check/markdown-link-check:99
                input.opts.config = program.opts().config.trim();

I am getting this error on the latest version. MacOS install with pnpm.

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

No branches or pull requests

10 participants