Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jasursadikov committed Sep 12, 2024
1 parent 297ce58 commit c33eb08
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,17 +377,25 @@ def _get_formatted_branches(branches: List[str], current_branch: str) -> str:

@staticmethod
def _get_branch_icon(branch_prefix: str) -> str:
return f'{utils.GLYPHS["bugfix"]}' if branch_prefix in ['bugfix', 'bug', 'hotfix'] else \
f'{utils.GLYPHS["release"]}' if branch_prefix == 'release' else \
f'{utils.GLYPHS["feature"]}' if branch_prefix in ['feature', 'feat', 'develop'] else \
f'{utils.GLYPHS["branch"]}'
if branch_prefix in ['bugfix', 'bug', 'hotfix']:
return utils.GLYPHS["bugfix"]
elif branch_prefix == 'release':
return utils.GLYPHS["release"]
elif branch_prefix in ['feature', 'feat', 'develop']:
return utils.GLYPHS["feature"]
else:
return utils.GLYPHS["branch"]

@staticmethod
def _get_branch_color(branch_name: str) -> str:
return RED if branch_name in ['bugfix', 'bug', 'hotfix'] else \
BLUE if branch_name == 'release' else \
GREEN if branch_name in ['feature', 'feat', 'develop'] else \
GREEN
if branch_name in ['bugfix', 'bug', 'hotfix']:
return RED
elif branch_name == 'release':
return BLUE
elif branch_name in ['feature', 'feat', 'develop']:
return GREEN
else:
return GREEN

@staticmethod
def _get_color_index(label: str) -> (str, str):
Expand Down

0 comments on commit c33eb08

Please sign in to comment.