diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 14b75d86f5a..0c259cf5672 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -20,7 +20,6 @@ Fixes # - [ ] Write detailed docstrings for all functions/methods. - [ ] If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs. - [ ] If adding new functionality, add an example to docstrings or tutorials. -- [ ] Use underscores (not hyphens) in names of Python files and directories. **Slash Commands** diff --git a/.github/workflows/style_checks.yaml b/.github/workflows/style_checks.yaml index f15bcde0012..43fa5acd6c7 100644 --- a/.github/workflows/style_checks.yaml +++ b/.github/workflows/style_checks.yaml @@ -52,3 +52,15 @@ jobs: rm output.txt exit $nfiles fi + + - name: Ensure hyphens are not used in names of directories and Python files + run: | + git ls-files '*.py' | grep '-' > output.txt || true + git ls-tree -rd --name-only HEAD | grep '-' >> output.txt || true + nfiles=$(wc --lines output.txt | awk '{print $1}') + if [[ $nfiles > 0 ]]; then + echo "Following directories/files use hyphens in file names:" + cat output.txt + rm output.txt + exit $nfiles + fi diff --git a/doc/contributing.md b/doc/contributing.md index 5dd93418f53..36b0d76e984 100644 --- a/doc/contributing.md +++ b/doc/contributing.md @@ -130,9 +130,9 @@ our tests. This way, the *main* branch is always stable. integrated separately. - Bug fixes should be submitted in separate PRs. * How to write and submit a PR - - Use underscores for all Python (*.py) files as per - [PEP8](https://www.python.org/dev/peps/pep-0008/), not hyphens. Directory - names should also use underscores instead of hyphens. + - Use underscores for all Python (\*.py) files as per + [PEP8](https://www.python.org/dev/peps/pep-0008/), not hyphens. Directory names + should also use underscores instead of hyphens. - Describe what your PR changes and *why* this is a good thing. Be as specific as you can. The PR description is how we keep track of the changes made to the project over time.