From 990bdbd1cfc6311e15a46ff7a1932449235c78cf Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 20 Oct 2021 19:52:15 +0000 Subject: [PATCH] Add pre-commit configuration (#83) chore: add pre-commit configuration --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- .pre-commit-config.yaml | 17 +++++++++++++++++ docs/Makefile | 2 +- docs/source/_static/styles.css | 2 +- runtests | 2 +- 5 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index eb08391..8977fbc 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -17,8 +17,8 @@ Tell us what happens instead. Not obligatory, but you can suggest a fix or reason for the bug. ## Steps to Reproduce -This is not required, but it would be highly appreciated if you -provided a link to a live example, or an unambiguous set of steps to +This is not required, but it would be highly appreciated if you +provided a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..7e03305 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +# See https://pre-commit.com for more information +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: mixed-line-ending + +- repo: https://github.com/psf/black + rev: 21.9b0 + hooks: + - id: black + language_version: python3 + entry: black --target-version=py36 diff --git a/docs/Makefile b/docs/Makefile index a11fe27..8a7cc4d 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,4 +17,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/source/_static/styles.css b/docs/source/_static/styles.css index 23ac122..041aef1 100644 --- a/docs/source/_static/styles.css +++ b/docs/source/_static/styles.css @@ -10,7 +10,7 @@ pre { } .doc-title h1 { - text-align: center; + text-align: center; padding: 2rem !important; } diff --git a/runtests b/runtests index c71a783..c33f67c 100755 --- a/runtests +++ b/runtests @@ -20,7 +20,7 @@ if __name__ == "__main__": 'tests.attributes', 'tests.misc_models', 'tests.set_and_get', - 'tests.forms' + 'tests.forms', ] else: tests = ['tests.{}'.format(arg) for arg in sys.argv[1:]]