[PATCH 02 of 12 topics] tests: add flake8 check

Sean Farley sean at farley.io
Tue Aug 30 23:58:08 EDT 2016


# HG changeset patch
# User Sean Farley <sean at farley.io>
# Date 1472591136 25200
#      Tue Aug 30 14:05:36 2016 -0700
# Node ID 78dd9f1db1b1cf5a869e1240bb4ed523e930c907
# Parent  103df0c9da1af239431530cd44eec1826d411f0a
# EXP-Topic flake8
tests: add flake8 check

This test will hopefully help prevent style errors. To be determined:
which errors / warnings to ignore?

diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t
--- a/tests/test-check-pyflakes.t
+++ b/tests/test-check-pyflakes.t
@@ -8,5 +8,8 @@ run pyflakes on all tracked files ending
 (skipping binary file random-seed)
 
   $ hg locate 'set:**.py or grep("^!#.*python")' 2>/dev/null \
   > | xargs pyflakes 2>/dev/null  
 
+run flake8 if it exists; if it doesn't, then just skip
+
+  $ type flake8 >/dev/null 2>/dev/null && hg files -0 'glob:**.py' | xargs -0 flake8 || true


More information about the Mercurial-devel mailing list