src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py

branch
eric7
changeset 11002
0c62941f8baa
parent 10806
2f6df822e3b9
child 11006
a671918232f3
equal deleted inserted replaced
11001:ca835b2c0f53 11002:0c62941f8baa
1591 if item.parent(): 1591 if item.parent():
1592 fn = item.data(0, self.filenameRole) 1592 fn = item.data(0, self.filenameRole)
1593 lineno = item.data(0, self.lineRole) 1593 lineno = item.data(0, self.lineRole)
1594 position = item.data(0, self.positionRole) 1594 position = item.data(0, self.positionRole)
1595 message = item.data(0, self.messageRole) 1595 message = item.data(0, self.messageRole)
1596 code = item.data(0, self.codeRole) 1596 issueCode = item.data(0, self.codeRole)
1597 1597
1598 vm = ericApp().getObject("ViewManager") 1598 vm = ericApp().getObject("ViewManager")
1599 vm.openSourceFile(fn, lineno=lineno, pos=position + 1) 1599 vm.openSourceFile(fn, lineno=lineno, pos=position + 1)
1600 editor = vm.getOpenEditor(fn) 1600 editor = vm.getOpenEditor(fn)
1601 1601
1602 if code in ["E901", "E902"]: 1602 if issueCode in ["E901", "E902"]:
1603 editor.toggleSyntaxError(lineno, 0, True, message, True) 1603 editor.toggleSyntaxError(lineno, 0, True, message, True)
1604 else: 1604 else:
1605 editor.toggleWarning( 1605 editor.toggleWarning(
1606 lineno, 0, True, message, warningType=EditorWarningKind.Style 1606 lineno,
1607 0,
1608 True,
1609 self.tr("{0} - {1}", "issue code, message").format(
1610 issueCode, message
1611 ),
1612 warningType=EditorWarningKind.Style,
1607 ) 1613 )
1608 1614
1609 editor.updateVerticalScrollBar() 1615 editor.updateVerticalScrollBar()
1610 1616
1611 @pyqtSlot() 1617 @pyqtSlot()
1635 vm.openSourceFile(fn, 1) 1641 vm.openSourceFile(fn, 1)
1636 editor = vm.getOpenEditor(fn) 1642 editor = vm.getOpenEditor(fn)
1637 editor.clearStyleWarnings() 1643 editor.clearStyleWarnings()
1638 for cindex in range(itm.childCount()): 1644 for cindex in range(itm.childCount()):
1639 citm = itm.child(cindex) 1645 citm = itm.child(cindex)
1640 lineno = citm.data(0, self.lineRole)
1641 message = citm.data(0, self.messageRole)
1642 editor.toggleWarning( 1646 editor.toggleWarning(
1643 lineno, 0, True, message, warningType=EditorWarningKind.Style 1647 citm.data(0, self.lineRole),
1648 0,
1649 True,
1650 self.tr("{0} - {1}", "issue code, message").format(
1651 citm.data(0, self.codeRole),
1652 citm.data(0, self.messageRole),
1653 ),
1654 warningType=EditorWarningKind.Style,
1644 ) 1655 )
1645 1656
1646 # go through the list again to clear warning markers for files, 1657 # go through the list again to clear warning markers for files,
1647 # that are ok 1658 # that are ok
1648 openFiles = vm.getOpenFilenames() 1659 openFiles = vm.getOpenFilenames()

eric ide

mercurial