Skip to content

Implement .tomeignore (#53)#64

Merged
toumorokoshi merged 2 commits into
mainfrom
53-tomeignore
Apr 8, 2026
Merged

Implement .tomeignore (#53)#64
toumorokoshi merged 2 commits into
mainfrom
53-tomeignore

Conversation

@toumorokoshi

@toumorokoshi toumorokoshi commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Closes #53

Summary

Adds support for avoiding command and completion parsing for directories & files using a gitignore-like .tomeignore specification. Maintains backwards compatibility by continuing to ignore directories entirely if they contain an empty .tomeignore, while leveraging the ignore crate for robust performance and standard exclusion rules for anything defined explicitly.

Changes

  • Add ignore dependency to Cargo.toml to parse gitignore-like configurations.
  • Refactor directory.rs to introduce a centralized TomeIgnorer that builds ignore rules from the root command_directory_path while handling the legacy directory-ignore fallback.
  • Update filters in help.rs and complete.rs to filter out excluded commands / files using the new TomeIgnorer instance prior to listing them.
  • Update documentation in docs/authoring-scripts.md detailing the .tomeignore functionality with standard caveats around indexing performance.

Benchmarks

A 2,500 script layout stress test verified that the new implementation imposes essentially unnoticable overhead vs dot-prefix equivalents under standard iteration bounds:
10 queries on deep tree (complex ignore vs native prefix): 0.011s vs 0.009s (~0.2ms extra latency per evaluation).

@toumorokoshi
toumorokoshi marked this pull request as ready for review April 8, 2026 05:33
@toumorokoshi
toumorokoshi merged commit bc04f4c into main Apr 8, 2026
16 checks passed
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.

(feature request) Include a flag for determining what scripts to include

1 participant