Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
KayDVC committed Jan 12, 2025
1 parent 237aa07 commit 04ff298
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
25 changes: 21 additions & 4 deletions hephaestus/common/constants.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
class AnsiColors:
"""ANSI escape codes representing various colors."""

CYAN = "\033[36m"
GREEN = "\033[32m"
RED = "\033[31m"
YELLOW = "\033[33m"
MAGENTA = "\033[35m"
RESET = "\033[0m"


class CharConsts:
"""Common characters."""

NULL = ""
SPACE = " "
UNDERSCORE = "_"


class StrConsts:
EMPTY_STRING = ""

"""Common strings."""

EMPTY_STRING = CharConsts.NULL


class Emojis:
pass

"""Common graphical symbols that represent various states or ideas."""

GREEN_CHECK = "✅"
RED_CROSS = "❌"
GOLD_MEDAL = "🏅"
5 changes: 2 additions & 3 deletions hephaestus/io/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,14 @@ def command_successful(cmd: list[Any], cleanup: Callable = None):
# Execute cleanup on most exceptions, if available.
except Exception as e:
success = False

if cleanup:
cleanup()

# Panic
if not isinstance(e, _SubprocessError):
raise
raise


return success


Expand Down
5 changes: 4 additions & 1 deletion hephaestus/testing/pytest/fixtures/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pathlib import Path

import hephaestus.testing.swte as swte
from hephaestus.common.constants import CharConsts
from hephaestus.io.logging import get_logger


Expand All @@ -23,7 +24,9 @@ def module_logger(request: _pytest.fixtures.SubRequest):
logger_name = str(module_path.with_suffix("")).replace(os.sep, ".")

module_logger = get_logger(name=logger_name)
swte.large_banner(request.module.__name__.upper().replace("_", " "))
swte.large_banner(
request.module.__name__.upper().replace(CharConsts.UNDERSCORE, CharConsts.SPACE)
)
yield module_logger


Expand Down
2 changes: 0 additions & 2 deletions hephaestus/tests/decorators/test_track.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

import hephaestus.testing.swte as swte
from hephaestus.decorators.track import TraceQueue, track

Expand Down

0 comments on commit 04ff298

Please sign in to comment.