Skip to content

Commit

Permalink
Use standalone TraverserVisitor to use compiled mypy version (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
butvinm authored Aug 20, 2024
1 parent cf2a63c commit 5135113
Show file tree
Hide file tree
Showing 8 changed files with 1,420 additions and 51 deletions.
2 changes: 1 addition & 1 deletion dora/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def main() -> None:

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

try:
for search_result in search(args.paths, args.type_expression):
Expand Down
43 changes: 43 additions & 0 deletions dora/ansi.py
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'
39 changes: 0 additions & 39 deletions dora/ansi_colors.py

This file was deleted.

1 change: 1 addition & 0 deletions dora/mypy_legacy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""This package contains the workarounds to use some internal mypy features."""
Loading

0 comments on commit 5135113

Please sign in to comment.