Skip to content

Commit 04ff298

Browse files
committed
linting
1 parent 237aa07 commit 04ff298

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

hephaestus/common/constants.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
class AnsiColors:
2+
"""ANSI escape codes representing various colors."""
3+
24
CYAN = "\033[36m"
35
GREEN = "\033[32m"
46
RED = "\033[31m"
57
YELLOW = "\033[33m"
68
MAGENTA = "\033[35m"
79
RESET = "\033[0m"
810

11+
12+
class CharConsts:
13+
"""Common characters."""
14+
15+
NULL = ""
16+
SPACE = " "
17+
UNDERSCORE = "_"
18+
19+
920
class StrConsts:
10-
EMPTY_STRING = ""
11-
21+
"""Common strings."""
22+
23+
EMPTY_STRING = CharConsts.NULL
24+
25+
1226
class Emojis:
13-
pass
14-
27+
"""Common graphical symbols that represent various states or ideas."""
28+
29+
GREEN_CHECK = "✅"
30+
RED_CROSS = "❌"
31+
GOLD_MEDAL = "🏅"

hephaestus/io/subprocess.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,14 @@ def command_successful(cmd: list[Any], cleanup: Callable = None):
112112
# Execute cleanup on most exceptions, if available.
113113
except Exception as e:
114114
success = False
115-
115+
116116
if cleanup:
117117
cleanup()
118118

119119
# Panic
120120
if not isinstance(e, _SubprocessError):
121-
raise
121+
raise
122122

123-
124123
return success
125124

126125

hephaestus/testing/pytest/fixtures/logging.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from pathlib import Path
77

88
import hephaestus.testing.swte as swte
9+
from hephaestus.common.constants import CharConsts
910
from hephaestus.io.logging import get_logger
1011

1112

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

2526
module_logger = get_logger(name=logger_name)
26-
swte.large_banner(request.module.__name__.upper().replace("_", " "))
27+
swte.large_banner(
28+
request.module.__name__.upper().replace(CharConsts.UNDERSCORE, CharConsts.SPACE)
29+
)
2730
yield module_logger
2831

2932

hephaestus/tests/decorators/test_track.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import pytest
2-
31
import hephaestus.testing.swte as swte
42
from hephaestus.decorators.track import TraceQueue, track
53

0 commit comments

Comments
 (0)