diff --git a/home/dot_config/mise/tasks/checks.toml b/home/dot_config/mise/tasks/checks.toml index 0ea07b7..fba3709 100644 --- a/home/dot_config/mise/tasks/checks.toml +++ b/home/dot_config/mise/tasks/checks.toml @@ -38,7 +38,14 @@ echo "No Mise configuration found; skipping." ["check:oxfmt"] description = "Check File Formatting" dir = "{{cwd}}" -run = "oxfmt --check --no-error-on-unmatched-pattern . '!**/{.mise.toml,mise.toml,.mise/config.toml,mise/config.toml,.config/mise.toml,.config/mise/config.toml}'" +# oxfmt reads only local ignore files, so pass Git's global one too. +run = ''' +set -- --no-error-on-unmatched-pattern +for ignore in .gitignore .prettierignore "${XDG_CONFIG_HOME:-$HOME/.config}/git/ignore"; do + [ ! -f "$ignore" ] || set -- "$@" --ignore-path "$ignore" +done +oxfmt --check "$@" . '!**/{.mise.toml,mise.toml,.mise/config.toml,mise/config.toml,.config/mise.toml,.config/mise/config.toml}' +''' ["check:python"] description = "Lint Python & Check Formatting" diff --git a/home/dot_config/mise/tasks/formatting.toml b/home/dot_config/mise/tasks/formatting.toml index 42dbf6d..a1f5732 100644 --- a/home/dot_config/mise/tasks/formatting.toml +++ b/home/dot_config/mise/tasks/formatting.toml @@ -10,7 +10,14 @@ run = "mise fmt" ["fmt:oxfmt"] description = "Format Project Files" dir = "{{cwd}}" -run = "oxfmt --write --no-error-on-unmatched-pattern . '!**/{.mise.toml,mise.toml,.mise/config.toml,mise/config.toml,.config/mise.toml,.config/mise/config.toml}'" +# oxfmt reads only local ignore files, so pass Git's global one too. +run = ''' +set -- --no-error-on-unmatched-pattern +for ignore in .gitignore .prettierignore "${XDG_CONFIG_HOME:-$HOME/.config}/git/ignore"; do + [ ! -f "$ignore" ] || set -- "$@" --ignore-path "$ignore" +done +oxfmt --write "$@" . '!**/{.mise.toml,mise.toml,.mise/config.toml,mise/config.toml,.config/mise.toml,.config/mise/config.toml}' +''' ["fmt:python"] description = "Sort Python Imports & Format Code"