11 Commits

Author SHA1 Message Date
Sigurd Spieckermann
ef5ea4b212 refactor: rename internal modules with a _ prefix 2025-04-22 13:52:51 +02:00
Sigurd Spieckermann
ede686561d test: use helper function to load answers file data 2025-03-07 12:21:36 +01:00
Axel H.
33485117f5 test(migrations): use the new migration format in the test to avoid warnings 2025-03-03 14:37:27 +01:00
Axel H.
71358ed397 feat(settings): allow to define some trusted repositories or prefixes 2025-01-29 19:46:06 +01:00
Jairo Llopis
fd23923b5c
style(ruff-format): enable and reformat Python files
Until now, only linting was enabled. My failure.

I added this setting to widen the code style automation. I also enabled [keep-runtime-typing](https://docs.astral.sh/ruff/settings/#lint_pyupgrade_keep-runtime-typing) because we use Pydantic.

Finally, I executed the new formatting over all the project.
2024-12-03 13:59:00 +01:00
Sigurd Spieckermann
0258635da7 fix: support Git config without user identity 2024-07-30 13:40:17 +02:00
danieleades
878c4d4f40
style: add 'flake-future-annotations' lint group (#1506)
* add ruff 'flake8-future-annotations' (FA) lint group
2024-02-22 06:19:17 +00:00
Sigurd Spieckermann
32746bd2a5 fix(cli): use return code 4 for unsafe template error
BREAKING CHANGE: Changes the return code for unsafe template error from
2 to 4 to avoid return code collision with Plumbum's `SwitchError` type
errors which use return code 2.
2023-09-25 10:26:55 +01:00
Mitch Negus
931961f24a
fix: provide more clarification in unsafe error message (#1280)
Fixes https://github.com/copier-org/copier/issues/1269
2023-08-17 08:49:18 +01:00
Jairo Llopis
aaf6cf3843
feat: add --trust as a less scary alternative to --UNSAFE (#1179)
See rationale in https://github.com/copier-org/copier/issues/1137#issuecomment-1579304713.

Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
2023-06-28 21:17:32 +02:00
Sigurd Spieckermann
83f44cb4b6
feat: disable unsafe features by default and add --UNSAFE switch (#1171)
I've disabled the use of unsafe features (Jinja extensions, migrations, and tasks) by default and added a new CLI switch `--UNSAFE` which enables them. Templates that don't use unsafe features are unaffected by this change. But Copier will raise an error for templates that do use unsafe features unless the `--UNSAFE` flag is passed.

I've not added an interactive prompt that asks for consent for using unsafe features because I think it's not clear how to distinguish between interactive prompting and raising an error when `--UNSAFE` is not passed. For this, I think Copier would need a switch that clearly states whether interactive or non-interactive mode is desired. Currently, `--defaults` implies this for questions.

Fixes https://github.com/copier-org/copier/issues/1137

BREAKING CHANGE: Copier raises an error when a template uses unsafe features unless the `--UNSAFE` switch is passed
2023-06-01 18:22:40 +00:00