fix(linja): incorrect output when maximum number of errors/warnings was reached, fixes #352
This commit is contained in:
parent
9516cd9ee3
commit
3adf5ce1e1
1 changed files with 3 additions and 1 deletions
|
@ -104,6 +104,8 @@ class FlycheckItemList:
|
||||||
self.items = filter(pred, self.items)
|
self.items = filter(pred, self.items)
|
||||||
def append(self, item):
|
def append(self, item):
|
||||||
self.items.append(item)
|
self.items.append(item)
|
||||||
|
def truncate(self, n):
|
||||||
|
del self.items[n:]
|
||||||
def removeExtraItemsStartswith(self, text):
|
def removeExtraItemsStartswith(self, text):
|
||||||
self.sort()
|
self.sort()
|
||||||
newItems = self.items[:1]
|
newItems = self.items[:1]
|
||||||
|
@ -407,7 +409,7 @@ def process_lean_output(target, out, args):
|
||||||
# Add tooManyItemsError at the end if we truncated the list
|
# Add tooManyItemsError at the end if we truncated the list
|
||||||
if n and len(flycheckItemList) > n:
|
if n and len(flycheckItemList) > n:
|
||||||
count = len(flycheckItemList)
|
count = len(flycheckItemList)
|
||||||
flycheckItemList = flycheckItemList[:n]
|
flycheckItemList.truncate(n)
|
||||||
tooManyItemsError = FlycheckItem(target, 1, 0, "error", "For performance, we only display %d errors/warnings out of %d. (lean-flycheck-max-messages-to-display)" % (n, count))
|
tooManyItemsError = FlycheckItem(target, 1, 0, "error", "For performance, we only display %d errors/warnings out of %d. (lean-flycheck-max-messages-to-display)" % (n, count))
|
||||||
flycheckItemList.append(tooManyItemsError)
|
flycheckItemList.append(tooManyItemsError)
|
||||||
print flycheckItemList
|
print flycheckItemList
|
||||||
|
|
Loading…
Add table
Reference in a new issue