Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def add_git_and_hook_actions(
self, new_version: str, git_bumper: GitBumper, hooks_runner: HooksRunner
) -> None:
before_hooks = ActionGroup(
"Would run these hooks before commit",
"Running hooks before commit",
hooks_runner.get_before_hooks(new_version),
should_enumerate=True,
)
self.work.append(before_hooks)
git_commands = ActionGroup(
"Would run these git commands",
"Making bump commit and push matching tag",
git_bumper.get_commands(new_version),
)
self.work.append(git_commands)
after_hooks = ActionGroup(
"Would run these hooks after push",
"Running hooks after push",
hooks_runner.get_after_hooks(new_version),
should_enumerate=True,
)
self.work.append(after_hooks)
before_hooks = ActionGroup(
"Would run these hooks before commit",
"Running hooks before commit",
hooks_runner.get_before_hooks(new_version),
should_enumerate=True,
)
self.work.append(before_hooks)
git_commands = ActionGroup(
"Would run these git commands",
"Making bump commit and push matching tag",
git_bumper.get_commands(new_version),
)
self.work.append(git_commands)
after_hooks = ActionGroup(
"Would run these hooks after push",
"Running hooks after push",
hooks_runner.get_after_hooks(new_version),
should_enumerate=True,
)
self.work.append(after_hooks)
def __init__(self, new_version: str, file_bumper: FileBumper):
self.new_version = new_version
self.work = [] # type: List[ActionGroup]
patches = ActionGroup(
"Would patch these files",
"Patching files",
file_bumper.get_patches(new_version),
)
self.work.append(patches)
def add_git_and_hook_actions(
self, new_version: str, git_bumper: GitBumper, hooks_runner: HooksRunner
) -> None:
before_hooks = ActionGroup(
"Would run these hooks before commit",
"Running hooks before commit",
hooks_runner.get_before_hooks(new_version),
should_enumerate=True,
)
self.work.append(before_hooks)
git_commands = ActionGroup(
"Would run these git commands",
"Making bump commit and push matching tag",
git_bumper.get_commands(new_version),
)
self.work.append(git_commands)
after_hooks = ActionGroup(
"Would run these hooks after push",