Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gitgalaxy/core/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ def _cpp_class_has_body(code_stream: str, scan_start: int) -> bool:
# control-flow keywords and cross-language builtins the invocation regexes
# cannot distinguish from user calls. Case-sensitive on purpose: languages
# whose keywords are case-insensitive (fortran, abap, pli, rexx, db2_sql, ada)
# declare their own lowercase words via the per-language `calls_out_ignore`
# declare their own lowercase words via the per-language `_calls_out_ignore`
# rule, which is compared casefolded at the filter site.
_CALLS_OUT_GLOBAL_IGNORE = frozenset(
{
Expand Down Expand Up @@ -8708,7 +8708,7 @@ def _calculate_block_metrics(
# Per-language additions to the global ignore set (Epic #3264 Phase 3).
# Authored lowercase in the profile and compared casefolded, so
# case-insensitive languages filter their keywords in any spelling.
lang_ignore = rules.get("calls_out_ignore") or frozenset()
lang_ignore = rules.get("_calls_out_ignore") or frozenset()
# Deduplicate and filter (excluding the function calling itself recursively)
calls_out = list(
dict.fromkeys(
Expand Down
1 change: 1 addition & 0 deletions gitgalaxy/standards/signal_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ def _c(name, phase, kind, contract, **kw): # tabular constructor, see rows belo
"_visibility_export": "per-function export-statement form, for the api orphan census (#2727/#2729)",
"_visibility_export_list": "capture group(s) = a region holding MANY exported names, same census (#2823)",
"_args_arrow_count_groups": "args strategy: arrow-function parameter groups",
"_calls_out_ignore": "frozenset of lowercase callee names UNIONed with the detector's global calls_out ignore set, compared casefolded (case-insensitive languages filter keywords in any spelling) -- Epic #3264 Phase 3 (#3282)",
"_args_bare_body_groups": "args strategy: bare-body parameter groups",
"_args_colon_selector_groups": "args strategy: colon-selector parameter groups (objective-c)",
"_args_findall_max_groups": "args strategy: take the maximum over findall groups",
Expand Down
6 changes: 3 additions & 3 deletions tests/core_engine/test_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ def test_detector_classification_and_wiring():

def test_detector_calls_out_language_ignore_union():
"""
Proves the per-language `calls_out_ignore` rule (Epic #3264 Phase 3) is
Proves the per-language `_calls_out_ignore` rule (Epic #3264 Phase 3) is
unioned with the global ignore set and compared casefolded: a language
authoring lowercase words filters them in any spelling (case-insensitive
languages get correct behavior for free), while the global set keeps
Expand All @@ -1121,7 +1121,7 @@ def test_detector_calls_out_language_ignore_union():
"rules": {
"func_start": re.compile(r"^[ \t]*def\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*\(", re.M),
"calls_out": re.compile(r"\b([a-zA-Z_][a-zA-Z0-9_]*)\s*\("),
"calls_out_ignore": frozenset({"open"}),
"_calls_out_ignore": frozenset({"open"}),
},
}
}
Expand All @@ -1132,7 +1132,7 @@ def test_detector_calls_out_language_ignore_union():
func = result["functions"][0]

assert func["calls_out_to"] == ["db_insert"], (
"calls_out_ignore must filter casefolded (OPEN/Open) and the global "
"_calls_out_ignore must filter casefolded (OPEN/Open) and the global "
f"set must keep filtering (print); got {func['calls_out_to']}"
)

Expand Down
2 changes: 1 addition & 1 deletion tests/dead_key_audit_baseline.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"calls_out_ignore": "Read added by the #3282 foundation (Epic #3264 Phase 3) ahead of its writers by design: the per-language ignore sets land in #3284-#3287, and the foundation must merge first while staying output-neutral. Remove this entry in the first batch PR that ships a rules['calls_out_ignore'] set."
"_calls_out_ignore": "Read added by the #3282 foundation (Epic #3264 Phase 3) ahead of its writers by design: the per-language ignore sets land in #3284-#3287, and the foundation must merge first while staying output-neutral. Remove this entry in the first batch PR that ships a rules['_calls_out_ignore'] set."
}
Loading