Skip to content
Closed
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
8 changes: 6 additions & 2 deletions dev/sparktestsupport/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@ def determine_modules_for_files(filenames):
Given a list of filenames, return the set of modules that contain those files.
If a file is not associated with a more specific submodule, then this method will consider that
file to belong to the 'root' module. `.github` directory is counted only in GitHub Actions,
and `README.md` is always ignored.
and `README.md`, `AGENTS.md`, `CONTRIBUTING.md` are always ignored.

>>> sorted(x.name for x in determine_modules_for_files(["python/pyspark/a.py", "sql/core/foo"]))
['pyspark-core', 'pyspark-errors', 'sql']
>>> [x.name for x in determine_modules_for_files(["file_not_matched_by_any_subproject"])]
['root']
>>> [x.name for x in determine_modules_for_files(["sql/README.md"])]
[]
>>> [x.name for x in determine_modules_for_files(["AGENTS.md"])]
[]
>>> [x.name for x in determine_modules_for_files(["CONTRIBUTING.md"])]
[]
"""
changed_modules = set()
for filename in filenames:
if filename.endswith("README.md"):
if filename.endswith(("README.md", "AGENTS.md", "CONTRIBUTING.md")):
continue
if filename in (
"scalastyle-config.xml",
Expand Down