Skip to content

Commit fede4d4

Browse files
committed
adjust for decorator usage
Signed-off-by: Pablo Garay <[email protected]>
1 parent c6dc162 commit fede4d4

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

scripts/check_api_backwards_compatibility.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,31 @@ def experimental_feature():
425425
(getattr(change, 'new_value', None) and getattr(change.new_value, 'path', None)) or
426426
extract_path_from_explanation(change))
427427

428-
# Skip if either path is in our filtered set
429-
if old_path and old_path in all_filtered:
430-
continue
431-
if new_path and new_path in all_filtered:
428+
# Skip if either path is in our filtered set or is a child of a filtered object
429+
skip_old = False
430+
skip_new = False
431+
432+
if old_path:
433+
# Check exact match or if it's a child (e.g., MyClass.__init__)
434+
if old_path in all_filtered:
435+
skip_old = True
436+
else:
437+
for filtered_path in all_filtered:
438+
if old_path.startswith(filtered_path + '.'):
439+
skip_old = True
440+
break
441+
442+
if new_path:
443+
# Check exact match or if it's a child (e.g., MyClass.__init__)
444+
if new_path in all_filtered:
445+
skip_new = True
446+
else:
447+
for filtered_path in all_filtered:
448+
if new_path.startswith(filtered_path + '.'):
449+
skip_new = True
450+
break
451+
452+
if skip_old or skip_new:
432453
continue
433454

434455
# Skip paths with circular/repeated segments (false positives from import cycles)

0 commit comments

Comments
 (0)