Skip to content

CLN: Condense PR style checklist into one script #30773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] passes `./scripts/quick_style_check.sh`
- [ ] whatsnew entry
24 changes: 24 additions & 0 deletions scripts/quick_style_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

lint_files() {
git diff upstream/master --name-only -u -- "*.py" | xargs -r $1
}

echo "FLAKE8 check: it passes if no errors are reported"
echo ""

lint_files flake8

echo ""
echo "ISORT check: it passes if no files need to be fixed"
echo "If fixes are made, please commit those with your changes"
echo ""

lint_files isort

echo ""
echo "BLACK check: it passes if no files need to be reformatted"
echo "If reformats are done, please commit those with your changes"
echo ""

lint_files black