503 "CombinedAsImports": False, |
503 "CombinedAsImports": False, |
504 "SortIgnoringStyle": False, |
504 "SortIgnoringStyle": False, |
505 "SortFromFirst": False, |
505 "SortFromFirst": False, |
506 }, |
506 }, |
507 # Unused |
507 # Unused |
508 # TODO: add 'IgnoreSlotMethods' (pyqtSlot, Slot) |
|
509 "UnusedChecker": { |
508 "UnusedChecker": { |
510 "IgnoreAbstract": False, |
509 "IgnoreAbstract": True, |
511 "IgnoreOverload": False, |
510 "IgnoreOverload": True, |
512 "IgnoreOverride": False, |
511 "IgnoreOverride": True, |
513 "IgnoreSlotMethods": False, |
512 "IgnoreSlotMethods": False, |
514 "IgnoreStubs": False, |
513 "IgnoreStubs": True, |
515 "IgnoreVariadicNames": False, |
514 "IgnoreVariadicNames": False, |
516 "IgnoreLambdas": False, |
515 "IgnoreLambdas": False, |
517 "IgnoreNestedFunctions": False, |
516 "IgnoreNestedFunctions": False, |
518 "IgnoreDunderMethods": False, |
517 "IgnoreDunderMethods": True, |
|
518 "IgnoreDunderGlobals": True, |
519 }, |
519 }, |
520 } |
520 } |
521 |
521 |
522 return defaults |
522 return defaults |
523 |
523 |
761 self.__data["UnusedChecker"]["IgnoreDunderMethods"] |
761 self.__data["UnusedChecker"]["IgnoreDunderMethods"] |
762 ) |
762 ) |
763 self.ignoreSlotsCheckBox.setChecked( |
763 self.ignoreSlotsCheckBox.setChecked( |
764 self.__data["UnusedChecker"]["IgnoreSlotMethods"] |
764 self.__data["UnusedChecker"]["IgnoreSlotMethods"] |
765 ) |
765 ) |
|
766 self.ignoreDunderGlobalsCheckBox.setChecked( |
|
767 self.__data["UnusedChecker"]["IgnoreDunderGlobals"] |
|
768 ) |
766 |
769 |
767 self.__cleanupData() |
770 self.__cleanupData() |
768 |
771 |
769 def __prepareProgress(self): |
772 def __prepareProgress(self): |
770 """ |
773 """ |
964 "IgnoreVariadicNames": self.ignoreVariadicNamesCheckBox.isChecked(), |
967 "IgnoreVariadicNames": self.ignoreVariadicNamesCheckBox.isChecked(), |
965 "IgnoreLambdas": self.ignoreLambdasCheckBox.isChecked(), |
968 "IgnoreLambdas": self.ignoreLambdasCheckBox.isChecked(), |
966 "IgnoreNestedFunctions": self.ignoreNestedFunctionsCheckBox.isChecked(), |
969 "IgnoreNestedFunctions": self.ignoreNestedFunctionsCheckBox.isChecked(), |
967 "IgnoreDunderMethods": self.ignoreDunderMethodsCheckBox.isChecked(), |
970 "IgnoreDunderMethods": self.ignoreDunderMethodsCheckBox.isChecked(), |
968 "IgnoreSlotMethods": self.ignoreSlotsCheckBox.isChecked(), |
971 "IgnoreSlotMethods": self.ignoreSlotsCheckBox.isChecked(), |
|
972 "IgnoreDunderGlobals": self.ignoreDunderGlobalsCheckBox.isChecked(), |
969 } |
973 } |
970 |
974 |
971 self.__options = [ |
975 self.__options = [ |
972 excludeMessages, |
976 excludeMessages, |
973 includeMessages, |
977 includeMessages, |
1429 "IgnoreNestedFunctions": ( |
1433 "IgnoreNestedFunctions": ( |
1430 self.ignoreNestedFunctionsCheckBox.isChecked() |
1434 self.ignoreNestedFunctionsCheckBox.isChecked() |
1431 ), |
1435 ), |
1432 "IgnoreDunderMethods": self.ignoreDunderMethodsCheckBox.isChecked(), |
1436 "IgnoreDunderMethods": self.ignoreDunderMethodsCheckBox.isChecked(), |
1433 "IgnoreSlotMethods": self.ignoreSlotsCheckBox.isChecked(), |
1437 "IgnoreSlotMethods": self.ignoreSlotsCheckBox.isChecked(), |
|
1438 "IgnoreDunderGlobals": self.ignoreDunderGlobalsCheckBox.isChecked(), |
1434 }, |
1439 }, |
1435 } |
1440 } |
1436 if json.dumps(data, sort_keys=True) != json.dumps( |
1441 if json.dumps(data, sort_keys=True) != json.dumps( |
1437 self.__data, sort_keys=True |
1442 self.__data, sort_keys=True |
1438 ): |
1443 ): |
2082 "PEP8/UnusedIgnoreSlotMethods", |
2087 "PEP8/UnusedIgnoreSlotMethods", |
2083 defaultParameters["UnusedChecker"]["IgnoreSlotMethods"], |
2088 defaultParameters["UnusedChecker"]["IgnoreSlotMethods"], |
2084 ) |
2089 ) |
2085 ) |
2090 ) |
2086 ) |
2091 ) |
|
2092 self.ignoreDunderGlobalsCheckBox.setChecked( |
|
2093 Preferences.toBool( |
|
2094 settings.value( |
|
2095 "PRP8/UnusedIgnoreDunderGlobals", |
|
2096 defaultParameters["UnusedChecker"]["IgnoreDunderGlobals"], |
|
2097 ) |
|
2098 ) |
|
2099 ) |
2087 |
2100 |
2088 self.__cleanupData() |
2101 self.__cleanupData() |
2089 |
2102 |
2090 @pyqtSlot() |
2103 @pyqtSlot() |
2091 def on_storeDefaultButton_clicked(self): |
2104 def on_storeDefaultButton_clicked(self): |
2270 self.ignoreDunderMethodsCheckBox.isChecked(), |
2283 self.ignoreDunderMethodsCheckBox.isChecked(), |
2271 ) |
2284 ) |
2272 settings.setValue( |
2285 settings.setValue( |
2273 "PEP8/UnusedIgnoreSlotMethods", self.ignoreSlotsCheckBox.isChecked() |
2286 "PEP8/UnusedIgnoreSlotMethods", self.ignoreSlotsCheckBox.isChecked() |
2274 ) |
2287 ) |
|
2288 settings.setValue( |
|
2289 "PEP8/UnusedIgnoreDunderGlobals", |
|
2290 self.ignoreDunderGlobalsCheckBox.isChecked(), |
|
2291 ) |
2275 |
2292 |
2276 @pyqtSlot() |
2293 @pyqtSlot() |
2277 def on_resetDefaultButton_clicked(self): |
2294 def on_resetDefaultButton_clicked(self): |
2278 """ |
2295 """ |
2279 Private slot to reset the configuration values to their default values. |
2296 Private slot to reset the configuration values to their default values. |
2494 defaultParameters["UnusedChecker"]["IgnoreDunderMethods"], |
2511 defaultParameters["UnusedChecker"]["IgnoreDunderMethods"], |
2495 ) |
2512 ) |
2496 settings.setValue( |
2513 settings.setValue( |
2497 "PEP8/UnusedIgnoreSlotMethods", |
2514 "PEP8/UnusedIgnoreSlotMethods", |
2498 defaultParameters["UnusedChecker"]["IgnoreSlotMethods"], |
2515 defaultParameters["UnusedChecker"]["IgnoreSlotMethods"], |
|
2516 ) |
|
2517 settings.setValue( |
|
2518 "PEP8/UnusedIgnoreDunderGlobals", |
|
2519 defaultParameters["UnusedChecker"]["IgnoreDunderGlobals"], |
2499 ) |
2520 ) |
2500 |
2521 |
2501 # Update UI with default values |
2522 # Update UI with default values |
2502 self.on_loadDefaultButton_clicked() |
2523 self.on_loadDefaultButton_clicked() |
2503 |
2524 |