In PR #15 incipyt should be called from an empty/non-existent folder, however it could be a too much restrictive requirement.
Actually this requirement ensures incipyt do not destroy anything, but maybe we can setup a more finer policy.
Let's consider three cases:
- Git: Just skip
git init if the folder is already under supervision ? Also skip git add ?
package folder: Just skip creation of the folder ? What about __init__.py if it doesn't exist ? Create or skip ?
setup.cfg: What to do ?
A quite easy and general way to do that is setup policy at tool level; three (condition, policy) -- one for each step, pre/add_to/post, policy being skip/fail -- if the condition is met, then the policy is apply. Is any of them is "fail", incipyt stops. Eventually with a superset policy being "do not overwrite any file".
A related question is, what we do if incipyt failed while some files have been written ? Delete or keep them in place ?
In PR #15
incipytshould be called from an empty/non-existent folder, however it could be a too much restrictive requirement.Actually this requirement ensures
incipytdo not destroy anything, but maybe we can setup a more finer policy.Let's consider three cases:
git initif the folder is already under supervision ? Also skipgit add?packagefolder: Just skip creation of the folder ? What about__init__.pyif it doesn't exist ? Create or skip ?setup.cfg: What to do ?A quite easy and general way to do that is setup policy at tool level; three
(condition, policy)-- one for each step, pre/add_to/post, policy being skip/fail -- if the condition is met, then the policy is apply. Is any of them is "fail",incipytstops. Eventually with a superset policy being "do not overwrite any file".A related question is, what we do if
incipytfailed while some files have been written ? Delete or keep them in place ?