Skip to content

Commit

Permalink
type-check
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannis-Mittenzwei committed Sep 18, 2024
1 parent 8e8463b commit 7bdbb76
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ repos:
language: system
entry: poetry run nox -s fix

# - repo: local
# hooks:
# - id: type-check
# name: type-check
# types: [ python ]
# pass_filenames: false
# language: system
# entry: poetry run nox -s type-check
#
- repo: local
hooks:
- id: type-check
name: type-check
types: [ python ]
pass_filenames: false
language: system
entry: poetry run nox -s type-check

# - repo: local
# hooks:
# - id: lint
Expand Down
2 changes: 1 addition & 1 deletion exasol_script_languages_container_ci/lib/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

def get_all_affected_files(git_access: GitAccess, base_branch: str) -> Set[str]:
base_last_commit_sha = git_access.get_head_commit_sha_of_branch(base_branch)
changed_files = set()
changed_files = set() # type: ignore
for commit in git_access.get_last_commits():
if commit == base_last_commit_sha:
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def generate_config_data_model(output_file: Path) -> Path:
with temp_output_file.open("rt") as temp_output_file_handle:
with output_file.open("wt") as output_file_handle:
lines = (line for line in temp_output_file_handle)
lines = filter(lambda line: "# timestamp: " not in line, lines)
lines = filter(lambda line: "# timestamp: " not in line, lines) # type: ignore
for line in lines:
output_file_handle.write(line)
return output_file
Expand Down
4 changes: 2 additions & 2 deletions exasol_script_languages_container_ci/lib/git_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_head_commit_sha_of_branch(self, branch_name) -> str:
:raise: ValueError: if the refs with label 'branch_name' does not exists or is not unique.
"""
repo = Repo()
branch = [b for b in repo.refs if b.name == branch_name]
branch = [b for b in repo.refs if b.name == branch_name] # type: ignore
if len(branch) == 0:
ex_msg = f"Branch '{branch_name}' does not exist."
raise ValueError(ex_msg)
Expand All @@ -40,4 +40,4 @@ def get_files_of_commit(self, commit_sha) -> Iterable[str]:
Returns the files of the specific commits of the repo in the cwd.
"""
repo = Repo()
return repo.commit(commit_sha).stats.files.keys()
return repo.commit(commit_sha).stats.files.keys() # type: ignore
4 changes: 2 additions & 2 deletions exasol_script_languages_container_ci/lib/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def release(
rebuild=True,
build_docker_repository=None,
commit_sha="",
docker_user=None,
docker_password=None,
docker_user=None, # type: ignore
docker_password=None, # type: ignore
test_container_folder=test_container_folder,
)
ci_execute_tests.execute_tests(
Expand Down
2 changes: 1 addition & 1 deletion test/unit_tests/test_asset_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
)


def test():
def test() -> None:
github_release_asset_uploader_mock: Union[MagicMock, GithubReleaseAssetUploader] = (
create_autospec(GithubReleaseAssetUploader)
)
Expand Down
14 changes: 7 additions & 7 deletions test/unit_tests/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def test(is_dry_run: bool, expected_calls, build_config: Config):
build_config=build_config,
release_id=123,
is_dry_run=is_dry_run,
release_uploader=ci_commands_mock,
ci_build=ci_commands_mock,
ci_push=ci_commands_mock,
ci_execute_tests=ci_commands_mock,
ci_security_scan=ci_commands_mock,
ci_prepare=ci_commands_mock,
release_uploader=ci_commands_mock, # type: ignore
ci_build=ci_commands_mock, # type: ignore
ci_push=ci_commands_mock, # type: ignore
ci_execute_tests=ci_commands_mock, # type: ignore
ci_security_scan=ci_commands_mock, # type: ignore
ci_prepare=ci_commands_mock, # type: ignore
)
assert ci_commands_mock.mock_calls == expected_calls
assert ci_commands_mock.mock_calls == expected_calls # type: ignore
4 changes: 2 additions & 2 deletions test/unit_tests/test_release_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
autospec=True,
)
def test(temp_dir_mock):
asset_uploader_mock: Union[MagicMock, AssetUploader] = create_autospec(
asset_uploader_mock: Union[MagicMock, AssetUploader] = create_autospec( # type: ignore
AssetUploader
)
ci_export_mock: Union[MagicMock, CIExport] = create_autospec(CIExport)
ci_export_mock: Union[MagicMock, CIExport] = create_autospec(CIExport) # type: ignore
release_uploader = ReleaseUploader(asset_uploader_mock, ci_export_mock)
release_uploader.release_upload(
release_id=123,
Expand Down

0 comments on commit 7bdbb76

Please sign in to comment.