Add `compile-commands` check: compile_commands.json is exported

Offen
#23 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
74/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
cmake, python

Rechercherichtung

Start by reading the checks and tests in this Python project to see how existing checks detect settings in CMake files, presets, and CI. Add a warning-level compile-commands check that passes when CMAKE_EXPORT_COMPILE_COMMANDS is enabled; use the linked StandardProjectSettings.cmake as the reference. Done means tests cover enabled and missing settings across the stated sources.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Check

New check compile-commands.

Passes when CMAKE_EXPORT_COMPILE_COMMANDS is enabled in CMake files, presets, or CI, so clang-based tooling (clang-tidy, clangd, IDEs) can be used.
Fails otherwise. (Warning-level.)

Reference

set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in cmake/StandardProjectSettings.cmake.


Part of #9. Reference implementation: cpp-best-practices/cmake_template.


Triage (language-neutral review): still valid for C/C++. Meson always writes compile_commands.json, so Meson projects pass automatically. Python and Rust: SKIP. Unblocked: build-system rules exist now (#59); this is a rule on the CMake (and Meson) BuildSystem.

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.