Skip to content

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

Development

Successfully merging this pull request may close these issues.

Respect .styluaignore when explicitly passing in file names .styluaignore isn't respected when comparing a single file

2 participants