Repository navigation
Conversation
A nested .markdownlint-cli2.* file replaced the config from parent directories, so rules it did not mention fell back to rumdl defaults. A .markdownlint-cli2.* file also took precedence over a .markdownlint.* file in the same directory. markdownlint-cli2 does neither, and rumdl should give a config file the meaning its owning tool gives it. The resolution follows markdownlint-cli2's source (createDirInfos and lintFiles), not only observed output. The inheritance walk ends at the directory rumdl runs from (the LSP workspace root), because markdownlint-cli2 stops at its working directory. - Nested .markdownlint-cli2.* configs merge over their parents, a nearer rule entry replacing the inherited one as a whole - .markdownlint.* files win over a .markdownlint-cli2.* config in the same directory, and are inherited while no cli2 file in between sets config - Explicit --config files and the public load_discovered stay standalone Fixes rvben#941
Owner
|
Thanks for the configuration-inheritance fix. Your original commit has been incorporated with authorship preserved. Follow-up fixes cover CLI2 ignore behavior across CLI, stdin, and LSP, plus the MD060 alias from #944. The combined changes passed independent reviews and regression checks. Closing this PR as incorporated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #941.
rumdl reads
.markdownlint-cli2.*and.markdownlint.*files on behalf of markdownlint-cli2, so I think it should resolve them the same way markdownlint-cli2 does. Two things differed:.markdownlint-cli2.*file replaced the config from parent directories, so rules it didn't mention fell back to rumdl's defaults..markdownlint-cli2.*file took precedence over a.markdownlint.*file in the same directory. markdownlint-cli2 does the opposite (config: markdownlintConfig || markdownlintOptions?.configinlintFiles).I based the resolution on markdownlint-cli2's source (
createDirInfos,mergeOptions,lintFiles) and checked each case against markdownlint-cli2 v0.23.3:.markdownlint-cli2.*configs merge over their parents. LikemergeOptions, a rule key in a nearer file replaces the inherited entry as a whole (no deep merge of rule options)..markdownlint.*file is used as-is. It beats a.markdownlint-cli2.*configin the same directory, and a nested directory inherits it while no.markdownlint-cli2.*file in between setsconfig.--configfiles stay standalone. The publicSourcedConfig::load_discoveredkeeps its signature and behavior; the LSP uses a new crate-privateload_discovered_withinthat takes the workspace root.MARKDOWNLINT_CONFIG_FILESnow lists.markdownlint.*before.markdownlint-cli2.*(and.jsoncbefore.json, matching markdownlint-cli2's order).Known limitations:
rumdl config), although every file in the chain is listed inloaded_files.Type of Change
Testing
make test-dev)make test-devhas 14 failures locally, and the same tests fail onmainfor me: the code block tool tests need gofmt, prettier, ruff, and similar tools I don't have installed, anda_filtered_file_under_a_vendor_directory_still_countsfails too.Checklist
make fmt&&make lint)Clippy passes.
lint-actionscouldn't run locally because shellcheck isn't installed.