-
Notifications
You must be signed in to change notification settings - Fork 97
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
Hello world 🖖 #2
Conversation
52cf2ae
to
d00fd36
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.
BTW @sbidoul please mark the pre-commit and test workflows as required to merge. That's done in the branch protection rules. Do it for master please. Thanks!
Support only v13 for now. Includes instructions and CI.
Done |
git commit -am 'Updated from template' | ||
# Reformat all other files, in case some pre-commit configuration was updated | ||
pre-commit run -a || git commit -am 'Reformatted after template update' | ||
``` |
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.
To have the possibility to apply this massively to all repos on the 13.0 branch, I think we need a mechanism to opt-out the generation of .travis.yml
and README.md
. For the other files it should be ok.
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.
Yes, you can add --skip
to your copier invocation. That's supported.
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.
That'd be --exclude
? I tested that with --exclude README.md --exclude .travis.yml
but the it started overwriting my .git
directory.
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.
--skip
skips the file only if it is present, while --exclude
totally ignores it. --skip
would apply in this case.
Also when there is any kind of diff, if ran interactively, copier asks you if you want to skip a file. However --skip
is still useful to script it.
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.
If I read well --skip
applies to all files? So how to update, say .pre-commit-config.yaml
while not updating .travis.yml
?
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.
Well, never had to do that, but if I'm not wrong, this should work:
copier --skip "**" --skip "!.pre-commit-config.yaml" -f
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.
@yajo At least in the released version of copier that I pipx installed, --skip
does not take arguments. Is it something new?
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.
Humm sorry I was mistaken 🙊
I was confusing it with the skip_if_exists
option, which is only available through API right now.
Gonna open some issues and work on that.
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.
Opened copier-org/copier#214 and copier-org/copier#215
All should be resolved now, except the points that are unresolved. 🥳 http://instantrimshot.com/ |
Looks promising. Thanks for this work! I unresolved the skip/exclude thing, though. It's unclear to me how that would work. |
Yes, exclude is: Copier, forget about this. Skip is: Copier, if this file exists in the destination, forget about it. So, your use case is skip. |
AFAICS, if you want to automate this stuff, the best you can do is use python itself: from copier import copy
copy(src, dst, force=True, ...) I think we can merge this. This could evolve progressively, but this seems good enough as a starting point. WDYT @sbidoul? |
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.
Yes, LGTM as a good starting point, thanks!
Do you want to squash the commits?
Then we can remove the sample files from MQT, and add a pointer to this project.
Not sure if there are some published documents to update too.
OK, squashing then. I think all related changes are in MQT.... 🤔 I mean that no other documents AFAIK would relate to this. |
PR from same repo, to develop CI.
This closes #1.