Docker: hadolint run through the `hadolint-docker` pre-commit hook is not credited

Offen Anfängerfreundlich
#260 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
62/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
docker, python, shell
Bereich
devtools

Rechercherichtung

Beginne mit dem hadolint-Muster in project_validator/ecosystems/docker/tools.py (dem _HADOLINT_RUNS-Matcher nahe Zeile 30) und der argv-Konstruktion in project_validator/tools/pre_commit.py um Zeile 48, die (hook id, *words) baut. Die Hook-ID hadolint-docker soll als hadolint erkannt werden, daher muss der Matcher sie zusätzlich zum bestehenden hadolint-Programm akzeptieren. Fertig, wenn der Korpusfall für jupyter/docker-stacks hadolint als laufend meldet und die Testsuite weiterhin besteht.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

jupyter/docker-stacks runs hadolint on every Dockerfile via the hadolint/hadolint repo's hadolint-docker hook, and CI runs pre-commit (the validator credits shellcheck, shfmt, black, ruff, flake8, mypy, basedpyright and markdownlint from the same file), yet static-analysis FAILs "hadolint is configured (.hadolint.yaml) but does not run" and security-scanning WARNs. The hook's expansion yields an argv (a docker run hadolint/hadolint … entry) that the hadolint pattern does not match.

Evidence from the corpus audit

jupyter/docker-stacks / static-analysis (Docker), security-scanning (Docker)
  • kind: FALSE_NEGATIVE
  • actual: FAIL: Docker: hadolint is configured (.hadolint.yaml) but does not run; WARN security-scanning: Docker: no
    code security scanning found in CI configuration
  • expected: PASS: hadolint runs on every Dockerfile through the hadolint-docker pre-commit hook, and CI runs
    pre-commit (the validator credits shellcheck, shfmt, black, ruff, flake8, mypy, basedpyright, markdownlint from the
    same file). The hook expansion yields argv ("hadolint-docker",), which does not match the hadolint program.
  • evidence: .pre-commit-config.yaml:113: - repo: https://github.com/hadolint/hadolint; :116:
    - id: hadolint-docker (and again at :122-125); .github/workflows/pre-commit.yml runs pre-commit;
    validator project_validator/tools/pre_commit.py:48: Invocation(argv=(str(hook["id"]), *words), ...);
    project_validator/ecosystems/docker/tools.py:30: _HADOLINT_RUNS = starts(("hadolint",)).
  • repro: .pre-commit-config.yaml with repo https://github.com/hadolint/hadolint, hook hadolint-docker;
    .hadolint.yaml; a step uses: pre-commit/action@<sha>; a Dockerfile.
  • confidence: high

Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

Vorherrschende Sprache
Python
Sterne
4
Forks
1
Ø Merge
10 Std. 41 Min.
Gemergte PRs (30 T.)
79

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus cpp-best-practices/project_validator

Alle Issues in cpp-best-practices/project_validator

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.