From a483da4221f9203ed8871ae5bdc8a9c0579dbc23 Mon Sep 17 00:00:00 2001 From: gfyoung Date: Mon, 6 Jan 2020 23:18:25 -0800 Subject: [PATCH] CLN: Condense PR style checklist into one script --- .github/PULL_REQUEST_TEMPLATE.md | 3 +-- scripts/quick_style_check.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100755 scripts/quick_style_check.sh diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7c3870470f074..2a86664fcdf75 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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 diff --git a/scripts/quick_style_check.sh b/scripts/quick_style_check.sh new file mode 100755 index 0000000000000..570d9d8611577 --- /dev/null +++ b/scripts/quick_style_check.sh @@ -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