Explorar o código

.flake8: fix check for 80/132 columns

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>
Ricardo Martincoski %!s(int64=6) %!d(string=hai) anos
pai
achega
7d17ae2acf
Modificáronse 3 ficheiros con 3 adicións e 3 borrados
  1. 1 1
      .flake8
  2. 1 1
      .gitlab-ci.yml
  3. 1 1
      .gitlab-ci.yml.in

+ 1 - 1
.flake8

@@ -2,4 +2,4 @@
 exclude=
 exclude=
     # copied from the kernel sources
     # copied from the kernel sources
     utils/diffconfig
     utils/diffconfig
-max-line-length=132
+max-line-length=80

+ 1 - 1
.gitlab-ci.yml

@@ -38,7 +38,7 @@ check-flake8:
         - find * -type f -print0 | xargs -0 file | grep 'Python script' | cut -d':' -f1 >> files.txt
         - find * -type f -print0 | xargs -0 file | grep 'Python script' | cut -d':' -f1 >> files.txt
         - sort -u files.txt | tee files.processed
         - sort -u files.txt | tee files.processed
     script:
     script:
-        - python -m flake8 --statistics --count $(cat files.processed)
+        - python -m flake8 --statistics --count --max-line-length=132 $(cat files.processed)
     after_script:
     after_script:
         - wc -l files.processed
         - wc -l files.processed
 
 

+ 1 - 1
.gitlab-ci.yml.in

@@ -38,7 +38,7 @@ check-flake8:
         - find * -type f -print0 | xargs -0 file | grep 'Python script' | cut -d':' -f1 >> files.txt
         - find * -type f -print0 | xargs -0 file | grep 'Python script' | cut -d':' -f1 >> files.txt
         - sort -u files.txt | tee files.processed
         - sort -u files.txt | tee files.processed
     script:
     script:
-        - python -m flake8 --statistics --count $(cat files.processed)
+        - python -m flake8 --statistics --count --max-line-length=132 $(cat files.processed)
     after_script:
     after_script:
         - wc -l files.processed
         - wc -l files.processed