diff --git a/python/src/com/jetbrains/python/inspections/PyMethodParametersInspection.java b/python/src/com/jetbrains/python/inspections/PyMethodParametersInspection.java
index 54fdd1fc1d2f..74ff3aecb5a9 100644
--- a/python/src/com/jetbrains/python/inspections/PyMethodParametersInspection.java
+++ b/python/src/com/jetbrains/python/inspections/PyMethodParametersInspection.java
@@ -111,18 +111,8 @@ public class PyMethodParametersInspection extends PyInspection {
return;
}
}
- // TODO: check for style settings
- String CLS = "cls";
- if (flags.contains(CLASSMETHOD) || isSpecialMetaclassMethod) {
- if (!CLS.equals(pname)) {
- registerProblem(
- PyUtil.sure(params[0].getNode()).getPsi(),
- PyBundle.message("INSP.usually.named.$0", CLS),
- new RenameParameterQuickFix(CLS)
- );
- }
- }
- else if (isMetaclassMethod && PyNames.NEW.equals(method_name)) {
+ String CLS = "cls"; // TODO: move to style settings
+ if (isMetaclassMethod && PyNames.NEW.equals(method_name)) {
final String[] POSSIBLE_PARAM_NAMES = {"typ", "meta"}; // TODO: move to style settings
if (!among(pname, POSSIBLE_PARAM_NAMES)) {
registerProblem(
@@ -132,6 +122,15 @@ public class PyMethodParametersInspection extends PyInspection {
);
}
}
+ else if (flags.contains(CLASSMETHOD) || isSpecialMetaclassMethod || PyNames.NEW.equals(method_name)) {
+ if (!CLS.equals(pname)) {
+ registerProblem(
+ PyUtil.sure(params[0].getNode()).getPsi(),
+ PyBundle.message("INSP.usually.named.$0", CLS),
+ new RenameParameterQuickFix(CLS)
+ );
+ }
+ }
else if (!is_staticmethod && !first_param.isPositionalContainer() && !PyNames.CANONICAL_SELF.equals(pname)) {
if (isMetaclassMethod && CLS.equals(pname)) {
return; // accept either 'self' or 'cls' for all methods in metaclass
diff --git a/python/testData/inspections/PyMethodParametersInspection/expected.xml b/python/testData/inspections/PyMethodParametersInspection/expected.xml
index bcdb702c404c..ca106f831549 100644
--- a/python/testData/inspections/PyMethodParametersInspection/expected.xml
+++ b/python/testData/inspections/PyMethodParametersInspection/expected.xml
@@ -43,7 +43,7 @@
first_arg.py
65
- Usually first parameter of such methods is named 'cls'
+ Usually first parameter of such methods is named 'typ'
first_arg.py