Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdlint feature: option for Gitlab code quality output format #336

Open
OskarUnn opened this issue Oct 19, 2024 · 2 comments
Open

gdlint feature: option for Gitlab code quality output format #336

OskarUnn opened this issue Oct 19, 2024 · 2 comments
Labels
enhancement New feature or request linter

Comments

@OskarUnn
Copy link

I would like to add a feature to generate Gitlab code quality reports with gdlint.

Example usage in .gitlab-ci.yml

...
gdlint:
  image: python:3.12-alpine
  script:
    - pip3 install "gdtoolkit==4.*"
    - gdlint --format gitlab .
  artifacts:
    reports:
      codequality: gl-code-quality-report.json
...

Is this feature suitable for this project?

Perhaps in the future I could add more things related to Gitlab (.gitlab-ci.yml example, gdradon output to code quality report...)

@Scony Scony added the discussion Let's discuss label Oct 20, 2024
@Scony
Copy link
Owner

Scony commented Oct 20, 2024

How does adding such a feature to generate gitlab reports work?

@OskarUnn
Copy link
Author

It would work by saving the found problems to a json file in this format:

[
  {
    "description": "'unused' is assigned a value but never used.",
    "check_name": "no-unused-vars",
    "fingerprint": "7815696ecbf1c96e6894b779456d330e",
    "severity": "minor",
    "location": {
      "path": "lib/index.js",
      "lines": {
        "begin": 42
      }
    }
  }
]

The problems will show up in Gitlab merge requests like this:
image

Here are the changes I made to implement it: OskarUnn@68d0764

@Scony Scony added enhancement New feature or request linter and removed discussion Let's discuss labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request linter
Projects
None yet
Development

No branches or pull requests

2 participants