cfv-project / cfv

Command-line File Verify
GNU General Public License v2.0
58 stars 10 forks source link

Fix flake8 issues #14

Closed lxp closed 4 years ago

lxp commented 4 years ago

Flake8 is currently running in non-fatal mode in our CI because of some issues. We should fix the issues and make flake8 fail our pipeline again.

$ flake8 --exclude=build,venv --ignore= --max-line-length=200 --max-complexity=75 --show-source --statistics .
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/2.7.18/x64
./lib/cfv/osutil.py:112:78: E741 ambiguous variable name 'I'
def strippath(filename, num='a', _splitdrivere=re.compile(r'[a-z]:[/\\]', re.I)):
                                                                             ^
./lib/cfv/common.py:738:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:900:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1400:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1505:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1537:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1572:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1649:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/strutil.py:6:14: E741 ambiguous variable name 'l'
def safesort(l):
             ^
./test/cfvtest.py:49:26: E741 ambiguous variable name 'l'
    def writelines(self, l):
                         ^
10    E741 ambiguous variable name 'l'
Error: Process completed with exit code 1.
mtausig commented 4 years ago

Relevant part of the flake documentation: https://www.flake8rules.com/rules/E741.html

Do not use variables named 'I', 'O', or 'l' (E741) Variables named I, O, and l can be very hard to read. This is because the letter I and the letter l are easily confused, and the letter O and the number 0 can be easily confused. Change the names of these variables to something more descriptive.