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
.mlc.toml
options are not used
#78
Comments
@nukemandan I don't fully understand what you tried to do and what did not work? You passed an invalid TOML file to mlc? Then the expected behavior would be a panic with no further actions. You did not pass a TOML file? The expected behavior is to use default config variables if they are not overriden by the CLI args. |
See how I invoke here: https://github.com/Polkadot-Blockchain-Academy/pba-book/blob/3dd5f5e087cf2250fe3a90d0e1722c629fbc3c35/Makefile.toml#L175-L185 When I run without flags set, I would expect https://github.com/Polkadot-Blockchain-Academy/pba-book/blob/main/.mlc.toml to be picked up, but I cannot seem to get the settings working from the config file no matter the variations I try on the command, from the TLD of the repo. |
@nukemandan that is unexpected. Just coppied your config on my lokal setup and there I don't have the issue. When I set debug to true I get the following (expected) output: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ +
+ markup link checker - mlc v0.16.2 +
+ +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19:51:41 [DEBUG] (1) mlc::logger: Initialized logging
19:51:41 [INFO] Config:
Debug: true
Dir: .\
Types: ["Markdown", "Html"]
Offline: false
MatchExt: true
RootDir: ./content/
IgnoreLinks: *slides.md,*slides.html,*twitter.com*,*sec.gov*,*support.giphy.com*,*bitdefender.com*,*etherscan.io*,*cryptoslate.com*,*golden.com*,
IgnorePath: [""]
Throttle: 0 ms On what system are you trying to execute mlc? Linux? What distro? Could you please run it with --debug and see if there is anything interesting in the logs? |
Here is some output on my end
As you can see, the root dir is ignored, and the current working dir is used. I think that is the real bug here. |
minimal example of the issue: # from path with .mlc.toml in it:
# Overwrites the config for IgnoreLinks of the config file. Works as expected, skipping a dead link
mlc --debug content/xcm/config/page.md -i "*slides.html" | tee mlc.log
# Although IgnoreLinks in the debug is correctly set, errors
mlc --debug content/xcm/config/page.md | tee mlc.log
|
@nukemandan reading your comments in the PR #80, can this issue be closed? Do you have a solution for your problem? |
learned the hard way to RTFM 😜 sorry about that! Sadly no, the last comment details what I still think is a bug. |
@nukemandan I don't really know what the bug is? Can you provide me a minimal working example of what is not working with the toml file, but does work without it? It is hard for me to reproduce since I don't see any differences once the file is parsed correctley (which you would see in the debug logs). Then the same config struct is used to run the code and it should always produce the same results. |
So here is perhaps one: https://github.com/Cryptorado-Community/cryptorado-rs/pull/4/files#diff-001bc7edd34a2a3d34d6220d949af7ef1f2dd2818303d04c2a7cdab9c708bb7cR8 I want to ignore the output of Any chance you have a rust project with with mlc configured and built rustdocs? See it's it's just me 😭 (thanks for the support btw!) |
The file is read correctly:
mlc/src/cli.rs
Lines 14 to 20 in 377d20f
I do get an error as expected with a bad TOML file passed in, but the settings are then not respected by the command. I suspect it's simply overridden by the
opt
var getting clobbered by nothing passed into the cli ars?The text was updated successfully, but these errors were encountered: