Patchwork [02,of,12,topics] tests: add flake8 check

login
register
mail settings
Submitter Sean Farley
Date Aug. 31, 2016, 3:58 a.m.
Message ID <78dd9f1db1b1cf5a869e.1472615888@laptop.local>
Download mbox | patch
Permalink /patch/16505/
State Accepted
Headers show

Comments

Sean Farley - Aug. 31, 2016, 3:58 a.m.
# HG changeset patch
# User Sean Farley <sean@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?

Patch

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