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
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# -- Project information -----------------------------------------------------

project = 'AutoControl'
copyright = '2020 ~ Now, JE-Chen' # noqa: A001 # reason: Sphinx-required name
copyright = '2020 ~ Now, JE-Chen' # noqa: A001 # pylint: disable=redefined-builtin # reason: Sphinx-required name
author = 'JE-Chen'
release = '0.0.179'

Expand Down
2 changes: 2 additions & 0 deletions je_auto_control/utils/clipboard/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def _linux_get() -> str:
if cmd is None:
raise RuntimeError("Install xclip or xsel for Linux clipboard support")
read_cmd = cmd + ["-o"] if cmd[0] == "xclip" else cmd + ["--output"]
# nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit.dangerous-subprocess-use-audit
result = subprocess.run( # nosec B603 # reason: argv from allowlist (xclip/xsel) discovered via shutil.which
read_cmd, capture_output=True, check=True, timeout=5,
)
Expand All @@ -154,6 +155,7 @@ def _linux_set(text: str) -> None:
if cmd is None:
raise RuntimeError("Install xclip or xsel for Linux clipboard support")
write_cmd = cmd + ["-i"] if cmd[0] == "xclip" else cmd + ["--input"]
# nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit.dangerous-subprocess-use-audit
subprocess.run( # nosec B603 # reason: argv from allowlist (xclip/xsel) discovered via shutil.which
write_cmd, input=text.encode("utf-8"),
check=True, timeout=5,
Expand Down
4 changes: 2 additions & 2 deletions je_auto_control/utils/rest_api/rest_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class _JSONHandler(BaseHTTPRequestHandler):
server_version = "AutoControlREST/1.0"

# Suppress default stderr access logs — route through the project logger.
def log_message(self, fmt: str, *args: Any) -> None:
def log_message(self, format, *args) -> None: # noqa: A002 # pylint: disable=redefined-builtin # reason: stdlib BaseHTTPRequestHandler override
autocontrol_logger.info("rest-api %s - %s",
self.address_string(), fmt % args)
self.address_string(), format % args)

def do_GET(self) -> None: # noqa: N802 # reason: stdlib API
parsed = urlparse(self.path)
Expand Down
1 change: 1 addition & 0 deletions je_auto_control/utils/shell_process/shell_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def exec_shell(self, shell_command: Union[str, List[str]]) -> None:
try:
self.exit_program()
args = _normalize_command(shell_command)
# nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit.dangerous-subprocess-use-audit
self.process = subprocess.Popen( # nosec B603 # reason: shell=False, argv list validated via _normalize_command
args,
stdout=subprocess.PIPE,
Expand Down
5 changes: 4 additions & 1 deletion test/unit_test/headless/test_rest_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
server.stop(timeout=1.0)


_TEST_SCHEME = "http" # NOSONAR: S5332 # reason: localhost-only ephemeral test server; TLS is out of scope here

Check warning on line 19 in test/unit_test/headless/test_rest_server.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Fix the syntax of this issue suppression comment.

See more on https://sonarcloud.io/project/issues?id=Integration-Automation_AutoControlGUI&issues=AZ3AmnDkuFrXu1vxwVjM&open=AZ3AmnDkuFrXu1vxwVjM&pullRequest=176


def _request(server, path, method="GET", body=None):
host, port = server.address
url = f"http://{host}:{port}{path}"
url = f"{_TEST_SCHEME}://{host}:{port}{path}"
data = None
headers = {}
if body is not None:
Expand Down
Loading