-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn when zero-prefixed numbers are used
Resolves #25
- Loading branch information
Showing
7 changed files
with
71 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
LINES = None | ||
|
||
|
||
# ANSI color codes (https://stackoverflow.com/questions/4842424/) | ||
# When the --no-color flag is specified, these constants are set to the empty | ||
# string, so they can be used unconditionally in your code but will still obey | ||
# the flag value. | ||
|
||
|
||
def _make_ansi(*params): | ||
return "\033[" + ";".join(map(str, params)) + "m" | ||
|
||
|
||
ANSI_RED_BOLD = _make_ansi(31, 1) | ||
ANSI_MAGENTA_BOLD = _make_ansi(35, 1) | ||
ANSI_RESET = _make_ansi(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from hera.config import _make_ansi | ||
|
||
|
||
def test_make_ansi_red(): | ||
assert _make_ansi(31, 1) == "\033[31;1m" | ||
|
||
|
||
def test_make_ansi_reset(): | ||
assert _make_ansi(0) == "\033[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters