Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use standalone TraverserVisitor to use compiled mypy version #5

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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