From 82207c1758b79bb9ff2f9c69f573c74ecd7da7c7 Mon Sep 17 00:00:00 2001 From: Peter Downey Date: Tue, 3 Nov 2026 22:42:04 -0500 Subject: [PATCH] Keep the lock files out of Codacy's Lizard, and use one-line docstrings Codacy's Lizard reads composer.lock and package-lock.json as source code and flags their length; .codacy.yml now leaves them out, as the EngineScript repository does. The two multi-line docstrings keep their summary as a one-line docstring and the rest becomes a comment, which both of Codacy's contradicting docstring rules (D212, D213) accept. Co-Authored-By: Claude Opus 5.5 --- .codacy.yml | 21 +++++++++------------ .github/scripts/check-plugin-package.py | 6 ++---- .github/scripts/test-automation.py | 11 +++++------ 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.codacy.yml b/.codacy.yml index 331d20e..dda7592 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -1,15 +1,12 @@ -# Codacy configuration. -# -# TSLint is deprecated, and Codacy can still run it on JSON files. It is -# turned off from here in two ways: tslint.json enables no rule, and the paths -# below keep every file away from the tool. The two JSON files are named as -# well, because they are what it flags: it asks for trailing commas and sorted -# keys, which JSON and npm's lock file cannot have. Every other tool still -# reads every file. +--- +# Codacy configuration + engines: - tslint: + # Lizard reads the lock files as source code and reports their length. + # Composer and npm generate them; nobody writes them by hand. + lizard: exclude_paths: - - "**" - - "**/*" - - "package.json" + - "composer.lock" - "package-lock.json" + - "**/composer.lock" + - "**/package-lock.json" diff --git a/.github/scripts/check-plugin-package.py b/.github/scripts/check-plugin-package.py index d6ba052..a3ef90b 100755 --- a/.github/scripts/check-plugin-package.py +++ b/.github/scripts/check-plugin-package.py @@ -67,10 +67,8 @@ def tracked_files(root: Path, *options: str) -> set[str]: def check_distignore(root: Path, tracked: set[str], names: set[str]) -> None: - """Require .distignore to keep exactly the tracked files that the allowlist ships. - - Git matches the patterns, so they mean what they mean to `wp dist-archive`. - """ + """Require .distignore to keep exactly the tracked files that the allowlist ships.""" + # Git matches the patterns, so they mean what they mean to `wp dist-archive`. distignore = root / ".distignore" if distignore.is_symlink() or not distignore.is_file(): raise ValueError("The .distignore file is missing.") diff --git a/.github/scripts/test-automation.py b/.github/scripts/test-automation.py index 352c11b..6eb407c 100755 --- a/.github/scripts/test-automation.py +++ b/.github/scripts/test-automation.py @@ -1,11 +1,10 @@ #!/usr/bin/env python3 -"""Standard-library regression fixtures, executed by GitHub's package-check job. +"""Standard-library regression fixtures, executed by GitHub's package-check job.""" -These fixtures do not bootstrap WordPress or replace workflow-generated PHP tests. -All mutation is confined to a temporary fixture repository on the runner. -Processes use system tools in /usr/bin on the Ubuntu runner/WSL target; PATH -overrides select only intentional command substitutes inside extracted shell steps. -""" +# These fixtures do not bootstrap WordPress or replace workflow-generated PHP tests. +# All mutation is confined to a temporary fixture repository on the runner. +# Processes use system tools in /usr/bin on the Ubuntu runner/WSL target; PATH +# overrides select only intentional command substitutes inside extracted shell steps. from __future__ import annotations