Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 28, 2024
1 parent 28af90c commit a570998
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pylint/testutils/_primer/package_to_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def _clone_repository(self) -> str:
}
logging.info("Directory does not exists, cloning: %s", options)
from git.repo import Repo

Check warning on line 121 in pylint/testutils/_primer/package_to_lint.py

View check run for this annotation

Codecov / codecov/patch

pylint/testutils/_primer/package_to_lint.py#L121

Added line #L121 was not covered by tests

repo = Repo.clone_from(
url=self.url, to_path=self.clone_directory, branch=self.branch, depth=1
)
Expand All @@ -128,6 +129,7 @@ def _pull_repository(self) -> str:
from git import GitCommandError
from git.cmd import Git
from git.repo import Repo

Check warning on line 131 in pylint/testutils/_primer/package_to_lint.py

View check run for this annotation

Codecov / codecov/patch

pylint/testutils/_primer/package_to_lint.py#L129-L131

Added lines #L129 - L131 were not covered by tests

remote_sha1_commit = Git().ls_remote(self.url, self.branch).split("\t")[0]
local_sha1_commit = Repo(self.clone_directory).head.object.hexsha
if remote_sha1_commit != local_sha1_commit:
Expand Down
2 changes: 2 additions & 0 deletions pylint/testutils/_primer/primer_prepare_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ def run(self) -> None:
elif self.config.check:
for package, data in self.packages.items():
from git.repo import Repo # pylint: disable = import-outside-toplevel

Check warning on line 23 in pylint/testutils/_primer/primer_prepare_command.py

View check run for this annotation

Codecov / codecov/patch

pylint/testutils/_primer/primer_prepare_command.py#L23

Added line #L23 was not covered by tests

local_commit = Repo(data.clone_directory).head.object.hexsha
print(f"Found '{package}' at commit '{local_commit}'.")
commit_string += local_commit[:8] + "_"
elif self.config.make_commit_string:
from git.cmd import Git # pylint: disable = import-outside-toplevel

Check warning on line 29 in pylint/testutils/_primer/primer_prepare_command.py

View check run for this annotation

Codecov / codecov/patch

pylint/testutils/_primer/primer_prepare_command.py#L29

Added line #L29 was not covered by tests

for package, data in self.packages.items():
remote_sha1_commit = (
Git().ls_remote(data.url, data.branch).split("\t")[0][:8]
Expand Down
1 change: 1 addition & 0 deletions pylint/testutils/_primer/primer_run_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def run(self) -> None:
]
)
from git.repo import Repo # pylint: disable = import-outside-toplevel

Check warning on line 37 in pylint/testutils/_primer/primer_run_command.py

View check run for this annotation

Codecov / codecov/patch

pylint/testutils/_primer/primer_run_command.py#L37

Added line #L37 was not covered by tests

for package, data in package_data_iter:
messages, p_fatal_msgs = self._lint_package(package, data)
fatal_msgs += p_fatal_msgs
Expand Down

0 comments on commit a570998

Please sign in to comment.