From 55d746c1617f6f2b92f1d58cc8206b1d9e0ab60f Mon Sep 17 00:00:00 2001 From: JohnnyMorganz Date: Sat, 16 Sep 2023 15:27:57 -0500 Subject: [PATCH] Update readme and changelog --- CHANGELOG.md | 4 ++++ README.md | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef0ebac3..25d15113 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Added flag `--respect-ignores`. By default, files explicitly passed to stylua (e.g. `stylua foo.lua`) will always be formatted, regardless of whether the file is ignored. Enabling this flag will consider `.styluaignore` or glob matches before formatting the file. + ## [0.18.2] - 2023-09-10 ### Fixed diff --git a/README.md b/README.md index e1575e51..8b233bde 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,9 @@ stylua -g '*.lua' -g '!*.spec.lua' -- . # format all Lua files except test files Note, if you are using the glob argument, it can take in multiple strings, so `--` is required to break between the glob pattern and the files to format. -Glob Filtering is only used for directory searching - passing a file directly (e.g. `stylua foo.txt`) will override the glob. +By default, glob filtering (and `.styluaignore` files) are only applied for directory traversal and searching. +Files passed directly (e.g. `stylua foo.txt`) will override the glob / ignore and always be formatted. +To disable this behaviour, pass the `--respect-ignores` flag (`stylua --respect-ignores foo.txt`). ### Filtering using `.styluaignore`