Fix sorting for vulture

This commit is contained in:
Florian Bruhin 2017-08-23 08:33:50 +02:00
parent f1fc078dc1
commit df909ca75b

View File

@ -127,7 +127,8 @@ def report(items):
properties which get used for the items.
"""
output = []
for item in sorted(items, key=lambda e: (e.filename.lower(), e.lineno)):
for item in sorted(items,
key=lambda e: (e.filename.lower(), e.first_lineno)):
relpath = os.path.relpath(item.filename)
path = relpath if not relpath.startswith('..') else item.filename
output.append("{}:{}: Unused {} '{}'".format(path, item.lineno,