mirror of
https://github.com/Kludex/awesome-fastapi-projects.git
synced 2025-05-14 05:07:04 +00:00
Fix mypy pre-commit and GitHub action
This commit is contained in:
parent
d1f93f81ee
commit
c559765942
2
.github/workflows/app.yaml
vendored
2
.github/workflows/app.yaml
vendored
@ -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 .
|
||||
|
@ -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:
|
||||
|
@ -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(
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user