Closed Hiltiprant closed 2 years ago
@Hiltiprant I don’t think we should disable the whole rule. Instead we can change the reflex for constants to be the same as for variables. This is suggested here: https://stackoverflow.com/questions/41204932/error-message-python-pylint-c0103invalid-constant-name#41217309
this way we still keep some checking of pythons naming conventions.
Christian
Das hatte ich gestern mit einem Kollegen im Grunde auch schon so überlegt. Das doofe daran ist halt, dass er dann sagt, dass die Konstanten nicht richtig benannt sind. Finde ich eigentlich etwas doof und eventuell verwirrend, wenn einmal an Variablen und einmal an Konstanten gemeckert wird...
Schöner wäre vielleicht, wenn man dieses Feedback invalid-name: Constant name[...] ändern könnte. Da habe ich bisher nichts zu gefunden. Weißt Du, @ceedee666 ob das irgendwie möglich ist? Sonst würde ich die RegEx einfach von den Variablen kopieren.
OT: Sollen wir hier eigentlich auf Englisch kommunizieren oder Deutsch? Mir egal, würde es aber einheitlich halten.
We should use English to communicate here. i would suggest to copy the RegEx for Variables and additionally allow for upper case letters. This should be fine for constants in our context.
@Hiltiprant I updated the const-regex: https://github.com/ceedee666/opensap_python_intro/blob/3c475141b8004e19b146a9495ac3fe5657f7f740/exercises/test_files/default.pylintrc#L167
Could you please check if it works now? If yes we need to replace all the default.pylintrc files in CodeOcean.
@Hiltiprant I updated the const-regex:
Could you please check if it works now? If yes we need to replace all the default.pylintrc files in CodeOcean.
Both variants that I mentioned in my initial post are now working with the new linting file. I already updated the exercises from week 0 and week 1 on CO. @ghoolio Could you please update the remaining exercises on CO?
@ghoolio Could you please update the remaining exercises on CO?
Sure. Just updated the remaining exercises on CO.
PyLint macht Blödsinn. Variablen, die z. B. nicht durch User Input gesetzt werden, werden offenbar als Konstante erkannt und dementsprechend wird die Benennung angemakelt:
Auch, wenn die Variable nach erstmaligem Setzen nochmals geändert wird, wird es weiterhin als Konstante angesehen:
Tritt/trat erstmals bei Ex_3-BO auf, ist aber ein generelles Problem des Linters (vorher nur nie aufgetreten).
Möglicher Quick(-and-dirty)-Fix: Regel für die Naming-Convention zu Konstanten rausnehmen, da sie im Kurs eh nicht vorkommen?
Hier ist noch erklärt, warum PyLint die als Konstanten ansieht.