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
1 change: 1 addition & 0 deletions tools/get_maintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
matched_maintainers = set()

for file in files_to_check:
file = file.replace("\\", "/")
for section in sections:
for path in section["files"]:
# Direct folder matching (Wave-style directory structure)
Expand Down
21 changes: 21 additions & 0 deletions tools/test_get_maintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,27 @@ def test_invocation_outside_repository_root(self):
self.assertIn("Maintainers to CC:", result.stdout)
self.assertNotIn("MAINTAINERS file not found", result.stdout)

def run_script(self, path):
return subprocess.run(
[sys.executable, str(SCRIPT), path],
cwd=ROOT,
capture_output=True,
text=True,
check=False,
)

def test_windows_and_repository_paths_match_same_section(self):
unix = self.run_script("front/parser/file.rs")
windows = self.run_script(r"front\parser\file.rs")

self.assertEqual(unix.returncode, 0, unix.stderr)
self.assertEqual(windows.returncode, 0, windows.stderr)
self.assertEqual(windows.stdout, unix.stdout)
self.assertIn("Maintainers to CC:", windows.stdout)

sibling = self.run_script(r"front\parser-other\file.rs")
self.assertIn("Using default", sibling.stdout)


if __name__ == "__main__":
unittest.main()
Loading