mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 03:49:26 +00:00
chore: format the whole tree and lint the scratch measurement scripts; CI has been red since 25ae4b4
CI runs ruff format --check and ruff check over the whole repository; 29 files had drifted from the formatter and
four measurement scripts carried lint findings, so every push since 25ae4b4 failed before pytest ran.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
fbbc03f3ea
commit
0d7d3f0dc9
@@ -7,15 +7,23 @@ from openultrasast.hunt.table import FeatureTable
|
||||
|
||||
|
||||
def positive():
|
||||
return {"kind": "vulnerability", "path": "app.py", "function": "handle", "function_lines": [10, 20],
|
||||
"family": "injection", "case_id": "verified-case"}
|
||||
return {
|
||||
"kind": "vulnerability",
|
||||
"path": "app.py",
|
||||
"function": "handle",
|
||||
"function_lines": [10, 20],
|
||||
"family": "injection",
|
||||
"case_id": "verified-case",
|
||||
}
|
||||
|
||||
|
||||
def test_labels_match_name_or_span_on_same_path():
|
||||
rows = [{"path": "app.py", "function": "handle", "line": 1},
|
||||
{"path": "app.py", "function": "nested", "line": 12},
|
||||
{"path": "other.py", "function": "handle", "line": 12},
|
||||
{"path": "app.py", "function": "other", "line": 30}]
|
||||
rows = [
|
||||
{"path": "app.py", "function": "handle", "line": 1},
|
||||
{"path": "app.py", "function": "nested", "line": 12},
|
||||
{"path": "other.py", "function": "handle", "line": 12},
|
||||
{"path": "app.py", "function": "other", "line": 30},
|
||||
]
|
||||
labelled = label_rows(rows, positive())
|
||||
assert [r["label"] for r in labelled] == [1, 1, None, None]
|
||||
for data in labelled[:2]:
|
||||
|
||||
Reference in New Issue
Block a user