Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ repos:
- flake8-comprehensions==3.10.0
- flake8-debugger==4.1.2
- flake8-string-format==0.3.0
- repo: https://github.com/pycqa/bandit
rev: 1.7.4
hooks:
- id: bandit
args: [-c, pyproject.toml]
additional_dependencies: ["toml"]
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,7 @@ enable = ["c-extension-no-member", "no-else-return"]
[tool.pylint.variables]
dummy-variables-rgx = "_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_"
ignored-argument-names = "_.*|^ignored_|^unused_|args|kwargs"

[tool.bandit]
exclude_dirs = ["tests"]
skips = ["B101"]
6 changes: 3 additions & 3 deletions src/scmrepo/git/backend/dulwich/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import os
import shlex
import shutil
import subprocess
import subprocess # nosec B404
import sys
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
from urllib.parse import ParseResult, urlparse
Expand Down Expand Up @@ -142,7 +142,7 @@ def _prepare_command(self) -> Union[str, List[str]]:
if not shutil.which(executable) and shutil.which("git"):
# If the helper cannot be found in PATH, it might be
# a C git helper in GIT_EXEC_PATH
git_exec_path = subprocess.check_output(
git_exec_path = subprocess.check_output( # nosec B603
("git", "--exec-path"),
universal_newlines=True,
).strip()
Expand Down Expand Up @@ -181,7 +181,7 @@ def get(
helper_input.append("")

try:
res = subprocess.run( # type: ignore # breaks on 3.6
res = subprocess.run( # type: ignore # nosec B603 # breaks on 3.6
cmd,
check=True,
stdout=subprocess.PIPE,
Expand Down
2 changes: 1 addition & 1 deletion src/scmrepo/git/backend/pygit2.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _get_codespaces_signature(self) -> Optional["Signature"]:
email = first(config.get_multivar("user.email"))
if name and email:
return Signature(name, email)
except Exception: # pylint: disable=broad-except
except Exception: # nosec B110, pylint: disable=broad-except
pass
return None

Expand Down