Skip to content

feat: add --ignore-pattern flag to generate -watch#1280

Merged
a-h merged 3 commits intoa-h:mainfrom
patrickkdev:watch-ignore-pattern
Oct 8, 2025
Merged

feat: add --ignore-pattern flag to generate -watch#1280
a-h merged 3 commits intoa-h:mainfrom
patrickkdev:watch-ignore-pattern

Conversation

@patrickkdev
Copy link
Copy Markdown
Contributor

This PR adds an optional --ignore-pattern CLI flag for templ generate in watch mode, allowing files matching the specified regex to be ignored during file watching. It introduces an IgnorePattern field in RecursiveWatcher and modifies WalkFiles and the event loop to skip matching files. Two new unit tests (TestWatchIgnoresFilesMatchingIgnorePattern and TestIgnorePatternTakesPrecedenceOverWatchPattern) verify the behavior. Existing workflows without the flag remain fully compatible.

Closes #1279

@a-h a-h changed the title Add --ignore-pattern flag for watch mode with tests feat: add --ignore-pattern flag to generate -watch Oct 8, 2025
@a-h a-h merged commit c2f3317 into a-h:main Oct 8, 2025
5 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.

Can we have a --ignore-pattern flag for watch mode?

2 participants