Repository navigation
Conversation
|
The created documentation from the pull request is available at: docu-html |
…ew shows findings
…_tools (tools#69)
Replaces the analysis of the integrated modules from ref_int's root (which needed the score_tools patch for external sources and the source root) with one CodeQL run per C++ module, set up like module_tests.py run: the module as root workspace with ref_int's resolved versions pinned. Its code-scanning.sarif is rebased into ref_int's external/<module>+/ namespace (as normalize_lcov) and fed to the docs build. docs-as-code: v9.1.1 + POC commits (poc/static-analysis-report-v9.1.1).
…-as-code with Copilot fixes
…olicies Each module is linted as root workspace with ref_int's versions, like the CodeQL analysis: score_cpp_policies' clang-tidy baseline (plus the module's own .clang-tidy), score_rust_policies' clippy_strict and ruff, all through aspect_rules_lint with SARIF output. The SARIF files go into the module verification reports next to the CodeQL findings; docs-as-code with de-duplication and per-tool classification.
…es without own config
…nt de-duplication
…d configs Each module gets a patch (patches/<module>/*-static-analysis-contract.patch) with what it should carry itself later, like its llvm_cov config for coverage: a //quality/static_analysis:codeql target (score_tools codeql_analysis) and a --config=lint with the central clang-tidy/clippy/ruff policies and the SARIF parser. module_tests.py only runs them with ref_int's versions and platform and rebases the SARIF.
docs-as-code now reads static-analysis-report/<repository>/ as that repository's workspace (Bazel path cleanup, virtual includes, out-of-repository findings, per-target rules_lint reports), so module_tests.py only copies the reports.
…t flags build:lint_sarif = --config=lint plus SARIF output (rules_lint_machine) without failing on findings, so the modules' own CI can use it as well.
4 of 10 tasks
…odeql # Conflicts: # MODULE.bazel.lock # bazel_common/score_modules_target_sw.MODULE.bazel # known_good.json
This branch has not been deployed
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.
Proof of concept, do not merge. Static analysis findings (CodeQL MISRA C++, clang-tidy, clippy, ruff) of every target_sw module in the module verification reports, handled like coverage.
Related PRs
codeql_analysismacro (@score_tools//codeql:defs.bzl): traced CodeQL build, coding-standards packs, SARIF + integrity reportknown_good.jsonpinsscore_toolsto31427b6dstatic-analysis-report/, strips Bazel paths, maps_virtual_includes, assigns findings to components, one entry per toolknown_good.jsonpinsscore_docs_as_codetodfbfeebd(#1072 backported onto v9.1.1, branchpoc/static-analysis-report-v9.1.1)make_clang_tidy_aspectapplies the S-CORE baselineknown_good.jsonpinsscore_cpp_policiestoc8fb812eModule contract (patches, to be upstreamed)
//quality/static_analysis:codeql(C++ modules)codeql_analysis(targets, coding_standards_config, exclude_testonly = True, keep_going = True)build:lintbuild:lint_sarif--config=lint,--output_groups=rules_lint_machine,fail_on_violation=falsepatches/baselibs/004-static-analysis-contract.patchscore_toolsdev dep, SARIF parser,lint_sarif, codeql targetpatches/communication/003-static-analysis-contract.patchbuild:lint= clang-tidy + clippy + ruff,lint_sarif,score_toolsdev dep, codeql targetpatches/config_management/007-static-analysis-contract.patchscore_cpp_policiesdev dep,tools/lint/withmake_clang_tidy_aspect+ ruff,build:lint,lint_sarif, codeql targetpatches/kyron/001-static-analysis-contract.patchbuild:lintwith clippy,lint_sarifpatches/lifecycle/008-static-analysis-contract.patchtools/lint/,build:lintwith clippy,lint_sarif, SARIF parser,.clang-tidyexport, codeql targetpatches/logging/008-static-analysis-contract.patch.clang-tidy, ruff,build:lint,lint_sarif, codeql targetpatches/persistency/006-static-analysis-contract.patchlint_sarif, codeql targetpatches/time/008-static-analysis-contract.patchbuild:lint,lint_sarif, codeql targetRI changes
COVERAGE_MODULESSTATIC_ANALYSIS_MODULES: the 8 modules with a contract patch; CodeQL only for C++ modulesrun <module>: module's--config=llvm_cov+@score_coverage//:generate_coverage_htmlcodeql <module>:bazel run //quality/static_analysis:codeql;lint <module>:bazel build --config=lint_sarifon allcc_/rust_/py_targets belowcode_root_paththat are neithertestonlynormanualresult.jsoncodeql_result.json,lint_result.json(exit code, findings)report:coverage_summary.md,coverage-report/coverage_report.datreport:static_analysis_summary.md(module, status, codeql, lint),static-analysis-report/<module>+/module_tests.ymljobTest <module>module_tests.ymljobsCodeQL <module>,Lint <module>(matrix frommodule_tests.py static-analysis-modules)test_and_docs.ymldownloadsmodule-tests-*module-*(tests, codeql, lint)Files:
scripts/module_tests.py,scripts/tests/test_module_tests.py.github/workflows/module_tests.yml,.github/workflows/test_and_docs.ymldocs/verification_report/static_analysis_summary.md(placeholder, likecoverage_summary.md), linked inplatform_verification_report.rstknown_good.json: contract patches inbazel_patches;score_tools,score_docs_as_code,score_cpp_policiespinned (see above). Regeneratedbazel_common/score_modules_target_sw.MODULE.bazel,bazel_common/score_modules_tooling.MODULE.bazel,MODULE.bazel.lock..github/workflows/static_analysis_preview.yml(temporary): on push to this branch, calls this branch'smodule_tests.yml, then runsreportand builds the docs (artifactstatic-analysis-preview-docs). Needed because PR runs oftest_and_docs.ymluse main's workflows (pull_request_target).CI
87d00395): all CodeQL, lint and docs jobs green. Lint of logging, time and config_management ran without the clang-tidy baseline (RI's--override_modulepinned score_cpp_policies 0.1.2 over the patches'git_override), fixed by pinning score_cpp_policies inknown_good.json.6d5a4b16, module_tests.yml integration + score_cpp_policies pin): all 25 jobs green (8 Test, 7 CodeQL, 8 Lint, docs). clang-tidy findings with the baseline: time 1761, logging 2502, config_management 5871.static_analysis_summary.mdin the platform verification report; findings in the module verification reports of baselibs, lifecycle, persistency (logging and time components have nocode_targetsyet). CodeQL jobs take up to ~60 min.Open
STATIC_ANALYSIS_MODULESupstream state instead of a patch.static_analysis_preview.yml.