Skip to content

Commit 5135113

Browse files
authored
Use standalone TraverserVisitor to use compiled mypy version (#5)
1 parent cf2a63c commit 5135113

File tree

8 files changed

+1420
-51
lines changed

8 files changed

+1420
-51
lines changed

dora/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def main() -> None:
3333

3434
for path in args.paths:
3535
if not os.path.exists(path):
36-
parser.error(f'The path "{path}" does not exist.')
36+
parser.error('The path "{path}" does not exist.'.format(path=path))
3737

3838
try:
3939
for search_result in search(args.paths, args.type_expression):

dora/ansi.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""ANSI colors utils."""
2+
3+
4+
from enum import Enum
5+
6+
7+
class Color(Enum):
8+
"""ANSI color codes."""
9+
10+
black = 0
11+
red = 1
12+
green = 2
13+
yellow = 3
14+
blue = 4
15+
purple = 5
16+
cyan = 6
17+
white = 7
18+
19+
20+
def bg(color: Color, text: str) -> str:
21+
"""Add background color to the text.
22+
23+
Args:
24+
color: Color of the background.
25+
text: Text to color.
26+
27+
Returns:
28+
Text wrapped with ANSI background color and color reset.
29+
"""
30+
return f'\x1b[4{color.value}m{text}\x1b[0m'
31+
32+
33+
def fg(color: Color, text: str) -> str:
34+
"""Add foreground color to the text.
35+
36+
Args:
37+
color: Color of the foreground.
38+
text: Text to color.
39+
40+
Returns:
41+
Text wrapped with ANSI foreground color and color reset.
42+
"""
43+
return f'\x1b[3{color.value}m{text}\x1b[0m'

dora/ansi_colors.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

dora/mypy_legacy/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""This package contains the workarounds to use some internal mypy features."""

0 commit comments

Comments
 (0)