-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
feat(settings): add user settings support with defaults
values and trusts
#1940
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1940 +/- ##
==========================================
+ Coverage 97.85% 98.05% +0.20%
==========================================
Files 51 53 +2
Lines 5404 5511 +107
==========================================
+ Hits 5288 5404 +116
+ Misses 116 107 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Very nice! I like the prefix matching approach for trusted repositories, it's simple and it makes sense.
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.
Fantastic work, @noirbizarre! 🎉 Thanks for working on and contributing these valuable features! 🙏
I have a few minor remarks. And would you mind fixing the formatting errors in the corresponding commit and drop the auto-fix commit? We'll likely want to rebase-merge this PR to keep the two feature commits, so the auto-fix commit would only add some noise to the Git history.
You're welcome ! 🙏🏼 |
ac3b856
to
f8a881c
Compare
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.
Just a few more comments after another review iteration. 🙂
211835d
to
c07fa2f
Compare
PR rebased to solve lock conflict |
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.
👌
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.
Just some final polishing requests from my side. With two independent commits in a PR, we need to be extra careful to associate a change with the right commit. For instance, we have a formatting change in the first commit and the inverse change in the second commit, so there's no diff for this section under Files changed
but there is a diff in each commit.
c07fa2f
to
52a5b0a
Compare
Updated 👍🏼 |
df246e5
to
6547b51
Compare
6547b51
to
a5f76f6
Compare
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.
Thank you very much again for this great PR and your patience with the review cycles, @noirbizarre! 🙏
I think we can merge this PR, only one tiny cosmetic detail I just stumbled over 🫣: Could you fix the second commit message?
-feat(settings): allows to defined some trusted repositories or prefixes
+feat(settings): allow to define some trusted repositories or prefixes
a5f76f6
to
fbd4021
Compare
No problem, there it is, fixed. (Sorry, I do many typos currently 😅) |
No worries, thanks again for your efforts and patience! |
Hello 👋🏼
This PR adds support for user settings with initial support for:
Settings are stored in
<CONFIG_ROOT>/settings.yml
where<CONFIG_ROOT>
is thestandard configuration directory for your platform:
$XDG_CONFIG_HOME/copier
(~/.config/copier
in most cases) on Linux as defined byXDG Base Directory Specifications
~/Library/Application Support/copier
on macOS as defined byApple File System Basics
%USERPROFILE%\AppData\Local\copier
on Windows as defined inKnown folders
This location can be overridden by setting the
COPIER_SETTINGS
environment variable.The settings look like: