From 13c3b0f666cea8f29dc747e00b14c2040751abbf Mon Sep 17 00:00:00 2001 From: Peter Downey Date: Tue, 3 Nov 2026 22:42:15 -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 | 7 +++---- 3 files changed, 14 insertions(+), 20 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 eec3e8a..ad74b9f 100755 --- a/.github/scripts/check-plugin-package.py +++ b/.github/scripts/check-plugin-package.py @@ -66,10 +66,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 3a38a75..8fa9515 100755 --- a/.github/scripts/test-automation.py +++ b/.github/scripts/test-automation.py @@ -1,9 +1,8 @@ #!/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. -""" +# These fixtures do not bootstrap WordPress or replace workflow-generated PHP tests. +# All mutation is confined to a temporary fixture repository on the runner. from __future__ import annotations