Skip to content
Snippets Groups Projects
Commit 67a09327 authored by Mayr, Hannes's avatar Mayr, Hannes
Browse files

Merge branch '79-upgrade-pylint-job' into 'dev'

Resolve "Upgrade pylint job"

See merge request !68
parents e5bff479 7d544c52
No related branches found
No related tags found
No related merge requests found
Pipeline #912180 canceled
...@@ -28,8 +28,23 @@ Pylint: ...@@ -28,8 +28,23 @@ Pylint:
stage: linting stage: linting
needs: [] needs: []
script: script:
- pip install pylint - mkdir -p public/badges public/lint
- find . -type f -name '*.py' | xargs pylint -rn --rcfile='plotid/.pylintrc' # Find all python files and check the code with pylint - echo undefined > public/badges/$CI_JOB_NAME.score
- pip install pylint-gitlab
- pylint --rcfile='plotid/.pylintrc' --output-format=text $(find -type f -name "*.py" ! -path "**/env*/**") | tee /tmp/pylint.txt
- sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' /tmp/pylint.txt > public/badges/$CI_JOB_NAME.score
- pylint --rcfile='plotid/.pylintrc' --output-format=pylint_gitlab.GitlabCodeClimateReporter $(find -type f -name "*.py" ! -path "**/env*/**") > codeclimate.json
- pylint --rcfile='plotid/.pylintrc' --output-format=pylint_gitlab.GitlabPagesHtmlReporter $(find -type f -name "*.py" ! -path "**/env*/**") > public/lint/index.html
after_script:
- anybadge --overwrite --label $CI_JOB_NAME --value=$(cat public/badges/$CI_JOB_NAME.score) --file=public/badges/$CI_JOB_NAME.svg 4=red 6=orange 8=yellow 10=green
- |
echo "Your score is: $(cat public/badges/$CI_JOB_NAME.score)"
artifacts:
paths:
- public
reports:
codequality: codeclimate.json
when: always
Autoformatting: Autoformatting:
stage: linting stage: linting
...@@ -66,7 +81,7 @@ pages: ...@@ -66,7 +81,7 @@ pages:
paths: paths:
- public - public
rules: rules:
- if: "$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH" # - if: "$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
sast: sast:
before_script: before_script:
......
...@@ -10,5 +10,5 @@ research data, the plot is based on. Additionally, the script that created the ...@@ -10,5 +10,5 @@ research data, the plot is based on. Additionally, the script that created the
plot will also be copied to the directory. plot will also be copied to the directory.
""" """
__version__ = "0.2.2-b3" __version__ = "0.3.0"
__author__ = "Institut Fluidsystemtechnik within nfdi4ing at TU Darmstadt" __author__ = "Institut Fluidsystemtechnik within nfdi4ing at TU Darmstadt"
...@@ -78,7 +78,6 @@ class PlotOptions: ...@@ -78,7 +78,6 @@ class PlotOptions:
position: tuple[float, float], position: tuple[float, float],
**kwargs: Any, **kwargs: Any,
) -> None: ) -> None:
self.figs = figs self.figs = figs
self.figure_ids = kwargs.get("figure_ids", []) self.figure_ids = kwargs.get("figure_ids", [])
self.rotation = rotation self.rotation = rotation
......
...@@ -40,7 +40,6 @@ class PublishOptions: ...@@ -40,7 +40,6 @@ class PublishOptions:
dst_path: str, dst_path: str,
**kwargs: Any, **kwargs: Any,
) -> None: ) -> None:
if not isinstance(figs_and_ids, PlotIDTransfer): if not isinstance(figs_and_ids, PlotIDTransfer):
raise RuntimeError("figs_and_ids is not an instance of PlotIDTransfer.") raise RuntimeError("figs_and_ids is not an instance of PlotIDTransfer.")
self.figure = figs_and_ids.figs self.figure = figs_and_ids.figs
......
...@@ -62,7 +62,6 @@ def tagplot_matplotlib(plotid_object: PlotOptions) -> PlotIDTransfer: ...@@ -62,7 +62,6 @@ def tagplot_matplotlib(plotid_object: PlotOptions) -> PlotIDTransfer:
plt.figure(fig) plt.figure(fig)
if plotid_object.id_on_plot: if plotid_object.id_on_plot:
plt.figtext( plt.figtext(
x=plotid_object.position[0], x=plotid_object.position[0],
y=plotid_object.position[1], y=plotid_object.position[1],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment