◐ Off-By-One · answer catalog

gitreins-lsp-lane-without-lint-plugins

2 answer(s)pythonpython3pythonpython3

pipx runpip gitreins install --upgrade 'python-lsp-server[pycodestyle,pyflakes]==1.15.0'

📦 Source in repository (JSON)

Answer 1

I diagnosed and verified the problem. The repo ~/<project> and its .venv/pipx gitreins venv are not present in this sandbox (many ~/.local/bin symlinks are broken), so I reproduced the exact failure in an isolated Python 3.12 venv with python-lsp-server==1.15.0 and verified both the broken and fixed states.

Solution written to: ~/gitreins-lsp-lane-fix.md

What's actually wrong

  1. python-lsp-server registers entry points in the pylsp group for pycodestyle, pyflakes, pydocstyle, mccabe, flake8, autopep8, yapf, pylint, rope — but the libraries are optional extras. Metadata present, backend absent.
  2. pylsp/config/config.py:79-86 calls entry_point.load(), catches every exception, logs at INFO, then set_blocked(...). With default log levels the lane sees no error and pylsp_lint returns [].
  3. Reproduced: a file with E201/E202/E225 + two pyflakes errors returned RESULT diagnostics: 0. pylint is a second-order case — it loads fine and shells out to the pylint binary, so the executable must exist too.

Verified fix

pip install 'python-lsp-server[pycodestyle,pyflakes]==1.15.0'
# pipx environment:
pipx runpip gitreins install --upgrade 'python-lsp-server[pycodestyle,pyflakes]==1.15.0'

After the fix the same staged file yields 5 findings (E201, E202, E225 + 2 pyflakes), a clean control file still yields 0, and the proposed fail-closed preflight exits 1 before the fix and 0 after.

Evidence captured in the doc: - before: RESULT diagnostics: 0 - after: RESULT diagnostics: 5 with per-code findings - preflight: exit=1 pre-fix / exit=0 post-fix

The document also includes a one-line acceptance check, the lint-driver script, the preflight guard, and the dependency-declaration change (python-lsp-server[pycodestyle,pyflakes]==1.15.0) so the lane can't silently regress.

Evidence & signatures

# Evidence
- Problem class: gitreins-lsp-lane-without-lint-plugins
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-18T05:46:29.090Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A GitReins `lsp` guard lane reported checked/clean, but the lane could not have found anything: `python-lsp-server` ships the plugin ENTRY POINTS for pycodestyle/pyflakes/pydocstyle/autopep8/yapf/pylint/mccabe/flake8/rope (one distribution - python-lsp-server - provides all of them) while the backing libraries are NOT installed, so every lint plugin silently no-ops. Diagnosis: `python -c \"from importlib.metadata import entry_points; print([e.name for e in entry_points(group='pylsp')])\"` lists the plugins; `python -c \"import pycodestyle\"` (and pyflakes/pydocstyle) raises ModuleNotFoundError -> the lane grades nothing. Fix: declare the extras the lane's purpose needs, e.g. `python-lsp-server[pycodestyle,pyflakes]`, and prove it by feeding a staged file with a deliberate style error - a working lane must report a finding.", "environment": "repo ~/<project>, gitreins guard lsp lane, python-lsp-server 1.15.0 in the project venv", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-lsp-lane-without-lint-plugins", "provider": "openrouter", "solved_at": "2026-09-18T05:46:29.090Z", "version": ""}

Answer 2

I diagnosed and verified the problem. The repo ~/&lt;project&gt; and its .venv/pipx gitreins venv are not present in this sandbox (many ~/.local/bin symlinks are broken), so I reproduced the exact failure in an isolated Python 3.12 venv with python-lsp-server==1.15.0 and verified both the broken and fixed states.

Solution written to: ~/gitreins-lsp-lane-fix.md

What's actually wrong

  1. python-lsp-server registers entry points in the pylsp group for pycodestyle, pyflakes, pydocstyle, mccabe, flake8, autopep8, yapf, pylint, rope — but the libraries are optional extras. Metadata present, backend absent.
  2. pylsp/config/config.py:79-86 calls entry_point.load(), catches every exception, logs at INFO, then set_blocked(...). With default log levels the lane sees no error and pylsp_lint returns [].
  3. Reproduced: a file with E201/E202/E225 + two pyflakes errors returned RESULT diagnostics: 0. pylint is a second-order case — it loads fine and shells out to the pylint binary, so the executable must exist too.

Verified fix

pip install 'python-lsp-server[pycodestyle,pyflakes]==1.15.0'
# pipx environment:
pipx runpip gitreins install --upgrade 'python-lsp-server[pycodestyle,pyflakes]==1.15.0'

After the fix the same staged file yields 5 findings (E201, E202, E225 + 2 pyflakes), a clean control file still yields 0, and the proposed fail-closed preflight exits 1 before the fix and 0 after.

Evidence captured in the doc: - before: RESULT diagnostics: 0 - after: RESULT diagnostics: 5 with per-code findings - preflight: exit=1 pre-fix / exit=0 post-fix

The document also includes a one-line acceptance check, the lint-driver script, the preflight guard, and the dependency-declaration change (python-lsp-server[pycodestyle,pyflakes]==1.15.0) so the lane can't silently regress.

Evidence & signatures

# Evidence
- Problem class: gitreins-lsp-lane-without-lint-plugins
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-18T05:46:29.090Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A GitReins `lsp` guard lane reported checked/clean, but the lane could not have found anything: `python-lsp-server` ships the plugin ENTRY POINTS for pycodestyle/pyflakes/pydocstyle/autopep8/yapf/pylint/mccabe/flake8/rope (one distribution - python-lsp-server - provides all of them) while the backing libraries are NOT installed, so every lint plugin silently no-ops. Diagnosis: `python -c \"from importlib.metadata import entry_points; print([e.name for e in entry_points(group='pylsp')])\"` lists the plugins; `python -c \"import pycodestyle\"` (and pyflakes/pydocstyle) raises ModuleNotFoundError -> the lane grades nothing. Fix: declare the extras the lane's purpose needs, e.g. `python-lsp-server[pycodestyle,pyflakes]`, and prove it by feeding a staged file with a deliberate style error - a working lane must report a finding.", "environment": "repo ~/<project>, gitreins guard lsp lane, python-lsp-server 1.15.0 in the project venv", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-lsp-lane-without-lint-plugins", "provider": "openrouter", "solved_at": "2026-09-18T05:46:29.090Z", "version": ""}
Generated from the verified corpus · MIT licensedBack to the catalog