зеркало из https://github.com/microsoft/CCF.git
Reduce noise of TLAi linter. (#6103)
This commit is contained in:
Родитель
81c8b79d68
Коммит
8ace4aa604
|
@ -144,7 +144,7 @@ jobs:
|
||||||
## Identify git diff: $(git diff --name-only HEAD^ | grep '.tla')
|
## Identify git diff: $(git diff --name-only HEAD^ | grep '.tla')
|
||||||
## Install genaiscript runtime: https://microsoft.github.io/genaiscript/reference/cli/
|
## Install genaiscript runtime: https://microsoft.github.io/genaiscript/reference/cli/
|
||||||
## Output LLM response in SARIF format: https://microsoft.github.io/genaiscript/reference/scripts/annotations/ (redirect other output to /dev/null for GH not to also show the annotations)
|
## Output LLM response in SARIF format: https://microsoft.github.io/genaiscript/reference/scripts/annotations/ (redirect other output to /dev/null for GH not to also show the annotations)
|
||||||
run: npx --yes genaiscript run scripts/TLAi-linter.genai.js $(git diff --name-only HEAD^ | grep '\.tla') --max-tokens 2000 --out-annotations results.sarif > /dev/null
|
run: npx --yes genaiscript run scripts/TLAi-linter.genai.js $(git diff --name-only HEAD^ | grep '\.tla') --max-tokens 2000 --out-annotations results.sarif > /dev/null && jq '.runs |= map(.results |= map(select(.level != "note")))' results.sarif > filtered.sarif
|
||||||
|
|
||||||
- name: Upload SARIF file
|
- name: Upload SARIF file
|
||||||
if: (success() || failure()) && steps.git_commit.outputs.contains_tla == 'true'
|
if: (success() || failure()) && steps.git_commit.outputs.contains_tla == 'true'
|
||||||
|
@ -152,4 +152,4 @@ jobs:
|
||||||
## https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github
|
## https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github
|
||||||
uses: github/codeql-action/upload-sarif@v3
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: filtered.sarif
|
||||||
|
|
|
@ -14,6 +14,7 @@ def(
|
||||||
|
|
||||||
// use $ to output formatted text to the prompt
|
// use $ to output formatted text to the prompt
|
||||||
$`You are an expert at TLA+/TLAPLUS. Your task is to check if the prose comments and their TLA+ declarations and definitions are syntactically and semantically consistent!!!
|
$`You are an expert at TLA+/TLAPLUS. Your task is to check if the prose comments and their TLA+ declarations and definitions are syntactically and semantically consistent!!!
|
||||||
|
However, you may assume that that a parser has already checked the syntax of the TLA+ code.
|
||||||
Explain any consistencies and inconsistencies you may find. Report inconsistent and consistent pairs in a single ANNOTATION section.
|
Explain any consistencies and inconsistencies you may find. Report inconsistent and consistent pairs in a single ANNOTATION section.
|
||||||
|
|
||||||
## TLA+ Syntax Hints
|
## TLA+ Syntax Hints
|
||||||
|
@ -30,4 +31,7 @@ Explain any consistencies and inconsistencies you may find. Report inconsistent
|
||||||
|
|
||||||
## Formal and informal math Hints
|
## Formal and informal math Hints
|
||||||
- Take into account that humans may write informal math that is syntactically different from the formal math, yet semantically equivalent. For example, humans may write \`N > 3T\` instead of \`N > 3 * T\`.
|
- Take into account that humans may write informal math that is syntactically different from the formal math, yet semantically equivalent. For example, humans may write \`N > 3T\` instead of \`N > 3 * T\`.
|
||||||
|
|
||||||
|
## Natural language Hints
|
||||||
|
- Unless a built-in TLA+ declaration or definition like an operator in the TLA+ standard library dictates otherwise, the prose comments should follow British English spelling conventions.
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -16,7 +16,7 @@ WriteStatsFile ==
|
||||||
/\ Serialize(<<TLCGet("stats")>>, StatsFilename, [format |-> "NDJSON", charset |-> "UTF-8", openOptions |-> <<"WRITE", "CREATE", "APPEND">>])
|
/\ Serialize(<<TLCGet("stats")>>, StatsFilename, [format |-> "NDJSON", charset |-> "UTF-8", openOptions |-> <<"WRITE", "CREATE", "APPEND">>])
|
||||||
|
|
||||||
\* Append TLC coverage in ndJson format to file identified by CoverageFilename. Create CoverageFilename if it does not exist.
|
\* Append TLC coverage in ndJson format to file identified by CoverageFilename. Create CoverageFilename if it does not exist.
|
||||||
SerialiseCoverage ==
|
SerializeCoverage ==
|
||||||
Serialize(<<TLCGet("spec")>>, CoverageFilename, [format |-> "NDJSON", charset |-> "UTF-8", openOptions |-> <<"WRITE", "CREATE", "APPEND">>])
|
Serialize(<<TLCGet("spec")>>, CoverageFilename, [format |-> "NDJSON", charset |-> "UTF-8", openOptions |-> <<"WRITE", "CREATE", "APPEND">>])
|
||||||
|
|
||||||
====
|
====
|
||||||
|
|
|
@ -16,7 +16,7 @@ ls -tr <spec>_coverage.json | xargs cat | python3 actions.py
|
||||||
|
|
||||||
The spec needs to have constraint like:
|
The spec needs to have constraint like:
|
||||||
|
|
||||||
SerialiseCoverage ==
|
SerializeCoverage ==
|
||||||
Serialize(<<TLCGet("spec")>>, CoverageFilename, [format |-> "NDJSON", charset |-> "UTF-8", openOptions |-> <<"WRITE", "CREATE", "APPEND">>])
|
Serialize(<<TLCGet("spec")>>, CoverageFilename, [format |-> "NDJSON", charset |-> "UTF-8", openOptions |-> <<"WRITE", "CREATE", "APPEND">>])
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -93,4 +93,4 @@ INVARIANTS
|
||||||
RetirementCompletedAreRetirementCompletedInv
|
RetirementCompletedAreRetirementCompletedInv
|
||||||
|
|
||||||
_PERIODIC
|
_PERIODIC
|
||||||
SerialiseCoverage
|
SerializeCoverage
|
|
@ -92,4 +92,4 @@ INVARIANTS
|
||||||
RetirementCompletedAreRetirementCompletedInv
|
RetirementCompletedAreRetirementCompletedInv
|
||||||
|
|
||||||
_PERIODIC
|
_PERIODIC
|
||||||
SerialiseCoverage
|
SerializeCoverage
|
Загрузка…
Ссылка в новой задаче