From 61ca7ee7c2d4deb87a9f4b3ce5538ff3fd8d06fd Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 8 Nov 2018 13:52:34 -0500 Subject: [PATCH] Closes #2559: Add a pre-commit git hook to enforce PEP8 validation --- scripts/git-hooks/pre-commit | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/git-hooks/pre-commit diff --git a/scripts/git-hooks/pre-commit b/scripts/git-hooks/pre-commit new file mode 100755 index 000000000..5974f91d8 --- /dev/null +++ b/scripts/git-hooks/pre-commit @@ -0,0 +1,14 @@ +#!/bin/sh +# Create a link to this file at .git/hooks/pre-commit to +# force PEP8 validation prior to committing +# +# Ignored violations: +# +# W504: Line break after binary operator +# E501: Line too long + +exec 1>&2 + +echo "Validating PEP8 compliance..." +pycodestyle --ignore=W504,E501 netbox/ +