Skip to content
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 in CWD is incorrectly ignored if cwd not included in paths to format #249

Closed
JohnnyMorganz opened this issue Aug 29, 2021 · 0 comments · Fixed by #251
Closed
Labels
bug Something isn't working

Comments

@JohnnyMorganz
Copy link
Owner

If you have a project structured such as

src/
    foo.lua
    bar.lua
tests/
.styluaignore

and you run stylua src (because you don't want to format the tests folder), it doesn't use the .styluaignore present in the current working directory.

e.g. if .styluaignore mentioned to ignore bar.lua, it would be ignored if you run stylua ., but it will still be formatted if you run stylua src. This is because the .styluaignore file isn't actually ever "noticed" by the directory walker, since the cwd wasn't passed as a starting point.

This behaviour is confusing, as you would expect the .styluaignore to be taken into account if it was present in the cwd where stylua was ran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant