Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# - `special_sanity`: a suite of quick sanity tests
# - `special_standalone`: a set of test that are designed to run in dedicated environments

# Accelerators for tests
# Accelerators for tests
# - By default tests are run with GPU available, except for the ones under `special_npu`, and any test script whose name ends with `on_cpu.py`.
# - For test scripts with `on_cpu.py` name suffix would be tested on CPU resources in linux environment.

Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
pytest -s -x tests/special_sanity
- name: Run license test
run: |
python3 tests/special_sanity/check_license.py --directory .
python3 tests/special_sanity/check_license.py --directories .
- name: Assert naming convention
run: |
if grep -rIn --exclude-dir=.git --exclude-dir=.github --exclude-dir=venv --exclude-dir=__pycache__ 'veRL' .; then
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ repos:
hooks:
- id: check-license
name: Check license
entry: python3 tests/special_sanity/check_license.py --directory .
entry: python3 tests/special_sanity/check_license.py --directories examples recipe scripts tests verl setup.py
language: python
pass_filenames: false
14 changes: 11 additions & 3 deletions tests/special_sanity/check_license.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@

if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--directory", "-d", required=True, type=str)
parser.add_argument(
"--directories",
"-d",
required=True,
type=Path,
nargs="+",
help="List of directories to check for license headers",
)
args = parser.parse_args()
directory_in_str = args.directory

pathlist = Path(directory_in_str).glob("**/*.py")
# Collect all Python files from specified directories
pathlist = set(path for directory in args.directories for path in directory.glob("**/*.py"))

for path in pathlist:
# because path is object not string
path_in_str = str(path.absolute())
Expand Down