Fix mypy pre-commit and GitHub action

This commit is contained in:
Vladyslav Fedoriuk 2023-08-03 10:09:40 +02:00
parent d1f93f81ee
commit c559765942
4 changed files with 6 additions and 9 deletions

View File

@ -25,7 +25,7 @@ jobs:
python -m ruff check --verbose --format=github .
- name: Lint with mypy
run: |
python -m mypy --show-error-codes --pretty --show-column-numbers --show-error-context $(git ls-files '*.py')
python -m mypy --show-error-codes --pretty --show-column-numbers --show-error-context .
- name: Lint with black
run: |
python -m black --check --verbose .

View File

@ -24,10 +24,12 @@ repos:
hooks:
- id: mypy
name: mypy
entry: mypy
entry: |
python -m mypy .
types: [ python ]
language: system
require_serial: true
pass_filenames: false
- repo: https://github.com/ambv/black
rev: 23.7.0
hooks:

View File

@ -92,10 +92,7 @@ def test_source_graph_repo_data(source_graph_matched_repos_data: Json[Any]) -> N
source_graph_matched_repos_data
)
assert repos_parsed == HasLen(4)
assert all(
repo == IsInstance[SourceGraphRepoData] # type: ignore[type-var]
for repo in repos_parsed
)
assert all(repo == IsInstance[SourceGraphRepoData] for repo in repos_parsed)
assert all(
repo.repo_id == repo_data["repositoryID"]
for repo, repo_data in zip(

View File

@ -23,7 +23,5 @@ async def test_create_repos_from_source_graph_repos_data(
test_db_session, source_graph_repo_data
)
assert repos == IsList(length=5)
assert all(
repo == IsInstance[database.Repo] for repo in repos # type: ignore[type-var]
)
assert all(repo == IsInstance[database.Repo] for repo in repos)
assert all(repo.id is not None for repo in repos)