-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use standalone TraverserVisitor to use compiled mypy version (#5)
- Loading branch information
Showing
8 changed files
with
1,420 additions
and
51 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
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,43 @@ | ||
"""ANSI colors utils.""" | ||
|
||
|
||
from enum import Enum | ||
|
||
|
||
class Color(Enum): | ||
"""ANSI color codes.""" | ||
|
||
black = 0 | ||
red = 1 | ||
green = 2 | ||
yellow = 3 | ||
blue = 4 | ||
purple = 5 | ||
cyan = 6 | ||
white = 7 | ||
|
||
|
||
def bg(color: Color, text: str) -> str: | ||
"""Add background color to the text. | ||
Args: | ||
color: Color of the background. | ||
text: Text to color. | ||
Returns: | ||
Text wrapped with ANSI background color and color reset. | ||
""" | ||
return f'\x1b[4{color.value}m{text}\x1b[0m' | ||
|
||
|
||
def fg(color: Color, text: str) -> str: | ||
"""Add foreground color to the text. | ||
Args: | ||
color: Color of the foreground. | ||
text: Text to color. | ||
Returns: | ||
Text wrapped with ANSI foreground color and color reset. | ||
""" | ||
return f'\x1b[3{color.value}m{text}\x1b[0m' |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
"""This package contains the workarounds to use some internal mypy features.""" |
Oops, something went wrong.