diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f91432ec7586ca1d624967f4732c93c9c5983c2..9b414298cbb929e88cf3c985e9fd6f90778d5a2f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,7 @@ job_lint_pylint: image: morkolai/paa-bittet-ci script: - pylint --version + - pip install pyside2 - pylint --rcfile=.pylintrc soitool job_lint_bandit: diff --git a/.pylintrc b/.pylintrc index 902ac7b29fd4d254ef7ca1e245940d5fe8558979..7e9ef2c59e6d2485745e4bb9538672918024a7cb 100644 --- a/.pylintrc +++ b/.pylintrc @@ -402,7 +402,9 @@ function-naming-style=snake_case #function-rgx= # Good variable names which should always be accepted, separated by a comma. -good-names=i, +good-names=app, + ok, + i, j, k, ex, @@ -561,4 +563,4 @@ known-third-party=enchant # Exceptions that will emit a warning when being caught. Defaults to # "Exception". -overgeneral-exceptions=Exception \ No newline at end of file +overgeneral-exceptions=Exception diff --git a/soitool/main.py b/soitool/main.py index 8079ab33fd7bf6c89bf3bc8eb47559c71363a7e9..6dab3a0895ebd3967648e5d8bd6fe91e9c92186d 100644 --- a/soitool/main.py +++ b/soitool/main.py @@ -10,13 +10,21 @@ from PySide2 import QtWidgets class CoolWidget(QtWidgets.QWidget): - def __init__(self, text="Sample text", *args, **kwargs): + """Enkel widget for å ha noe å teste + + Placeholderbeskrivelse + + """ + def __init__(self, text, *args, **kwargs): super(CoolWidget, self).__init__(*args, **kwargs) # settings this to None is only useful for one of the testing methods # described in test_main.py self.dlg_input = None + # only here to conform to pylint. see above comment + self.dlg_msg = None + layout = QtWidgets.QHBoxLayout() self.qlabel = QtWidgets.QLabel(text) self.button = QtWidgets.QPushButton("Change text") @@ -26,6 +34,8 @@ class CoolWidget(QtWidgets.QWidget): self.setLayout(layout) def clickfunc(self): + """Pop-up for å endre tekst. Koblet til knapp + """ # try-finally to set dialog to None is only useful for one of the # testing methods described in test_main.py try: @@ -48,6 +58,6 @@ class CoolWidget(QtWidgets.QWidget): if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) - widget = CoolWidget("Custom text") - widget.show() + WIDGET = CoolWidget("Custom text") + WIDGET.show() app.exec_()