113 Commits

Author SHA1 Message Date
Jairo Llopis
1ac529ad5a docs: missing bullet point 2022-12-19 19:18:32 +00:00
Mark van Holsteijn
2c6e2b711f docs: add regex validator example
as requested in 
https://github.com/copier-org/copier/discussions/892
2022-12-19 19:18:32 +00:00
Barry Hart
504301c28e
feat: experimental inline conflict markers when updating
Fixes #613 

Based on #627, but:

* Supports both old (`.rej` files) and new (inline markers) conflict behavior

* Update a test to test both rej and inline conflict resolution

* Update some tests to explicitly specify "rej" conflict mode

* Add documentation for the two conflict modes

* keeping only 3-way merge

Co-authored-by: Oleh Prypin <oprypin@users.noreply.github.com>
Co-authored-by:
Thierry Guillemot <tguillemot@users.noreply.github.com>
Co-authored-by: Barry Hart <barry.hart@zoro.com>
Co-authored-by: Jairo Llopis <yajo.sk8@gmail.com>
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
2022-11-14 05:09:23 +00:00
Sigurd Spieckermann
6f2749f165 docs: fix invalid anchor link 2022-11-11 16:32:34 +00:00
Timothée Mazzucotelli
b88cc97fc1 docs: Add missing dash in CLI flag docs 2022-11-07 18:47:40 +00:00
Sigurd Spieckermann
6f6208be9a docs: improve section on including other YAML files 2022-10-28 14:25:51 +00:00
Sascha Desch
12bd54239c docs: add rules for merging of multiple documents 2022-10-27 08:37:39 +01:00
Jairo Llopis
8cb181aa5e
docs: don't lie
Fix #838 by not saying tasks can be overridden by API. It's not true.
2022-10-09 07:32:48 +01:00
Sigurd Spieckermann
1f40ddaac2 docs: replace default argument value N/A by [] for lists 2022-10-03 20:46:46 +01:00
Sigurd Spieckermann
2f714559e6 docs: use empty list as default value
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
2022-09-30 05:12:34 +01:00
Sigurd Spieckermann
171293a0fe docs: add _secret_questions setting 2022-09-30 05:12:34 +01:00
Sigurd Spieckermann
bd766ba7c5 docs: unify YAML code block indentation 2022-09-24 13:07:57 +01:00
Sigurd Spieckermann
a3ded92e9d docs: fix migrations config indentation 2022-09-12 17:56:03 +01:00
Sigurd Spieckermann
e682269cd5 docs: unify shell code blocks 2022-09-09 16:05:20 +01:00
Sigurd Spieckermann
befe8c5ea5 docs: always use ordered list marker "1." 2022-09-09 16:04:20 +01:00
Sigurd Spieckermann
5a6d930a45 docs: update Jinja2 docs URL to v3.1.x 2022-08-28 09:18:17 +01:00
Sigurd Spieckermann
fc6bb03a6d docs: fix spelling 2022-08-26 09:47:49 +01:00
Talley Lambert
6fcd7e02b8
feat: add validator field to Question (#719)
* docs: add note to docstring

* feat: print spawn logs on failure, and fix failure in test

The test was failing because it turns out that `tui` won't print letters that must not change, when running an interactive TUI.

I changed the error message for something that will force all letters to change. This way it works as expected.

Co-authored-by: Jairo Llopis <yajo.sk8@gmail.com>
2022-08-06 15:48:21 +00:00
StefanBRas
930a0c0787 Update configuring.md
Correctly format yaml codeblock.
2022-08-02 14:24:43 +02:00
Ludovico Bianchi
1efb213dc0 docs: use gender-neutral pronouns to refer to user 2022-07-30 07:37:17 +01:00
Jairo Llopis
e93fa227b9
docs: fix choice instructions
In copier 5 they had to type 1 or 2, but now it's interactive.
2022-06-12 09:34:23 +01:00
Paul Moore
05c5f09034
feat: simplify the format of the question prompt (#689)
Closes https://github.com/copier-org/copier/issues/674
2022-06-04 11:02:37 +00:00
Jairo Llopis
c16b0b8a7b
docs: skip_if_exists must be a list 2022-05-25 07:44:40 +01:00
Kian-Meng Ang
4684c78b5b Fix typos 2022-05-03 11:54:59 +08:00
Timothée Mazzucotelli
945238bdf6
docs: Document the context hook extension (#641)
Co-authored-by: Tom Verdaat <66591885+verdaatt@users.noreply.github.com>
2022-04-24 14:31:42 +01:00
Andrew Leech
e5dfa08c16 feat: Add jinja variable "_copier_python" to get sys.executable. 2022-03-22 17:25:44 +00:00
Yajo
8156846a35 docs(subdirectory): explain how to use subdirectory to host multiple templates in a single git repository
Also explain why it's a bad idea.

Fixes https://github.com/copier-org/copier/issues/578
2022-03-06 10:16:28 +00:00
Yajo
79e7622926 docs: clarify that answers file path must be relative to project root
This was already explained when running `copier --help`, but it still caused some confusion on users.

Fixes https://github.com/copier-org/copier/issues/579
2022-02-27 11:42:14 +00:00
Jairo Llopis
af0dbac4ab fix: correct default for skipped questions
A skipped question was not saved by Questionary, so I need to check if the answer is exactly like the question and, in that case, re-render it again.

Docs clarified to avoid false expectations on what should be the answer.

Fixes https://github.com/copier-org/copier/issues/529
2022-02-26 10:03:05 +00:00
Ben Yang
b255de2e34 Update configuring.md "Conditional files" section
Use the correct default syntax of `{%`, instead of `{{`.
2022-01-29 20:34:18 +00:00
Yajo
1dc3a1bbce docs: fix some errors and lies, change colors
Old color palette wasn't easy to read in the dark.

New one is more readable and fits better with our logo.
2022-01-13 21:35:11 +01:00
Timothée Mazzucotelli
1afbae1181 docs: Add titles to code blocks where relevant 2022-01-13 21:35:11 +01:00
Timothée Mazzucotelli
616829db75 docs: Add native Jinja2 extensions 2022-01-13 21:35:11 +01:00
Timothée Mazzucotelli
3164f208e2 docs: Document condition files and directories 2022-01-13 21:35:11 +01:00
Timothée Mazzucotelli
77e3e53c4b refactor: Remove json method from Copier conf 2021-12-20 14:50:20 +00:00
Jairo Llopis
745a490415
fix: always compare versions as PEP440 strings (#434)
In migration scripts, environment variables `$VERSION_FROM`, `$VERSION_CURRENT` and `$VERSION_TO` didn't always get a valid PEP440 version identifier, but the tag. Now we add the PEP440 variants of those variables, autogenerated with dunamai, and these are used instead to sort the versions. This will help comparing template evolution when doing a checkout to an untagged version, or when you happen to add a tag without `v` when the previous one had it. If you want to get the exact commit or version, you can still use the old variables in your scripts, so no backwards incompatibility is introduced. It should remove some false negatives when comparing those version strings.

Fixes https://github.com/copier-org/copier/issues/269.
2021-11-01 08:28:58 +00:00
Timo Furrer
5ab752c11f
feat: keep trailing newlines for Jinja templates by default (#465)
Closes #464
2021-10-31 07:28:43 +00:00
Timothée Mazzucotelli
b3860dd274
fix: Fix unicode error on binary files (#436)
* fix: Fix unicode error on binary files

If a unicode decode error is raised
while trying to compile a file as a Jinja2 template,
and the templates suffix is empty,
we fallback to copying this file as is.

Fixes #433.
2021-08-03 17:19:04 +01:00
Dennis Roche
cfb9ec3bbc feat: Add additional flags for using default questions or overwriting files 2021-07-02 15:34:51 +01:00
Timothée Mazzucotelli
8bed0441a9 docs: Fix typo 2021-06-28 13:31:37 +01:00
Jairo Llopis
20c151e9f4 fix!: only support explicit types for multi-type choice questions
- Inform about `null` value being converted to choice key.
- Warn about problems when using multiple types in choices.

Fixes https://github.com/copier-org/copier/issues/405.
2021-05-21 16:54:30 +01:00
Timothée Mazzucotelli
23f5695a96 feat: Handle empty templates suffix 2021-05-17 13:29:13 +01:00
Jairo Llopis
2a944bf736 docs: update with latest changes
🤦‍♂️ it seems I forgot to document a lot of changes.
2021-04-20 07:21:36 +01:00
Jairo Llopis
bd29342502 docs: update questionary configuration
All those new things were not documented... 🤦‍♂️

Fix https://github.com/copier-org/copier/issues/297
2021-04-17 09:53:12 +01:00
Yajo
bbdbeb86c3 build: better gitpod and vscode UX
These days, Gitpod supports VSCode workspaces instead of only Theia.

Theia understands settings under `.vscode` as well as under `.theia`, but VSCode only understands settings under `.vscode`. Thus, it seems reasonable to move settings to that new location and then provide a good UX on both local VSCode and Gitpod's.

I also install new tools such as commitizen.

The goal is that just clicking on Gitpod badge, you have a full dev environment ready to hack.
2021-04-15 17:46:24 +01:00
Timothée Mazzucotelli
b3886a3730 docs: Add copier-templates-extensions in the extensions list 2021-04-05 13:05:42 +01:00
Timothée Mazzucotelli
bd83f15bd6
feat: Add extensions option allowing to load additional Jinja2 extensions (#370)
Co-authored-by: Jairo Llopis <Yajo@users.noreply.github.com>
2021-03-27 22:07:56 +00:00
Jairo Llopis
a9f3523b4e
docs 2021-03-14 08:04:20 +00:00
Jairo Llopis
0441b86f0c
Refactor (#314)
* Refactor
* Fix #110.
* Rewrite test_config_exclude, test_config_exclude_overridden and test_config_include. These tests were badly designed, using a monkeypatch that would never happen in the real world, and actually producing false positives. I moved them to test_exclude.py and rewritten to test the what and not the how.
* Fix #214 by removing skip option. Relevant tests use the better skip_if_exists=["**"].
* Remove subdirectory flag from API/CLI. It was confusing and could lead to bad maintenance situations. Fixes #315.
* Remove extra_paths and fix #321
* Remember that you cannot use _copier_conf.src_path as a path now
* use dataclasses
* Create errors module, simplify some tests, fix many others
* Fix some tests, complete EnvOps removal
* Fix #214 and some tests related to it
* Reorder code
* Update docs and imports
* Modularize test_complex_questions
* Interlink worker and questionary a bit better
* Removal of Questionary class, which only had 1 meaningful method that is now merged into Worker to avoid circular dependencies.
* Fix #280 in a simple way: only user answers are type-casted inside API, and CLI transforms all `--data` using YAML always. Predictable.
* Use prereleases correctly.
* Reorder AnswersMap to have a more significative repr.
* Simpler cache for old `Question.get_choices()` method (renamed now).
* fix wrong test
* Fix test_subdirectory
* Fix test_tasks (and remove tests/demo_tasks)
* Fix path filter tests, and move it to test_exclude, where it belongs
* Make test_config pass
* Fix more wrongly designed tests
* Use cached_property backport if needed
* xfail test known to fail on mac
* force posix paths on windows
* Add typing_extensions for python < 3.8
* Sort dependencies in pyproject.toml
* Support python 3.6 str-to-datetime conversion
* Workaround https://bugs.python.org/issue43095
* xfail test_path_filter on windows
* Upgrade mkdocs and other dependencies to fix https://github.com/pawamoy/mkdocstrings/issues/222
* Add missing reference docs.
* Add workaround for https://github.com/pawamoy/mkdocstrings/pull/209
* Docs.
* Remove validators module
* Add workaround for https://github.com/pawamoy/mkdocstrings/issues/225
* Restore docs autorefs as explained in https://github.com/pawamoy/mkdocstrings/issues/226#issuecomment-775413562.
* Workaround https://github.com/pawamoy/pytkdocs/issues/86
2021-02-09 18:22:47 +00:00
Robin Schneider
07a66f793e Fix docs: Short version of --pretend is -n not -q 2021-01-28 08:33:34 +00:00