Skip to content

Commit

Permalink
Fix MyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanderleek committed Mar 23, 2024
1 parent 0a17c3a commit c453d7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ jobs:
steps:
- name: 'Checkout sources'
uses: actions/checkout@v2
- name: 'Format code with black'
run: |
pip install black
black .
- name: 'Lint code with Ruff'
run: |
pip install ruff
Expand All @@ -23,6 +19,10 @@ jobs:
run: |
pip install mypy
mypy --ignore-missing-imports codelimit/
- name: 'Format code with black'
run: |
pip install black
black .
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Code style fixes'
2 changes: 1 addition & 1 deletion codelimit/common/scope/scope_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def has_curly_suffix(tokens: list[Token], index):
return index < len(tokens) - 1 and tokens[index + 1].is_symbol("{")


def get_headers(tokens: list[Token], pattern: list[TokenPredicate]):
def get_headers(tokens: list[Token], pattern: list[TokenPredicate | str]):
matches = Matcher(pattern).match(tokens)
result = []
for m in matches:
Expand Down
2 changes: 1 addition & 1 deletion codelimit/common/token_matching/Matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class Matcher:
def __init__(self, pattern: Union[TokenPredicate | str, list[TokenPredicate | str]]):
def __init__(self, pattern: Union[TokenPredicate, str, list[TokenPredicate | str]]):
if not isinstance(pattern, list):
if isinstance(pattern, TokenPredicate):
self._pattern = [pattern]
Expand Down

0 comments on commit c453d7a

Please sign in to comment.