Skip to content
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

Merged
merged 3 commits into from
May 20, 2020
Merged

Hello world 🖖 #2

merged 3 commits into from
May 20, 2020

Conversation

yajo
Copy link
Member

@yajo yajo commented May 19, 2020

PR from same repo, to develop CI.

This closes #1.

@yajo yajo mentioned this pull request May 19, 2020
@yajo yajo force-pushed the hello-world branch 2 times, most recently from 52cf2ae to d00fd36 Compare May 19, 2020 10:40
Copy link
Member Author

@yajo yajo left a 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.
@sbidoul
Copy link
Member

sbidoul commented May 19, 2020

mark the pre-commit and test workflows as required to merge

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'
```
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yajo
Copy link
Member Author

yajo commented May 19, 2020

All should be resolved now, except the points that are unresolved. 🥳 http://instantrimshot.com/

@sbidoul
Copy link
Member

sbidoul commented May 19, 2020

Looks promising. Thanks for this work!

I unresolved the skip/exclude thing, though. It's unclear to me how that would work.

@yajo
Copy link
Member Author

yajo commented May 19, 2020

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.

@yajo
Copy link
Member Author

yajo commented May 20, 2020

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?

Copy link
Member

@sbidoul sbidoul left a 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.

@yajo yajo merged commit bb49e36 into master May 20, 2020
@OCA-git-bot OCA-git-bot deleted the hello-world branch May 20, 2020 09:31
@yajo
Copy link
Member Author

yajo commented May 20, 2020

OK, squashing then.

I think all related changes are in MQT.... 🤔 I mean that no other documents AFAIK would relate to this.

@yajo yajo added this to the v0.1.0 milestone Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants