Skip to content

Commit

Permalink
Lint suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tycho Pandelaar committed Oct 9, 2023
1 parent 2769f93 commit 7e07966
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 2 additions & 9 deletions src/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ def _run_git_command(self, *args):
cwd=self.path
)

if result.returncode != 0:
# The git command failed.
# Log or handle the error message from `result.stderr`.
error_message = result.stderr.decode('utf-8').strip()
# Optionally: Log the error message if a logging system is utilized.
# Example: logging.error(f"Git command {' '.join(args)} failed: {error_message}")

return result.stdout.decode('utf-8').strip()

def _get_branch_name(self):
Expand Down Expand Up @@ -128,11 +121,11 @@ def _get_branch_details(self):
# Extract the number of changes in the staging environment.
try:
self.staging = len(status_output.splitlines()) - 1
except Exception as e:
except Exception:
self.staging = 0
# Optionally: log the error if a logging system is utilized.

except Exception as e:
except Exception:
# General error handling for any other unexpected issue.
self.ahead, self.behind, self.staging = 0, 0, 0
# Optionally: log the error if a logging system is utilized.
4 changes: 2 additions & 2 deletions src/repository_manager.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import sys
import time

from concurrent.futures import ThreadPoolExecutor, as_completed
from src.repository import GitRepo
from src.table import Table, TableRenderer, Cell, ANSI_BOLD_BRIGHT_WHITE, ANSI_WHITE, ANSI_RED, ANSI_GREEN, ANSI_CYAN, ANSI_PURPLE, ANSI_GREY, ANSI_BRIGHT_YELLOW
from src.table import Table, TableRenderer, Cell, ANSI_BOLD_BRIGHT_WHITE, ANSI_WHITE, ANSI_RED, ANSI_GREEN, ANSI_CYAN,
ANSI_PURPLE, ANSI_GREY


class GitRepoManager:
Expand Down

0 comments on commit 7e07966

Please sign in to comment.