Adacovex.Diff¶
Differential assessment for –compare-base. It assesses a target project at a base revision. The base revision is a branch, commit, rev, or tag in git, mercurial, subversion, fossil, or jj (see Adacovex.VCS). It also assesses the current working tree. It then reports a side-by-side delta of docstring coverage, SPARK proof level, test results, HLR traceability, and DO-178C DAL status. The report helps you catch local regressions before you push. HLR-DIFF: Differential assessment
See also: VCS support
Note: All items in this package are public.
Types¶
type Assessment_Result¶
type Assessment_Result is record
Packages : Natural := 0;
Subprograms : Natural := 0;
Documented : Natural := 0;
Coverage_Pct : Natural := 0;
HLR_Total : Natural := 0;
HLR_Found : Natural := 0;
Orphan_Tags : Boolean := False;
Has_Proof : Boolean := False;
Total_VCs : Natural := 0;
Proved_VCs : Natural := 0;
SPARK_Level : Types.SPARK_Level := Types.Stone;
Has_Tests : Boolean := False;
Tests_Passed : Natural := 0;
Tests_Failed : Natural := 0;
DAL_Status : Types.DAL_Status := Types.Unmet;
Skipped : Natural := 0;
end record;
type Coverage_Result¶
type Coverage_Result is record
Documented : Natural := 0;
Total : Natural := 0;
Pct : Natural := 0;
Skipped : Natural := 0;
end record;
Functions¶
function Assess (Target_Dir : Standard.String; DAL_Target : Adacovex.Types.DAL_Level; Use_Cache : Standard.Boolean) return Adacovex.Diff.Assessment_Result¶
Parameter |
Description |
|---|---|
|
DAL level to assess against. |
|
Project root directory to assess. |
|
When True the .ads scan and the HLR.md/LLR.md |
Returns: Aggregate metrics for the target directory.
function Assess_Coverage (Target_Dir : Standard.String; Use_Cache : Standard.Boolean) return Adacovex.Diff.Coverage_Result¶
Parameter |
Description |
|---|---|
|
Project root directory. |
|
When True the .ads scan comes from the on-disk result |
Returns: Coverage snapshot (documented/total/percentage).
function Is_Repo (Target_Dir : Standard.String) return Standard.Boolean¶
Parameter |
Description |
|---|---|
|
Directory to check. |
Returns: True if Target_Dir is inside a supported VCS repository.
function Repo_Kind_Name (Target_Dir : Standard.String) return Standard.String¶
Parameter |
Description |
|---|---|
|
Directory to check. |
Returns: Lowercase VCS name (”” when none is detected).
function Report_Coverage_Delta (Base : Adacovex.Diff.Coverage_Result; Cur : Adacovex.Diff.Coverage_Result; Base_Ref : Standard.String; Use_Color : Standard.Boolean) return Standard.Boolean¶
Parameter |
Description |
|---|---|
|
Coverage of the base ref. |
|
Human-readable name of the base ref. |
|
Coverage of the current working tree. |
|
Enable ANSI colour output (default False). |
Returns: True if the current coverage regressed versus the base.
function Report_Delta (Base : Adacovex.Diff.Assessment_Result; Cur : Adacovex.Diff.Assessment_Result; Base_Ref : Standard.String; Use_Color : Standard.Boolean) return Standard.Boolean¶
Parameter |
Description |
|---|---|
|
Assessment of the base ref. |
|
Human-readable name of the base ref shown in the report. |
|
Assessment of the current working tree. |
|
Enable ANSI colour output (default False). |
Returns: True if the current state regressed versus the base.
function UX_Note (Target_Dir : Standard.String) return Standard.String¶
Parameter |
Description |
|---|---|
|
Directory to check. |
Returns: Recommendation text (”” when no note is needed).
Procedures¶
procedure Make_Worktree (Target_Dir : Standard.String; Base_Ref : Standard.String; Tmp_Path : Standard.String; Tmp_Len : Standard.Natural; Success : Standard.Boolean)¶
Parameter |
Description |
|---|---|
|
Branch/commit/rev/tag to check out. |
|
True if the snapshot was created. False on failure. |
|
Root of the target repository. |
|
Length of the snapshot path on success. |
|
Output buffer receiving the snapshot path. |
procedure Remove_Worktree (Target_Dir : Standard.String; Tmp_Path : Standard.String)¶
Parameter |
Description |
|---|---|
|
Root of the target repository. |
|
Path of the snapshot to remove. |