Skip to content

feat!: emit warning that StrictUndefined will be enabled by default in the future#2590

Draft
mschoettle wants to merge 8 commits into
copier-org:masterfrom
mschoettle:enable-strictundefined-warning
Draft

feat!: emit warning that StrictUndefined will be enabled by default in the future#2590
mschoettle wants to merge 8 commits into
copier-org:masterfrom
mschoettle:enable-strictundefined-warning

Conversation

@mschoettle

Copy link
Copy Markdown
Contributor

BREAKING CHANGES: Existing templates will see a FutureWarning emitted.

Follow-up to #2587 as a second phase towards enabling StrictUndefined by default.

This makes it possible to fail fast when there are undefined variables in templates.
Also, it avoids having to define a custom extension to enable StrictUndefined.

Closes copier-org#1522
…n the future

BREAKING CHANGES: Existing templates will see a FutureWarning emitted.
@codecov

codecov Bot commented Apr 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.16%. Comparing base (e05ddfe) to head (2df3930).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2590   +/-   ##
=======================================
  Coverage   97.15%   97.16%           
=======================================
  Files          60       60           
  Lines        7101     7117   +16     
=======================================
+ Hits         6899     6915   +16     
  Misses        202      202           
Flag Coverage Δ
unittests 97.16% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mschoettle

Copy link
Copy Markdown
Contributor Author

@sisp Before I put more effort into this. Is there any interest in having this change (even if it is not merged right away)?

@sisp

sisp commented Apr 24, 2026

Copy link
Copy Markdown
Member

@mschoettle I think eventually we'll want to use StrictUndefined by default because it's the safer behavior, but #2482 is holding me back from even announcing the future change at this point. I'd leave it up you whether you'd like to update this PR and keep it open until we've resolved #2482 or close it in favor of an issue that tracks it with a reference to resolving #2482 as a precondition.

@mschoettle

Copy link
Copy Markdown
Contributor Author

@sisp I brought it up to date and will leave it open. Is there anything I can help to advance #2482?

@sisp

sisp commented May 6, 2026

Copy link
Copy Markdown
Member

Thanks for your efforts and offer to help advance #2482, @mschoettle! 🙏 The way I see it, #2482 is best addressed after a major refactoring that decouples prompting from generation better. I've been working towards it with as much time as I can dedicate, hopefully it will be ready soon-ish. 🤞 I anticipate that implementing this fix and several other enhancements will become much easier then. I realize this is a somewhat unsatisfying, somewhat vague reply, but I'm convinced the wait will be worth it. 💪 🙂

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.

2 participants