-
-
Notifications
You must be signed in to change notification settings - Fork 211
docs: include full _copier_conf attributes list #2127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Here's the funny thing, I hadn't even noticed the introduction sentence with
until I went back and looked after I had found the |
Thanks for aspiring to improve the docs! 🙇 I agree that the render context isn't documented as well as it could be. There's only one concern I have with this addition: |
Hey @sisp, thanks for the review. If y'all are good with ensuring that the docs are just always in-sync, I'm absolutely happy to help copy over the data. Let me do a quick fix, and I'll let you give it another review 😊 |
@sisp I think this should be ready for a review now. Direct link to docs preview: https://copier--2127.org.readthedocs.build/en/2127/creating/#_copier_conf A few things that I adjusted (if you're OK with that)
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2127 +/- ##
=======================================
Coverage 98.03% 98.03%
=======================================
Files 55 55
Lines 6005 6005
=======================================
Hits 5887 5887
Misses 118 118
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@sisp Just checking if you're good with the changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for compiling the render context attributes table so meticulously! 🙇 I have a couple of suggestions regarding clarity, consistency, and style.
Seeing this table makes it much clearer (IMO) that the render context and Worker
class attributes are not the same and not even as similar as it seemed with the previous documentation. Clarifying the render context is crucial for providing template authors with the necessary information to create good templates. Thanks for taking on this important task! 🙇
@sisp awesome review, and definitely makes things clearer! I wonder...would it make sense to group setting attributes that are just sets of booleans, and then separate some of the more "in depth" attributes into their own group? |
I think it's fine to keep all attributes in one table. There, they are sorted alphabetically and references to related settings are provided where applicable. Having a complete overview of all I've noticed that the I stumbled over one more thing: The |
0d51bf8
to
3b1f596
Compare
49c34ec
to
ef463ce
Compare
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there. 😉
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
@sisp 2 questions/thoughts, looking at
|
| `src_path` | `Path` | The absolute path to the (cloned/downloaded) template on disk. | | ||
| `unsafe` | `bool` | When `True`, allow usage of unsafe templates.<br>See the [`unsafe`][] setting for related information. | | ||
| `use_prereleases` | `bool` | When `True`, `vcs_ref`/`vcs_ref_hash` may refer to a prerelease version of the template.<br>See the [`use_prereleases`][] setting for related information. | | ||
| `user_defaults` | `dict[str, Any]` | Specified user defaults that may override a template's defaults during question prompts. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we point to https://copier--2127.org.readthedocs.build/en/2127/settings/#user-defaults? What would that be, See the [User defaults][settings.user-defaults] setting for related information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_defaults
in the render context is a Worker
class attribute that can be passed via API only, but it's not the same as Settings.defaults
. It may make sense to document user_defaults
in docs/configuring.md
in a separate PR.
| `exclude` | `Sequence[str]` | Specified additional [file exclusion patterns][patterns-syntax].<br>See the [`exclude`][] setting for related information. | | ||
| `os` | <code>Literal["Linux", "macos", "windows"] | None</code> | The detected operating system, `None` if it could not be detected. | | ||
| `overwrite` | `bool` | When `True`, overwrite files that already exist, without asking.<br>See the [`overwrite`][] setting for related information. | | ||
| `pretend` | `bool` | When `True`, produce no real rendering.<br>See the [`pretend`][] setting for related information. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `pretend` | `bool` | When `True`, produce no real rendering.<br>See the [`pretend`][] setting for related information. | | |
| `pretend` | `bool` | When `True`, perform no real rendering.<br>See the [`pretend`][] setting for related information. | |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but we should synchronize the descriptions and the Worker
class attributes in a separate PR – wherever it makes sense.
| `dst_path` | `Path` | Destination path where to render the subproject.<br>⚠️ When [updating a project][updating-a-project], it may be a temporary directory, as Copier's update algorithm generates fresh copies using the old and new template versions in temporary locations. | | ||
| `exclude` | `Sequence[str]` | Specified additional [file exclusion patterns][patterns-syntax].<br>See the [`exclude`][] setting for related information. | | ||
| `os` | <code>Literal["Linux", "macos", "windows"] | None</code> | The detected operating system, `None` if it could not be detected. | | ||
| `overwrite` | `bool` | When `True`, overwrite files that already exist, without asking.<br>See the [`overwrite`][] setting for related information. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `overwrite` | `bool` | When `True`, overwrite files that already exist, without asking.<br>See the [`overwrite`][] setting for related information. | | |
| `overwrite` | `bool` | When `True`, overwrite files that already exist without asking.<br>See the [`overwrite`][] setting for related information. | |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but we should synchronize the descriptions and the Worker
class attributes in a separate PR – wherever it makes sense.
| `context_lines` | `PositiveInt` | Lines of context to consider when solving conflicts in updates.<br>See the [`context_lines`][] setting for related information. | | ||
| `data` | `dict[str, Any]` | Answers to the questionnaire, defined in the template, provided via CLI (`-d,--data`) or API (`data`).<br>See the [`data`][] setting for related information.<br>⚠️ May contain secret answers. | | ||
| `defaults` | `bool` | When `True`, use default answers to questions.<br>See the [`defaults`][] setting for related information. | | ||
| `dst_path` | `Path` | Destination path where to render the subproject.<br>⚠️ When [updating a project][updating-a-project], it may be a temporary directory, as Copier's update algorithm generates fresh copies using the old and new template versions in temporary locations. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `dst_path` | `Path` | Destination path where to render the subproject.<br>⚠️ When [updating a project][updating-a-project], it may be a temporary directory, as Copier's update algorithm generates fresh copies using the old and new template versions in temporary locations. | | |
| `dst_path` | `Path` | Destination path where to render the subproject.<br>⚠️ When [updating a project][updating-a-project], this may be a temporary directory, as Copier's update algorithm generates fresh copies using the old and new template versions in temporary locations. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but we should synchronize the descriptions and the Worker
class attributes in a separate PR – wherever it makes sense.
Ok, threw a few more "consistency" suggestions in here as well, WDYT? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why is
Linux
capitalized while the others are lowercase? Could/should that be normalized? 🤔 Likely a breaking change 😞
OMG, that's totally my error. I was typing on mobile and it seems typing correction capitalized it without me noticing. It should be lowercase of course. Thanks for catching this! 🥇
- Do you want to use
to keep everything on one-line? Would definitely make the column wider 😞 Not sure if you have a preference ¯\_(ツ)_/¯
It does look better without the line wrap, but then the description column might get squeezed too much. I'd say, your call. We can always change it later. Thanks for paying attention to such details though! 🙇
| `src_path` | `Path` | The absolute path to the (cloned/downloaded) template on disk. | | ||
| `unsafe` | `bool` | When `True`, allow usage of unsafe templates.<br>See the [`unsafe`][] setting for related information. | | ||
| `use_prereleases` | `bool` | When `True`, `vcs_ref`/`vcs_ref_hash` may refer to a prerelease version of the template.<br>See the [`use_prereleases`][] setting for related information. | | ||
| `user_defaults` | `dict[str, Any]` | Specified user defaults that may override a template's defaults during question prompts. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_defaults
in the render context is a Worker
class attribute that can be passed via API only, but it's not the same as Settings.defaults
. It may make sense to document user_defaults
in docs/configuring.md
in a separate PR.
| `exclude` | `Sequence[str]` | Specified additional [file exclusion patterns][patterns-syntax].<br>See the [`exclude`][] setting for related information. | | ||
| `os` | <code>Literal["Linux", "macos", "windows"] | None</code> | The detected operating system, `None` if it could not be detected. | | ||
| `overwrite` | `bool` | When `True`, overwrite files that already exist, without asking.<br>See the [`overwrite`][] setting for related information. | | ||
| `pretend` | `bool` | When `True`, produce no real rendering.<br>See the [`pretend`][] setting for related information. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but we should synchronize the descriptions and the Worker
class attributes in a separate PR – wherever it makes sense.
| `dst_path` | `Path` | Destination path where to render the subproject.<br>⚠️ When [updating a project][updating-a-project], it may be a temporary directory, as Copier's update algorithm generates fresh copies using the old and new template versions in temporary locations. | | ||
| `exclude` | `Sequence[str]` | Specified additional [file exclusion patterns][patterns-syntax].<br>See the [`exclude`][] setting for related information. | | ||
| `os` | <code>Literal["Linux", "macos", "windows"] | None</code> | The detected operating system, `None` if it could not be detected. | | ||
| `overwrite` | `bool` | When `True`, overwrite files that already exist, without asking.<br>See the [`overwrite`][] setting for related information. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but we should synchronize the descriptions and the Worker
class attributes in a separate PR – wherever it makes sense.
| `context_lines` | `PositiveInt` | Lines of context to consider when solving conflicts in updates.<br>See the [`context_lines`][] setting for related information. | | ||
| `data` | `dict[str, Any]` | Answers to the questionnaire, defined in the template, provided via CLI (`-d,--data`) or API (`data`).<br>See the [`data`][] setting for related information.<br>⚠️ May contain secret answers. | | ||
| `defaults` | `bool` | When `True`, use default answers to questions.<br>See the [`defaults`][] setting for related information. | | ||
| `dst_path` | `Path` | Destination path where to render the subproject.<br>⚠️ When [updating a project][updating-a-project], it may be a temporary directory, as Copier's update algorithm generates fresh copies using the old and new template versions in temporary locations. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but we should synchronize the descriptions and the Worker
class attributes in a separate PR – wherever it makes sense.
No description provided.