fix: resolve CI lint, type-check, and security gate failures#18
Merged
michaelalber merged 2 commits intomainfrom Apr 26, 2026
Merged
fix: resolve CI lint, type-check, and security gate failures#18michaelalber merged 2 commits intomainfrom
michaelalber merged 2 commits intomainfrom
Conversation
…rt command Ruff S101/Bandit B101: replaced `assert parser is not None` with an explicit RuntimeError guard — assert is stripped with -O and is not a reliable control-flow mechanism. Ruff S603/Bandit B603/B404: added inline nosec/noqa suppressions on the subprocess import and the subprocess.run call. The invocation uses sys.executable (same interpreter) with hardcoded flag strings and a validated Path; shell=False is the default — not a command-injection risk. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… truncation log parser.py: AcceleratorOptions exists at runtime in docling.datamodel.pipeline_options but the module defines no __all__, so mypy strict/no_implicit_reexport cannot verify the export. Added type: ignore[attr-defined] scoped to the lazy import block. embeddings.py: Semgrep python-logger-credential-disclosure fires on the truncation warning because the format string contains chunk_index=%s — a diagnostic field, not a credential. Added nosemgrep suppression with the full rule ID. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__main__.py— Replaceassert parser is not Nonewith an explicitRuntimeErrorguard (assert is stripped with-O; S101/B101). Add# nosec B404onimport subprocessand# noqa: S603 # nosec B603onsubprocess.run— the invocation usessys.executablewith hardcoded flag strings and a validatedPath; not a command-injection risk.parser.py— Add# type: ignore[attr-defined]on the lazyAcceleratorOptionsimport. Docling'spipeline_optionsmodule defines no__all__, so mypy strict/no_implicit_reexportcannot verify the export; the attribute exists at runtime (confirmed withdir()).embeddings.py— Add# nosemgrepsuppression on the truncationlogger.warning. Semgrep'spython-logger-credential-disclosurerule fires onchunk_index=%s— a diagnostic field, not a credential. Confirmed false positive.Gates fixed
__main__.py__main__.py# nosec B404__main__.py# noqa: S603 # nosec B603parser.py# type: ignore[attr-defined]embeddings.py# nosemgrepTest plan
convertcommand — assert replaced with equivalent guard🤖 Generated with Claude Code