Skip to content

Commit

Permalink
Revert ".flake8: fix check for 80/132 columns"
Browse files Browse the repository at this point in the history
Commit 7d17ae2 (.flake8: fix check for 80/132 columns) introduced a
difference in how flake8 behaves between the automatic checks done in
the CI, where the maximum line length is 132, and the local checks,
where the maximum line length is 80.

The rationale at the time was that we recommend 80 char lines, but that
we accept 132 when it makes sense for readability.

However, this is very annoying when running flake8 locally, because of
two reasons:

 1. human reviews on python scripts have not been as thorough as we did
    expect; indeed, we've let a lot of long lines slip through; this
    causes a lot of spurious failures that hide away the actual errors;

 2. when hacking on a python script, the issues reported will not be
    caused by the current changes, so the many reported failures
    actually hide away the newly introduced issues.

Additionally, our 'make check-flake8' rule already enforces the 132-char
limit, and the issues reported are different than when manually running
flake8 on individual files.

Furthermore, the readability rationale for the 80-char limit is
definitely shattered by the mere rationale of allowing 132-char limit
for... readability...

We've arrived to a point where this separation is causing our checks
around flake8 to become mostly unusable and useless, as they do not
report meaningful issues, and people are no longer paying attention, and
this has caused actual issues to be introduced.

Finally, terminal emulators of today have long lifted the 80-char limit,
and are more than capable of displaying 132-char wide lines.

Switch back to using a 132-char limit.

This reverts commit 7d17ae2.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  • Loading branch information
yann-morin-1998 authored and tpetazzoni committed Jan 2, 2021
1 parent 7dcddac commit 3b10ee3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .flake8
Expand Up @@ -2,4 +2,4 @@
exclude=
# copied from the kernel sources
utils/diffconfig
max-line-length=80
max-line-length=132
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -1223,7 +1223,7 @@ check-flake8:
| xargs file \
| grep 'Python script' \
| cut -d':' -f1 \
| xargs -- python3 -m flake8 --statistics --max-line-length=132
| xargs -- python3 -m flake8 --statistics

check-package:
find $(TOPDIR) -type f \( -name '*.mk' -o -name '*.hash' -o -name 'Config.*' \) \
Expand Down

0 comments on commit 3b10ee3

Please sign in to comment.