Commit Graph

6 Commits

Author SHA1 Message Date
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Ross Bayer
7d1411ecdb [Python] Update the utils/80+-check script to be Python 2/3 compatible and conform to the black style. 2020-02-06 15:25:30 -08:00
Hugh Bellamy
8671854674 Properly python lint remaining files 2017-03-23 14:06:46 +07:00
Alex Chan
a3483cf731 Python improvements in utils/80+-check
* The original version had an off-by-one error in the line number
  (assuming you use the GitHub model of starting lines at 1).  Fix this
  error, and move to using `enumerate()` instead of tracking the
  `count` variable ourselves.
* Add a comment about the exit codes to the help message.
* Increase clarity in variable/argument names.
2016-06-19 07:52:55 +01:00
practicalswift
a75b3436b3 [Python] Remove unused import 2016-04-02 11:07:44 +02:00
Michael Gottesman
b1ffbf893e Add a new utility called 80+-check.
This utility takes input from stdin and prints out any lines that are longer
than 80+ lines. If it finds any such violations it prints out the line number,
the length of the line, and a version of the line with the left and right sides
of the line stripped of whitespace. The stripping is done so that useful output
is provided even when a line has a large amount of whitespace (something that
can happen when copy/pasting in terminal).

If any violation is found while processing the lines of the file, the script
fails. This happens only after all lines have been processed.
2016-04-01 22:26:31 -07:00