Code Monkey home page Code Monkey logo

Comments (11)

becheran avatar becheran commented on June 11, 2024

@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.

from mlc.

NukeManDan avatar NukeManDan commented on June 11, 2024

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.

from mlc.

becheran avatar becheran commented on June 11, 2024

@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?

from mlc.

NukeManDan avatar NukeManDan commented on June 11, 2024

Here is some output on my end

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+                                                          +
+            markup link checker - mlc v0.16.2             +
+                                                          +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

17:01:43 [DEBUG] (1) mlc::logger: Initialized logging
17:01:43 [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
17:01:43 [INFO] Search for files of markup types '[Markdown, Html]' in directory '"./"'
17:01:43 [DEBUG] (1) mlc::file_traversal: Found file: MarkupFile { markup_type: Markdown, path: "./content/polkadot/data-sharding/page.md" }.
17:01:43 [DEBUG] (1) mlc::file_traversal: Found file: MarkupFile { markup_type: Markdown, path: "./content/polkadot/data-sharding/slides.md" }.

As you can see, the root dir is ignored, and the current working dir is used. I think that is the real bug here.

from mlc.

NukeManDan avatar NukeManDan commented on June 11, 2024

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
mlc --debug content/xcm/config/page.md | tee mlc.log

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+                                                          +
+            markup link checker - mlc v0.16.2             +
+                                                          +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

22:52:04 [DEBUG] (1) mlc::logger: Initialized logging
22:52:04 [INFO] Config:
Debug: true
Dir: content/xcm/config/page.md
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
22:52:04 [INFO] Search for files of markup types '[Markdown, Html]' in directory '"content/xcm/config/page.md"'
22:52:04 [DEBUG] (1) mlc::file_traversal: Found file: MarkupFile { markup_type: Markdown, path: "content/xcm/config/page.md" }.
22:52:04 [INFO] Scan file at path 'content/xcm/config/page.md' for links.
22:52:04 [WARN] Strip everything after #. The chapter part '#-how-to-use-revealjs-slides' is not checked.
22:52:04 [DEBUG] (1) mlc::link_validator::file_system: Check file system link target "../../contribute/how-to/page.md#-how-to-use-revealjs-slides"
22:52:04 [DEBUG] (1) mlc::link_validator::file_system: Check file system link target "slides.html"
22:52:04 [WARN] Strip everything after #. The chapter part '#top' is not checked.
22:52:04 [DEBUG] (1) mlc::link_validator::file_system: Check file system link target "#top"
22:52:04 [INFO] Throttle HTTP requests to same host: false
22:52:04 [INFO] Check link /home/nuke/git/book/content/xcm/config/../../contribute/how-to/page.md.
22:52:04 [DEBUG] (1) mlc::link_validator::file_system: Absolute target path Path { inner: "/home/nuke/git/book/content/xcm/config/../../contribute/how-to/page.md" }
22:52:04 [INFO] Check link /home/nuke/git/book/content/xcm/config/.
22:52:04 [DEBUG] (1) mlc::link_validator::file_system: Absolute target path Path { inner: "/home/nuke/git/book/content/xcm/config/" }
22:52:04 [INFO] Check link /home/nuke/git/book/content/xcm/config/slides.html.
22:52:04 [DEBUG] (1) mlc::link_validator::file_system: Absolute target path Path { inner: "/home/nuke/git/book/content/xcm/config/slides.html" }
[ OK ] content/xcm/config/page.md (7, 1) => ../../contribute/how-to/page.md#-how-to-use-revealjs-slides -
[Err ] content/xcm/config/page.md (8, 1) => slides.html - Target filename not found.[ OK ] content/xcm/config/page.md (16, 1) => #top -


Result (3 links):


OK       2
Skipped  0
Warnings 0
Errors   1

The following links could not be resolved:

content/xcm/config/page.md (8, 1) => slides.html

from mlc.

becheran avatar becheran commented on June 11, 2024

@NukeManDan reading your comments in the PR #80, can this issue be closed? Do you have a solution for your problem?

from mlc.

NukeManDan avatar NukeManDan commented on June 11, 2024

learned the hard way to RTFM 😜 sorry about that!

Sadly no, the last comment details what I still think is a bug. [Err ] content/xcm/config/page.md (8, 1) => slides.html - Target filename not found.[ OK ] content/xcm/config/page.md (16, 1) => #top - here I have explicitly stated to ignore this link in any file, but the error comes up only for the config file, not if set in the cli agrs.

from mlc.

becheran avatar becheran commented on June 11, 2024

@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.

from mlc.

NukeManDan avatar NukeManDan commented on June 11, 2024

So here is perhaps one: https://github.com/Cryptorado-Community/cryptorado-rs/pull/4/files#diff-001bc7edd34a2a3d34d6220d949af7ef1f2dd2818303d04c2a7cdab9c708bb7cR8

I want to ignore the output of cargo doc and set target to be explicitly ignored. Yet in any rust project I run with this minimal setting in .mlc.toml in the project root, I have mlc checking the rustdocs built. I can get the right behavior with the CLI flag set mlc --ignore-path target

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!)

from mlc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.