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

branch
eric7
changeset 10043
f1427d95cfde
parent 9653
e67609152c5e
child 10046
35b27af462ef
equal deleted inserted replaced
10042:ca636e8d80fd 10043:f1427d95cfde
575 "ForceFutureAnnotations": defaultParameters[ 575 "ForceFutureAnnotations": defaultParameters[
576 "AnnotationsChecker" 576 "AnnotationsChecker"
577 ]["ForceFutureAnnotations"], 577 ]["ForceFutureAnnotations"],
578 } 578 }
579 ) 579 )
580 if "CheckFutureAnnotations" not in self.__data["AnnotationsChecker"]:
581 # third extension
582 self.__data["AnnotationsChecker"]["CheckFutureAnnotations"] = (
583 defaultParameters["AnnotationsChecker"]["CheckFutureAnnotations"]
584 )
580 585
581 # Upgrading ImportsChecker from older data structures 586 # Upgrading ImportsChecker from older data structures
582 if "CombinedAsImports" not in self.__data["ImportsChecker"]: 587 if "CombinedAsImports" not in self.__data["ImportsChecker"]:
583 self.__data["ImportsChecker"].update( 588 self.__data["ImportsChecker"].update(
584 { 589 {
658 self.allowStarArgAnyCheckBox.setChecked( 663 self.allowStarArgAnyCheckBox.setChecked(
659 self.__data["AnnotationsChecker"]["AllowStarArgAny"] 664 self.__data["AnnotationsChecker"]["AllowStarArgAny"]
660 ) 665 )
661 self.forceFutureAnnotationsCheckBox.setChecked( 666 self.forceFutureAnnotationsCheckBox.setChecked(
662 self.__data["AnnotationsChecker"]["ForceFutureAnnotations"] 667 self.__data["AnnotationsChecker"]["ForceFutureAnnotations"]
668 )
669 self.simplifiedTypesCheckBox.setChecked(
670 self.__data["AnnotationsChecker"]["CheckFutureAnnotations"]
663 ) 671 )
664 self.dispatchDecoratorEdit.setText( 672 self.dispatchDecoratorEdit.setText(
665 ", ".join(self.__data["AnnotationsChecker"]["DispatchDecorators"]) 673 ", ".join(self.__data["AnnotationsChecker"]["DispatchDecorators"])
666 ) 674 )
667 self.overloadDecoratorEdit.setText( 675 self.overloadDecoratorEdit.setText(
867 "MypyInitReturn": self.mypyInitReturnCheckBox.isChecked(), 875 "MypyInitReturn": self.mypyInitReturnCheckBox.isChecked(),
868 "AllowStarArgAny": self.allowStarArgAnyCheckBox.isChecked(), 876 "AllowStarArgAny": self.allowStarArgAnyCheckBox.isChecked(),
869 "ForceFutureAnnotations": ( 877 "ForceFutureAnnotations": (
870 self.forceFutureAnnotationsCheckBox.isChecked() 878 self.forceFutureAnnotationsCheckBox.isChecked()
871 ), 879 ),
880 "CheckFutureAnnotations": self.simplifiedTypesCheckBox.isChecked(),
872 "DispatchDecorators": [ 881 "DispatchDecorators": [
873 d.strip() for d in self.dispatchDecoratorEdit.text().split(",") 882 d.strip() for d in self.dispatchDecoratorEdit.text().split(",")
874 ], 883 ],
875 "OverloadDecorators": [ 884 "OverloadDecorators": [
876 d.strip() for d in self.overloadDecoratorEdit.text().split(",") 885 d.strip() for d in self.overloadDecoratorEdit.text().split(",")
1309 "MypyInitReturn": self.mypyInitReturnCheckBox.isChecked(), 1318 "MypyInitReturn": self.mypyInitReturnCheckBox.isChecked(),
1310 "AllowStarArgAny": self.allowStarArgAnyCheckBox.isChecked(), 1319 "AllowStarArgAny": self.allowStarArgAnyCheckBox.isChecked(),
1311 "ForceFutureAnnotations": ( 1320 "ForceFutureAnnotations": (
1312 self.forceFutureAnnotationsCheckBox.isChecked() 1321 self.forceFutureAnnotationsCheckBox.isChecked()
1313 ), 1322 ),
1323 "CheckFutureAnnotations": self.simplifiedTypesCheckBox.isChecked(),
1314 "DispatchDecorators": [ 1324 "DispatchDecorators": [
1315 d.strip() for d in self.dispatchDecoratorEdit.text().split(",") 1325 d.strip() for d in self.dispatchDecoratorEdit.text().split(",")
1316 ], 1326 ],
1317 "OverloadDecorators": [ 1327 "OverloadDecorators": [
1318 d.strip() for d in self.overloadDecoratorEdit.text().split(",") 1328 d.strip() for d in self.overloadDecoratorEdit.text().split(",")
1749 "PEP8/ForceFutureAnnotations", 1759 "PEP8/ForceFutureAnnotations",
1750 defaultParameters["AnnotationsChecker"]["ForceFutureAnnotations"], 1760 defaultParameters["AnnotationsChecker"]["ForceFutureAnnotations"],
1751 ) 1761 )
1752 ) 1762 )
1753 ) 1763 )
1764 self.simplifiedTypesCheckBox.setChecked(
1765 Preferences.toBool(
1766 settings.value(
1767 "PEP8/CheckFutureAnnotations",
1768 defaultParameters["AnnotationsChecker"]["CheckFutureAnnotations"],
1769 )
1770 )
1771 )
1754 self.dispatchDecoratorEdit.setText( 1772 self.dispatchDecoratorEdit.setText(
1755 ", ".join( 1773 ", ".join(
1756 Preferences.toList( 1774 Preferences.toList(
1757 settings.value( 1775 settings.value(
1758 "PEP8/DispatchDecorators", 1776 "PEP8/DispatchDecorators",
2005 settings.setValue( 2023 settings.setValue(
2006 "PEP8/ForceFutureAnnotations", 2024 "PEP8/ForceFutureAnnotations",
2007 self.forceFutureAnnotationsCheckBox.isChecked(), 2025 self.forceFutureAnnotationsCheckBox.isChecked(),
2008 ) 2026 )
2009 settings.setValue( 2027 settings.setValue(
2028 "PEP8/CheckFutureAnnotations", self.simplifiedTypesCheckBox.isChecked()
2029 )
2030 settings.setValue(
2010 "PEP8/DispatchDecorators", 2031 "PEP8/DispatchDecorators",
2011 [d.strip() for d in self.dispatchDecoratorEdit.text().split(",")], 2032 [d.strip() for d in self.dispatchDecoratorEdit.text().split(",")],
2012 ) 2033 )
2013 settings.setValue( 2034 settings.setValue(
2014 "PEP8/OverloadDecorators", 2035 "PEP8/OverloadDecorators",
2167 defaultParameters["AnnotationsChecker"]["AllowStarArgAny"], 2188 defaultParameters["AnnotationsChecker"]["AllowStarArgAny"],
2168 ) 2189 )
2169 settings.setValue( 2190 settings.setValue(
2170 "PEP8/ForceFutureAnnotations", 2191 "PEP8/ForceFutureAnnotations",
2171 defaultParameters["AnnotationsChecker"]["ForceFutureAnnotations"], 2192 defaultParameters["AnnotationsChecker"]["ForceFutureAnnotations"],
2193 )
2194 settings.setValue(
2195 "PEP8/CheckFutureAnnotations",
2196 defaultParameters["AnnotationsChecker"]["CheckFutureAnnotations"],
2172 ) 2197 )
2173 settings.setValue( 2198 settings.setValue(
2174 "PEP8/DispatchDecorators", 2199 "PEP8/DispatchDecorators",
2175 defaultParameters["AnnotationsChecker"]["DispatchDecorators"], 2200 defaultParameters["AnnotationsChecker"]["DispatchDecorators"],
2176 ) 2201 )

eric ide

mercurial