feature: remove file parameter on status report

This commit is contained in:
jt
2026-09-21 13:37:05 -03:00
parent c194b555c3
commit d7f2e569da
2 changed files with 17 additions and 22 deletions
+17 -20
View File
@@ -1,26 +1,24 @@
import sys
from os.path import isfile
import questionary
import rich
import rich.panel
from git_flow import (
BRANCH_TYPES,
REPOSITORY_TOKEN_FILENAME,
COMMIT_TYPES,
FLOWCONFIG_FILENAME,
FLOWCONFIG_VERSION,
COMMIT_TYPES,
REPOSITORY_TOKEN_FILENAME,
GitFlowError,
)
from git_flow.git import Git
from git_flow.io import *
from git_flow.remote.base import RemoteAPI
from git_flow.remote.bitbucket import BitbucketRemoteAPI
from git_flow.remote.github import GithubRemoteAPI
from git_flow.remote.gitea import GiteaRemoteAPI
from git_flow.remote.github import GithubRemoteAPI
from git_flow.remote.gitlab import GitlabRemoteAPI
from git_flow.io import *
from os.path import isfile
from typing import Optional
import rich
import rich.panel
import questionary
flowconfig = Git.get_config(FLOWCONFIG_FILENAME) if isfile(FLOWCONFIG_FILENAME) else {}
environments = (
@@ -104,7 +102,7 @@ def ensure_clean_worktree(has_remote: bool):
if not status:
return
not_empty = any(map(lambda s: s.index != " " or s.worktree != " ", status))
not_empty = any(s.index != " " or s.worktree != " " for s in status)
if not_empty:
if not has_remote:
@@ -164,23 +162,23 @@ def get_commit_message(commit_types: list[str] = COMMIT_TYPES) -> str:
return commit_type + ": " + commit_message
def io_error(message: str, title: Optional[str] = None):
_io_status(message, "✖ Error: ", "red", title, file=sys.stderr)
def io_error(message: str, title: str | None = None):
_io_status(message, "✖ Error: ", "red", title)
def io_warning(message: str, title: Optional[str] = None):
def io_warning(message: str, title: str | None = None):
_io_status(message, "⚠ Warning: ", "yellow", title)
def io_info(message: str, title: Optional[str] = None):
def io_info(message: str, title: str | None = None):
_io_status(message, "ℹ Info: ", "blue", title)
def io_success(message: str, title: Optional[str] = None):
def io_success(message: str, title: str | None = None):
_io_status(message, "✔ Success: ", "green", title)
def _io_status(message: str, prefix: str, style: str, title: Optional[str] = None, file=None):
def _io_status(message: str, prefix: str, style: str, title: str | None = None):
if title:
rich.print(
rich.panel.Panel(
@@ -189,8 +187,7 @@ def _io_status(message: str, prefix: str, style: str, title: Optional[str] = Non
style=style,
expand=False,
title_align="left",
),
file=file
)
)
else:
rich.print(f"[{style}]{prefix}{message}[/{style}]")