Open scop opened 1 year ago
In theory, this would be a relatively easy change
I'm just not too sure about the idea of relying on a directory to know what a file type is. Wouldn't #726 better fit the cases?
Regarding the concern about relying on a dir to know a file's type, the glob in the example might lead thoughts that way. But if we use a specific file (including its path) rather than a glob as the example, wouldn't it make perfect sense to be able to label a specific file as some type when we know that's the case, instead of having to label all files that might have the same basename and for which the type would be incorrect?
I just ran into this limitation as well. I have multiple directories containing test related files (mostly .csv and .log files) which get picked up by typos
. They contain "spelling errors", but these are essentially false-positives as the files don't contain text and "fixing" them also isn't possible because it would mean changing the test data.
These directories always match the path tests/data/
so I was hoping to just exclude them, but as I know now that doesn't work :)
I was especially confused because the documentation mentions "gitignore syntax":
Looking at the implementation it's really only a small subset of gitignore's capabilities. I'm not saying that it should support full gitignore syntax, I'm just wondering whether this part of the documentation should be changed.
Would you accept this feature as a contribution or do you think it should be solved differently? In this case, #726 wouldn't help either.
@scootermon this issue is about extend-glob
while extend-exclude
is a lot more flexible.
Could you start a separate Discussion or Issue with a reproduction case?
It seems currently extend-glob does not work if given a path rather than a file basename.
For example, in https://github.com/scop/bash-completion I would like to specify that all files (well except for
Makefile*
) in thecompletions/
subdir are shell files, but I'm failing to accomplish that:(Curious that Broken pipe error BTW, but I digress.)