6 Commits
Author SHA1 Message Date
Gleb Chesnokov 74a2e4bac3 scripts: Add the SCST code style linter
Document SCS.1 and expose make scs_lint for the common C source/header
scope, including userspace and KUnit. Adapt engine's OCS.7.5 check to
SCST_KUNIT_VISIBLE, SCST_KUNIT_VISIBLE_INLINE and VISIBLE_IF_KUNIT.
Require each annotation to occupy its own line; leave other function
attributes and source warnings unchanged.

Use Tree-sitter to distinguish code from comments, literals and
preprocessor directive contents while checking every conditional
branch. Pin the parser dependencies and run them through uv.

Support whole-tree, DIFFBR and explicit-file selection without new
exclusions or diagnostic exceptions. Retain findings and checked-file
records even when a later input fails. Add isolated rule, diff-mode,
coverage and read-failure fixtures with a separate test target.
2026-10-20 14:16:08 +03:00
Gleb Chesnokov 704c44dabe scripts: Add whole-file Checkpatch analysis
Expose make checkpatch through the common C source/header policy,
including userspace and KUnit sources. DIFFBR selects whole changed
files. Use the kernel's Checkpatch and companion data with --strict,
without adding diagnostic exceptions or loading local configuration.

Retain raw output and require native totals and a completion record
for every selected file. Distinguish source findings from unreadable
inputs, inconsistent reports and tool failures, with isolated fixtures.
Keep native caches in a temporary directory and serialize only this
analyzer's reports so it can run alongside the Kbuild analyzers.

Make checkpatch_scan use this target's implementation and exit status
instead of suppressing errors. Preserve the separate existing policy
of patch/commit helpers and the kernel regression runner.
2026-10-20 14:16:08 +03:00
Gleb Chesnokov 6c3405f5fe scripts: Add Cppcheck with native build contexts
Expose make cppcheck using freshly captured kernel CHECK commands and
real userspace compiler invocations. Keep their include paths and
definitions unchanged and analyze kernel and userspace contexts
separately.

Use the shared source scope without additional input exclusions, project
models or diagnostic suppressions. Relevant diffs trigger full
configured analysis; KUnit coverage follows the actual build
configuration.

Retain build logs, compilation databases, native XML and checker
coverage. Separate source findings from parser failures, missing inputs
and incomplete builds, with isolated report and capture fixtures.
2026-10-19 21:38:56 +03:00
Gleb Chesnokov 2f8ff7ea63 scripts: Integrate Sparse and Smatch with reviewed policy
Run the native checkers through the ordered SCST module build with C=2.
Preserve Kbuild flags, full raw output and every attempted CHECK record.
Keep full, diff and explicit input selection on the shared scope; diff
selection triggers the complete configured module analysis.

Read exact diagnostic exceptions from policy/sparse.json and
smatch.json: two reviewed Smatch IRQ reports and the external FC
flexible-array warning. Keep the existing SCST matching boundaries and
reasons. Smatch uses its matching installed kernel data without
engine-specific additions.

Reject build, checker, frontend and truncation failures even when Kbuild
returns success. Retain per-invocation records and a machine-readable
run summary, and detect printed CHECK steps without a record. Require
selected C inputs to occur in the build. Keep findings distinct from
incompleteness.

Check native compatibility before compilation, and forward external
kernel capability probes to the real checker instead of skipping them as
inputs outside SCST. Include the pinned Smatch typeof frontend
correction and isolated fixtures for failure propagation and exact
exception boundaries.
2026-10-19 21:38:56 +03:00
Gleb Chesnokov df16b2e697 scripts: Expose analyzer policy without running tools
Add show, files and validate commands to analyzer_policy.py and expose
policy inspection through make analyzer-policy. Support text and JSON
reports without installing or invoking an analyzer or preparing a build.

Show the configured roots, input exclusions and their reasons. The file
inventory uses the shared selector and reports eligible tracked inputs,
not completed analysis or build coverage. Configuration and Git failures
return an error instead of a successful empty report.

Expose only the common input policy at this stage. Individual analyzer
policies belong with their drivers. Keep the existing checkpatch and
kernel regression filtering separate and document that boundary.

Add isolated CLI fixtures for policy reporting, repository-relative input
inventory and visible failures. Document the inspection entry points.
2026-10-19 21:38:56 +03:00
Gleb Chesnokov c1e2f41a49 scripts: Store shared analyzer scope as reviewed policy
Move the source roots, file types and input exclusions from lint_scope.py
into policy/common.json. Keep the existing scope, including KUnit sources,
the newer QLogic target and the exclusions for the legacy QLogic tree,
upstream QLogic sources, compiler probes and generated module metadata.

Adapt engine's reviewed-data and strict-loader approach to SCST. Require
reasons for input exclusions and reject malformed, missing or ambiguous
policy before selecting files. Do not import engine's exclusions or add
environment-based filtering or diagnostic suppression.

Use this policy for full, diff and explicit-file selection. Preserve both
lexical and resolved path checks, single-commit diff bases and index-based
selection. Treat policy paths literally in Git pathspecs as well as Python.
Add isolated fixtures for schema failures and policy-driven selection.
2026-10-19 21:38:56 +03:00