Skip to content
New issue

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

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

Already on GitHub? # to your account

code-climate: add check_name field #5086

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

Wani4ka
Copy link
Contributor

@Wani4ka Wani4ka commented Oct 25, 2024

CodeClimateIssue declares to contain just enough fields to support Gitlab CI Code Quality. But there's a field called check_name, which is not generated by golangci-lint, but is stated as required in both Code Climate spec and Gitlab CI Code Quality reference. I moved linter's name from the description field to the check_name field. I'm not sure if there can be any issue made by an unknown linter, but I made a default value for this field as well, just to be sure.

I also updated the corresponding test and the link to the Gitlab page (the previous one reported 404).

Copy link

boring-cyborg bot commented Oct 25, 2024

Hey, thank you for opening your first Pull Request !

@CLAassistant
Copy link

CLAassistant commented Oct 25, 2024

CLA assistant check
All committers have signed the CLA.

@ldez ldez self-requested a review October 25, 2024 15:45
@ldez ldez added the area: output Related to issue output label Oct 25, 2024
@ldez ldez changed the title Add new required field for code climate report format code climate: add new report field Oct 25, 2024
@ldez ldez changed the title code climate: add new report field code-climate: add new report field Oct 25, 2024
@ldez
Copy link
Member

ldez commented Oct 25, 2024

The linter name cannot be empty, so there's no need for default.

The description should not be changed to avoid breaking changes.

The severity is optional, and it should be controlled with the severity configuration: https://golangci-lint.run/usage/configuration/#severity-configuration
But to avoid breaking changes will keep it.

@ldez ldez force-pushed the code_climate_report_format_update branch from 01271d4 to 5a52843 Compare October 25, 2024 18:17
@ldez ldez added the enhancement New feature or improvement label Oct 25, 2024
@ldez ldez added this to the next milestone Oct 25, 2024
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez changed the title code-climate: add new report field code-climate: add check_name field Oct 25, 2024
@ldez ldez merged commit be469a4 into golangci:master Oct 25, 2024
15 checks passed
@ccoVeille
Copy link
Contributor

@Wani4ka thanks for this

I'm curious, did you see any change in the way GitLab reports the issues?

@Wani4ka
Copy link
Contributor Author

Wani4ka commented Oct 25, 2024

GitLab self-hosted is used in my work, and I tried to make an integration of golangci-lint and ci code quality by uploading linter job artifacts, but it wasn't interpreted as a correct report. I may presume that the reason could be in the job misconfiguration, but I decided to start investigating the issue by checking the job artifact and golangci-lint source code and found this field mismatch. I'll check the job configuration later, but anyways I think this change might be useful

@ccoVeille
Copy link
Contributor

ccoVeille commented Oct 25, 2024

I checked gitlab code and it will have no effect (the example JSON in the link you quoted confirms it). Maybe it would one day. But not for now.

But it's great that golangci-lint code climate report respects the expected format 👍

@ldez
Copy link
Member

ldez commented Oct 25, 2024

@ccoVeille
Copy link
Contributor

I was talking about the fact the check_name field is not used in the way GitLab represents the code climate results.

But maybe, I don't get what you just said, or I missed something. If then, I'm sorry about it.

@ldez ldez modified the milestones: next, v1.62 Nov 10, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area: output Related to issue output enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants