Skip to content

Commit 20b8ee8

Browse files
authored
fix: Fixed workdir access to the script (#8)
* fix: Fixed workdir access to the script * ci: Added volume for test * ci: Mimicked GH action workflow * test: Added header error to check * docs: Fixed header * docs: Added header issue for check * ci: Updated docker volume * docs: Fixed header
1 parent ed8464f commit 20b8ee8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
- name: Build docker
2323
run: docker build . -t header-validator:py3.8.13-alpine
2424
- name: Run action
25-
run: docker run header-validator:py3.8.13-alpine Apache-2.0 'François-Guillaume Fernandez' 2022 src/ __init__.py
25+
run: docker run --workdir /github/workspace -v "/home/runner/work/validate-python-headers/validate-python-headers":"/github/workspace" header-validator:py3.8.13-alpine Apache-2.0 'François-Guillaume Fernandez' 2022 src/ __init__.py

src/validate_headers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def main(args):
4343

4444
# For every python file in the repository
4545
for folder in FOLDERS:
46-
for source_path in Path(__file__).parent.parent.joinpath(folder).rglob("**/*.py"):
46+
folder_path = Path(folder)
47+
assert folder_path.is_dir(), f"Invalid folder path: {folder}"
48+
for source_path in folder_path.rglob("**/*.py"):
4749
if source_path.name not in IGNORED_FILES:
4850
# Parse header
4951
header_length = max(len(option) for option in HEADERS)

0 commit comments

Comments
 (0)