-
Notifications
You must be signed in to change notification settings - Fork 72
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
.styluaignore isn't respected when comparing a single file #377
Comments
When you run |
In my actual case, it's midway up the path, but I just tried putting in a |
The VSCode extension looks for We could potentially search ancestor directories for a |
Yeah either that or if you could combine them, like: So it could use the path to build up to the file and look for ignore files in between. Even if it started from cwd and worked up would help. |
Spent some time examining this further, but it turns out this is a limitation in the dependency we are using to traverse and ignore files. We actually are already specifying to look in parent directories for a .styluaignore file, and it does seem to be finding it, but for some reason when It seems as though internally when its matching the gitignores, its using the file path given as the root of the gitignore, which is incorrect, an example of the issue can be seen in a directory structure like:
with The dependency we used doesn't seem to really be maintained (the author wants to completely rewrite the crate some time in the future), so the only way around this I guess is to handle all this logic manually. Refs: |
For instance,
If I have a
.styluaignore
file that looks like:path/
This will check the file:
stylua -c path/to/file.lua
But this would not:
stylua -c .
As an alternative, I can do
stylua -g path/to/file.lua -- .
But then I'm doing a full directory scan on each call.
The text was updated successfully, but these errors were encountered: