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

Support --respect-ignores #765

Merged
merged 6 commits into from
Nov 11, 2023
Merged

Support --respect-ignores #765

merged 6 commits into from
Nov 11, 2023

Conversation

JohnnyMorganz
Copy link
Owner

@JohnnyMorganz JohnnyMorganz commented Sep 16, 2023

By default, files explicitly passed to the command line stylua (e.g. stylua foo.lua) will be formatted regardless of whether they are present within the .styluaignore file or not. This is due to the assumption that explicit files are expected to be formatted as the user provided them directly.

We add in a flag --respect-ignores that should be used to check the ignore file first before formatting.

Existing editor tools should migrate to this flag to respect .styluaignore in IDEs, rather than rolling their own logic (the VSCode extension currently has its own logic for ignore detection).

Fixes #751 and Fixes #377

TODO: right now stylua --stdin-filepath path/to/ignored.lua - doesn't consider this flag, and always ignores the file. It should migrate to respecting the flag

@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b5efedf) 97.54% compared to head (ca17e81) 97.54%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #765   +/-   ##
=======================================
  Coverage   97.54%   97.54%           
=======================================
  Files          16       16           
  Lines        6146     6146           
=======================================
  Hits         5995     5995           
  Misses        151      151           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JohnnyMorganz JohnnyMorganz mentioned this pull request Nov 11, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant