Skip to content

Commit a01c49f

Browse files
authored
Only check for public symbols in public packages (open-telemetry#2458)
1 parent e0a4f31 commit a01c49f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/public_symbols_checker.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,18 @@ def get_symbols(change_type, diff_lines_getter, prefix):
3434
):
3535

3636
b_file_path = diff_lines.b_blob.path
37+
b_file_path_obj = Path(b_file_path)
3738

3839
if (
39-
Path(b_file_path).suffix != ".py"
40+
b_file_path_obj.suffix != ".py"
4041
or "opentelemetry" not in b_file_path
42+
or any(
43+
# single leading underscore
44+
part[0] == "_" and part[1] != "_"
45+
# tests directories
46+
or part == "tests"
47+
for part in b_file_path_obj.parts
48+
)
4149
):
4250
continue
4351

0 commit comments

Comments
 (0)