146 Commits

Author SHA1 Message Date
Rambaud Pierrick
ee5c106164
docs: improve updating pre-commit documentation (#1361)
- there was a inconsistence between the inline and rej default. as it's inline I changed the value in the corrected section
- as users won't need the 2 options at once, I split the 2 hooks.
- specified that both repos can be used at once

Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
2024-01-15 18:43:31 +00:00
Sigurd Spieckermann
53aab1f335 docs: prefer "questionnaire" over "questionary" 2023-12-01 08:54:17 +00:00
Jairo Llopis
50d478e19d docs: explain how to use computed variables, more clearly
Fixes https://github.com/copier-org/copier/issues/1414 by documenting a clearer and safe alternative that covers most cases.
2023-11-21 16:45:54 +00:00
Axel H
99bdd11b68 feat(choices): support questionary checkbox for multiple choices using multiselect: true.
Fixes #218
2023-10-30 18:29:55 +00:00
Sigurd Spieckermann
eb492377ed docs: mention Cruft for Cookiecutter in comparison on template updates 2023-10-08 19:36:01 +02:00
Zhiliang
f8614fc96f
docs: add uses cases for updating a project (#1336) 2023-10-01 08:18:38 +01:00
Sigurd Spieckermann
59b8d6d8b0 docs: fix spelling/punctuation/terminology 2023-09-30 19:56:05 +02:00
mspiegel31
61cbe798a7
feat: allow overriding data file with CLI arguments (#1332)
Users should be able to pass CLI data arguments and use a `--data-file` at the same time.  Let's just take inspiration from the [helm values file](https://helm.sh/docs/chart_template_guide/values_files/) and give highest priority to data values passed at the command line.
2023-09-29 12:28:37 +01:00
Jannis Mainczyk
74769bc439
docs: improve link text formatting (#1344) 2023-09-26 16:58:20 +02: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
mspiegel31
a674e64a42
feat(cli): read answers from yaml file (#1325)
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
2023-09-20 07:12:04 +02:00
Jairo Llopis
ddafdee3ce
docs: placeholders are always strings
Fixes https://github.com/copier-org/copier/issues/1327
2023-09-13 07:42:14 +01:00
Sigurd Spieckermann
97371493e7 docs: unify terminology 2023-09-08 10:28:19 +02:00
Jairo Llopis
448455239f
docs: tell the world about the templated siblings feature
Closes https://github.com/copier-org/copier/issues/1238
2023-09-07 15:30:49 +01:00
Sigurd Spieckermann
d8a667a462 docs: update outdated copier update --force examples 2023-08-28 13:57:16 +02:00
Sigurd Spieckermann
00e51bd94c
feat: add support for pre-update and post-update messages (#1288)
* feat: add support for pre-update and post-update messages

* test: use verbose regex syntax
2023-08-25 10:25:08 +01:00
Sigurd Spieckermann
a75066e34c docs: use autorefs for section references 2023-08-05 20:33:57 +02:00
Sigurd Spieckermann
1031601332 docs: use relative path to Markdown file for page linking 2023-07-19 13:48:49 +02:00
Sigurd Spieckermann
dc94486047 feat: add support for pre-copy and post-copy messages 2023-07-19 13:13:00 +02:00
Sigurd Spieckermann
9218e22807 fix: require default value for secret question 2023-07-19 05:53:26 +01:00
Sigurd Spieckermann
1e81fd5eca
feat: add support for computed values via skipped questions (#1220)
* feat: add support for computed values via skipped questions

* docs: apply review suggestions

Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>

* docs: update inline comments

* docs: fix formatting

---------

Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
2023-07-08 10:36:21 +00:00
Jairo Llopis
0c5a6ca2b4
docs: clarify how to use recopy to recover from broken updates
Docs were a bit repetitive and unclear.

Targets https://github.com/copier-org/copier/issues/1170. It could even fix it?

Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
2023-07-08 10:53:14 +02: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
Colin Marquardt
693d95896c Fix template vs destination folder mixup 2023-06-25 07:59:45 +01:00
Sigurd Spieckermann
1b351bc856 docs: update CLI usage examples to conform with v8
All CLI calls must use a subcommand as the first argument and all flags
must come after the subcommand. See #1143.
2023-06-15 17:17:05 +01:00
Sigurd Spieckermann
4cfe6f63dc feat: add OS identifier to render context 2023-06-14 16:19:40 +01: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
Zhiliang Wu
19474b1789 docs: fix jinja-extension link in faq 2023-05-30 19:33:06 +01:00
Jairo Llopis
070527e9b7 docs: clarify new update and overwrite behaviors 2023-05-30 07:34:22 +01:00
Sigurd Spieckermann
6e3a11ee2a docs: add reference to jinja2-jsonschema extension 2023-05-18 15:55:54 +01:00
Sigurd Spieckermann
e829bb5d2d docs: replace run_auto() by run_copy() 2023-05-18 11:30:12 +01:00
Jairo Llopis
2c5ff9e9b7 refactor(update): default to inline markers and 3 lines of context
Now that the inline mode is out of experimental, it turns out to provide a better default behavior than the good old rej mode. Mostly when context is increased to 3 lines or more.

BREAKING CHANGE: The default update conflict mode is now `inline` instead of `rej`.

BREAKING CHANGE: By default, updates now consider 3 lines of context instead of just 1.
2023-05-17 11:56:13 +01:00
Jairo Llopis
6996b9cc7a feat: add recopy command and function
This new command allows to reapply a template, keeping old answers but discarding subproject evolution.

It is useful when there are bugs replaying an old version of the template, or when the subproject has drifted too much from the template and you need to reset it.

BREAKING CHANGE: All CLI calls to Copier must now include the subcommand as the 1st argument. For example, `copier` must become now `copier update`; also `copier ./tpl ./dst` must become `copier copy ./tpl ./dst`.

BREAKING CHANGE: All flags must go after the subcommand now. For example, `copier -r HEAD update ./dst` must now become `copier update -r HEAD ./dst` or `copier update ./dst -r HEAD`.

BREAKING CHANGE: Automatic mode removed. Since now subcommands are required, the automatic mode is removed.

BREAKING CHANGE: Deprecated `copier.copy` function is removed. Use `copier.run_copy`, `copier.run_update` or `copier.run_recopy` explicitly as needed.

Fix https://github.com/copier-org/copier/issues/1081
Close https://github.com/copier-org/copier/issues/1082
2023-05-17 11:56:13 +01:00
Mitch Negus
c79482580e
docs: fix filesystem view to match text (and homepage) (#1136) 2023-05-14 07:19:03 +00:00
Sigurd Spieckermann
f6f37ab4fb
feat: support conditional choices (#1010)
Choices can now be validated with a custom inline jinja template.

Disabled choices won't be selectable, and they display a message telling why.
2023-05-04 09:13:18 +01:00
Jairo Llopis
09cc9953d1
docs: clarify what's invoke
Fix https://github.com/copier-org/copier/issues/1095.
2023-04-19 17:42:48 +01:00
Jairo Llopis
1709d677ee feat: customizable update accuracy
Until today, the updatediff algorithm always used just 1 line of context when detecting conflicts. This was because:

- Solving conflicts wasn't very ergonomic with those `.rej` files around.
- More lines meant too many conflicts usually.

However, it made the diff detection less accurate.

With this change, we allow the users to configure that algorithm. Since they have now the `--context inline` option, more conflicts isn't so much of a problem.

@moduon MT-2638
2023-04-17 12:59:28 +01:00
Sigurd Spieckermann
c0e356bf28 docs(configuring): fix typo 2023-04-17 12:56:27 +01:00
Nils de Bruin
4ecd0ce6c6 Update configuring.md
Changed ' to " as the statement dit not work
2023-04-17 12:53:08 +01:00
Jairo Llopis
689dd8bbb0 docs: explain how to leverage nix with docker
Many folks are not very comfortable with nix yet, so let's document how they can use it in their pipelines with more widely-known tools such as Docker and Podman.

Fixes https://github.com/copier-org/copier/issues/457.
2023-04-07 17:13:39 +01:00
Jairo Llopis
e34bcda48b fix: include dirty local changes when copying HEAD
This was the intended and documented behavior, but at some point it got broken.

Well, now it's tested and it works.

Besides, there's a new FAQ to avoid further surprises.

Fixes https://github.com/copier-org/copier/issues/787
2023-04-07 11:55:59 +01:00
Sigurd Spieckermann
065d6ba1d0
fix: require answer for questions without default value (#958)
When questions didn't have a default answer, the interactive behavior was confusing.

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

BREAKING CHANGE: All default answers must be explicit now.
2023-04-07 08:09:27 +01:00
Adrian Freund
0f610be801
feat: support preserving symlinks when copying templates (#938)
* feat: Preserve symlinks when copying templates

* test: Add tests for symlink copying
2023-04-07 08:03:17 +01:00
Sigurd Spieckermann
a230e4f4d6
docs: add advice on detecting Git repos (#1046) 2023-04-06 06:42:52 +01:00
Sigurd Spieckermann
266139bff4
feat: allow imports in inline templates (#986)
* feat: import Jinja templates/macros relative to template root

* feat: add `joinpath()` function to Jinja globals

* fix: use POSIX paths for Jinja imports/includes

* docs: fix `copier.yml` examples
2023-04-02 15:37:40 +00:00
Sigurd Spieckermann
474be856c1
docs: use tree fence for filesystem trees (#998)
* docs: use tree fence for filesystem trees

* docs: remove dashed lines in filesystem tree
2023-02-25 07:23:14 +00:00
Sigurd Spieckermann
c9e9c100ec fix(cli): use --conflict flag only in copier update subcommand 2023-02-21 21:21:01 +00:00
Sigurd Spieckermann
881a27e48a docs: fix filesystem tree 2023-02-20 19:45:19 +00:00
Jairo Llopis
0f517212eb docs: clarify that you can use copier on preexisting projects
Fix https://github.com/copier-org/copier/issues/955.
2023-02-16 07:20:25 +00:00
Sigurd Spieckermann
6c02cb0a41
feat: exclude nothing by default when using subdirectory 2023-02-02 11:23:56 +00:00