copier icon indicating copy to clipboard operation
copier copied to clipboard

Skip validation flag

Open msharp9 opened this issue 1 year ago • 2 comments

Actual Situation

I have some copier templates that have validators on questions. Sometimes when developing, testing, etc, I might have answers I'm exploring that I'd like to use that don't meet the validator. For example, maybe there's a regex validator on the project's name to enforce a certain style, but I would like it to just accept whatever answer I give it, and ignore the validation.

A similar example in git, when working on a repo, your current code might not pass the pre-commit validation, but you want to commit and push to share and get help to solve the problem. You can pass a --no-verify flag to the git commit command to go ahead and prepare and push the dirty repo anyways.

Desired Situation

It would be nice if I could just bypass validations. If I own the template I can just comment out the validators when developing, but if I don't own it, it would require forking the template.

Proposed solution

I would like a similar --no-verify flag option when running copier copy and copier update that just ignores all validations.

msharp9 avatar Aug 22 '24 20:08 msharp9

I personally don't have the need for this feature (yet), but I'd be open to adding this feature to Copier. What about the other @copier-org/maintainers?

sisp avatar Aug 23 '24 10:08 sisp

Sure, why not :slightly_smiling_face: Should the validation still run but not let it pass, or should it be disabled entirely (not even running)? I'd vote for the former, so the user at least has a message saying the value didn't validate. But no strong opinion.

pawamoy avatar Aug 23 '24 12:08 pawamoy

For my specific use case, I'm overriding the validation because I already know why it's going to fail. I don't need a warning, but I wouldn't mind a warning either.

msharp9 avatar Aug 30 '24 04:08 msharp9

I don't think this is a good idea. Validators are there for some reason, and if you are developing the template and want to skip them, can't you just comment out that line and keep coding? Otherwise, you let all users to skip validations, not only template developers. And that makes validators useless after all.

Closing optimistically, but feel free to reopen or continue discussing if you want 😊

yajo avatar Sep 02 '24 09:09 yajo