mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #219] Extends does not work for subfolders (possible CLI issue) #188
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#188
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TheJaredWilcurt on GitHub (Aug 28, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/219
YAML configs
✔️ YAML next to file works
✔️ JSON next to file works
❌
./subfolder YAML does not work❌
./subfolder JSON does not work❌ Relative subfolder YAML does not work
❌ Relative subfolder JSON does not work
JSON configs
✔️ YAML next to file works
✔️ JSON next to file works
❌
./subfolder YAML does not work❌
./subfolder JSON does not work❌ Relative subfolder YAML does not work
❌ Relative subfolder JSON does not work
@DavidAnson commented on GitHub (Aug 28, 2019):
There are tests for relative and absolute path handling for this scenario, so I hope it is not as broken as the above seems to suggest. I believe paths are resolved relative to the working directory rather than the input file. Is there a chance that’s responsible for the behavior above? If not, I will need to try to reproduce this myself.
@DavidAnson commented on GitHub (Aug 28, 2019):
To be clear, I think the extends path is relative to the working directory when specified in the options object, and relative to the config file when specified inside a config file. I’m not entirely sure of the structure you have above.
@TheJaredWilcurt commented on GitHub (Aug 28, 2019):
CWD is
C:\projectFolder structure for
C:\projectThis has a few problems:
tjwmarkdownlint.ymlnext to themarkdownlint.ymlmarkdownlint.ymlextend toextends: tjwmarkdownlint.yml-i './node_modules/**/*'doesn't seem to actually ignore'./README.md, ./docs/**/*.md'./docs/**/*.mdto avoid lintingnode_modules. Where as I would prefer to just ignorenode_modulesand target./**/*.md. But I know most of these problems are probably for themarkdownlint-clirepo.@TheJaredWilcurt commented on GitHub (Aug 28, 2019):
For clarification, running
npm run lintabove will still run and lint, it just won't use any of the rules set by the file I am extending (unless it is moved to the same directory level)@DavidAnson commented on GitHub (Aug 28, 2019):
If you have a repo that shows the problem, please provide a link. You are right that some of this may be CLI behavior. It’s curious you find that ignore does not work - could you please look at this exchange and the example I created for that scenario? https://github.com/igorshubovych/markdownlint-cli/issues/62
@DavidAnson commented on GitHub (Aug 28, 2019):
Your 1 definitely seems like a problem. I’ll need to debug to determine where, though.
@TheJaredWilcurt commented on GitHub (Aug 28, 2019):
@DavidAnson I'm working on this:
Currently in Windows. Will try Ubuntu VM to see if issue occurs in other OS's.
@TheJaredWilcurt commented on GitHub (Aug 28, 2019):
On Ubuntu VM:
Following instructions from:
Using this repo for testing
'./README.md, ./content/**/*.md', happening on Win and Lin, likely CLI related.@DavidAnson commented on GitHub (Aug 28, 2019):
Quoting multiple inputs is not supported by the CLI as far as I know. I will look into the path issue with extends. But I do almost all of my ignore testing on Windows, so it’s odd that you are seeing something I am not. I will try with your repository when I look into this. However, I am in the middle of a sizable change, so won’t be able to do that immediately.
@DavidAnson commented on GitHub (Aug 28, 2019):
BTW, glob and ignore are CLI features - the library just takes a list of file names and lints them.
@TheJaredWilcurt commented on GitHub (Aug 29, 2019):
I updated this repo:
So you just need to do
git clone https://github.com/TheJaredWilcurt/cole-cat.gitcd cole-catnpm installnpm run markdown-lintShould be able to see it not ignoring
node_modules, and not extending the rules.@DavidAnson commented on GitHub (Aug 29, 2019):
Thank you!
@DavidAnson commented on GitHub (Sep 3, 2019):
@TheJaredWilcurt:
node_modulesis because of the single quotes around the path which get interpreted as part of the path. Removing them gives the expected behavior.Here's a diff with the two change I made to the above repo on Windows to get this working:
@TheJaredWilcurt commented on GitHub (Sep 3, 2019):
The ignore being double quotes was really dumb and I should have caught. I originally had no quotes, then it wouldn't work in Linux, so I added single quotes and it worked in linux but not Windows. Anyways, double quotes works for that!
And yeah, the typo thing is really dumb too. Thanks for catching that.
@DavidAnson commented on GitHub (Sep 3, 2019):
Glad this had a happy ending! :)
_#2013