Skip to content

Ignore hidden files in include paths#39

Merged
chevdor merged 1 commit into
chevdor:masterfrom
oiahoon:fix/ignore-hidden-include-files
Jul 14, 2026
Merged

Ignore hidden files in include paths#39
chevdor merged 1 commit into
chevdor:masterfrom
oiahoon:fix/ignore-hidden-include-files

Conversation

@oiahoon

@oiahoon oiahoon commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ignore hidden files such as .DS_Store when recursively loading include templates
  • add a CLI regression test that keeps ordinary .txt includes working

Root cause

The include glob used **/*, so Tera tried to parse hidden filesystem metadata as templates.

Validation

  • reproduced the current failure with an invalid .DS_Store in the include path
  • confirmed the corrected command renders both the main and included .txt template
  • cargo test --locked — 24 passing
  • cargo test --locked --all-features — 25 passing
  • cargo check --locked
  • cargo check --locked --all-features
  • cargo clippy --locked --all-features --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check

Fixes #11

@chevdor
chevdor merged commit c33f1e0 into chevdor:master Jul 14, 2026
5 checks passed
chevdor added a commit that referenced this pull request Jul 14, 2026
Follow-up to #39 / #11:

- Replace the include glob with an explicit walkdir scan so hidden
  *directories* (e.g. .git, .cache) are pruned too, not only hidden
  files; the previous pattern **/[!.]* still parsed files inside them.
- Add an --include-hidden flag to restore the old behavior for users
  whose templates live in dotfiles or hidden folders.
- Generate the hidden-file fixtures at test runtime in a temp dir
  instead of committing a .DS_Store to the repo (Finder rewrites it,
  global gitignores fight it), and cover both the default and the
  --include-hidden paths.
- Document the new behavior in README and regenerate doc/usage.adoc.
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.

.DS_Store getting in the way

2 participants