.flake8: fix check for 80/132 columns
authorRicardo Martincoski <ricardo.martincoski@gmail.com>
Tue, 9 Apr 2019 00:17:29 +0000 (21:17 -0300)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Wed, 10 Apr 2019 10:31:33 +0000 (12:31 +0200)
We recommend wrapping at 80 columns but we accept 132 columns when it
makes more readable.

When running flake8 locally, use maximum line length 80.
But when running in GitLab CI, keep the check-flake8 job failing only
for lines longer than 132.

Reported-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
.flake8
.gitlab-ci.yml
.gitlab-ci.yml.in

diff --git a/.flake8 b/.flake8
index 7dd7b541cc058dba2693214b476160648d2e88ac..ee3d5035a020b8c85e72674a5467bf0ac4157047 100644 (file)
--- a/.flake8
+++ b/.flake8
@@ -2,4 +2,4 @@
 exclude=
     # copied from the kernel sources
     utils/diffconfig
-max-line-length=132
+max-line-length=80
index 572868a557d38ce31ac3275395cbd99a747f9277..e62e1c3e384c1f462601a043d44e7c80aa8fc076 100644 (file)
@@ -38,7 +38,7 @@ check-flake8:
         - find * -type f -print0 | xargs -0 file | grep 'Python script' | cut -d':' -f1 >> files.txt
         - sort -u files.txt | tee files.processed
     script:
-        - python -m flake8 --statistics --count $(cat files.processed)
+        - python -m flake8 --statistics --count --max-line-length=132 $(cat files.processed)
     after_script:
         - wc -l files.processed
 
index a50684089243c44d1e18db6d3495b267914a9946..b1ec671867c092e5183ba4eead25a5d8b29d17fa 100644 (file)
@@ -38,7 +38,7 @@ check-flake8:
         - find * -type f -print0 | xargs -0 file | grep 'Python script' | cut -d':' -f1 >> files.txt
         - sort -u files.txt | tee files.processed
     script:
-        - python -m flake8 --statistics --count $(cat files.processed)
+        - python -m flake8 --statistics --count --max-line-length=132 $(cat files.processed)
     after_script:
         - wc -l files.processed