From fa904fc683c0892eb800ddb986fdc0c646721077 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 12 Dec 2025 09:13:40 +0100 Subject: [PATCH] lint: Remove confusing, redundant, and brittle lint-spelling --- ci/lint/01_install.sh | 1 - test/lint/README.md | 1 - test/lint/lint-spelling.py | 43 ----------------------------- test/lint/spelling.ignore-words.txt | 29 ------------------- 4 files changed, 74 deletions(-) delete mode 100755 test/lint/lint-spelling.py delete mode 100644 test/lint/spelling.ignore-words.txt diff --git a/ci/lint/01_install.sh b/ci/lint/01_install.sh index fc422675e30..0cf9fbb4260 100755 --- a/ci/lint/01_install.sh +++ b/ci/lint/01_install.sh @@ -40,7 +40,6 @@ command -v python3 python3 --version ${CI_RETRY_EXE} pip3 install \ - codespell==2.4.1 \ lief==0.16.6 \ mypy==1.18.2 \ pyzmq==27.1.0 \ diff --git a/test/lint/README.md b/test/lint/README.md index 1858a2c0edb..e28eda1fdf2 100644 --- a/test/lint/README.md +++ b/test/lint/README.md @@ -50,7 +50,6 @@ or `--help`: | [`lint-python.py`](/test/lint/lint-python.py) | [pyzmq](https://github.com/zeromq/pyzmq) | [`lint-python-dead-code.py`](/test/lint/lint-python-dead-code.py) | [vulture](https://github.com/jendrikseipp/vulture) | [`lint-shell.py`](/test/lint/lint-shell.py) | [ShellCheck](https://github.com/koalaman/shellcheck) -| [`lint-spelling.py`](/test/lint/lint-spelling.py) | [codespell](https://github.com/codespell-project/codespell) | `py_lint` | [ruff](https://github.com/astral-sh/ruff) | markdown link check | [mlc](https://github.com/becheran/mlc) diff --git a/test/lint/lint-spelling.py b/test/lint/lint-spelling.py deleted file mode 100755 index cd34162c886..00000000000 --- a/test/lint/lint-spelling.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (c) 2022-present The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -""" -Warn in case of spelling errors. -Note: Will exit successfully regardless of spelling errors. -""" - -from subprocess import check_output, STDOUT, CalledProcessError - -from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES - -IGNORE_WORDS_FILE = 'test/lint/spelling.ignore-words.txt' -FILES_ARGS = ['git', 'ls-files', '--', ":(exclude)contrib/seeds/*.txt", ":(exclude)depends/", ":(exclude)doc/release-notes/", ":(exclude)src/qt/locale/", ":(exclude)src/qt/*.qrc", ":(exclude)contrib/guix/patches"] -FILES_ARGS += [f":(exclude){dir}" for dir in SHARED_EXCLUDED_SUBTREES] - - -def check_codespell_install(): - try: - check_output(["codespell", "--version"]) - except FileNotFoundError: - print("Skipping spell check linting since codespell is not installed.") - exit(0) - - -def main(): - check_codespell_install() - - files = check_output(FILES_ARGS, text=True).splitlines() - codespell_args = ['codespell', '--check-filenames', '--disable-colors', '--quiet-level=7', '--ignore-words={}'.format(IGNORE_WORDS_FILE)] + files - - try: - check_output(codespell_args, stderr=STDOUT, text=True) - except CalledProcessError as e: - print(e.output, end="") - print('^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in {}'.format(IGNORE_WORDS_FILE)) - - -if __name__ == "__main__": - main() diff --git a/test/lint/spelling.ignore-words.txt b/test/lint/spelling.ignore-words.txt deleted file mode 100644 index fe08eabefa9..00000000000 --- a/test/lint/spelling.ignore-words.txt +++ /dev/null @@ -1,29 +0,0 @@ -afile -amountIn -anc -blockin -bu -cachable -clen -debbugs -deques -fo -hashIn -hights -incomin -invokable -lief -mor -nd -nin -ot -outIn -requestor -ser -siz -stap -unparseable -unser -useable -viewIn -wit \ No newline at end of file