Sonar for Go alternative

Description

https://github.com/folio-org/.github/blob/v1.5.0/README-go.md suggests:

SonarCloud recommendations can be suppressed for specific code by appending //NOSONAR at the end of that code line.

In contrast warns:

Don’t use // NOSONAR and don’t use @SuppressWarnings("all"), they suppress all current and future rules. Sonar continuously adds new rules, including security rules, that should trigger warnings.

https://docs.sonarsource.com/sonarqube/latest/user-guide/issues/managing/#suppressing also warns:

In most languages, you can use the //NOSONAR comment at the end of a line to suppress all issues on the line. This will suppress all issues - now and in the future - that might be raised on the line. 

[ALERT] Using this comment does not comply with Clean as You Code.

Sonar’s Go code analysis doesn’t support a source code directive that suppresses only a single rule. This is a significant lack because it may hide other issues on that line that are relevant.

Sonar has only 44 Go rules: https://sonarcloud.io/organizations/folio-org/quality_profiles/show?name=Sonar+way&language=go

Sonar doesn’t have security rules.

Therefore Sonar for Go is not mature.

Other tools should be considered.

Other Go code analysis tools have many more rules and support rule specific source code directives, for example

Environment

None

Potential Workaround

None

Checklist

hide

Activity

Show:

Mike Taylor October 21, 2024 at 10:12 AM

Thanks, , this looks excellent.

David Crossley October 21, 2024 at 9:12 AM

The initial go-lint Workflows are now merged at folio-org/.github respository.

Refer to https://github.com/folio-org/.github/blob/master/README-go-lint.md

The go-lint workflow is now utilised at https://github.com/folio-org/mod-reporting

-- The issues reported by govulncheck are explained at README-go-lint.md#govulncheck

Mike Taylor October 15, 2024 at 9:17 AM

Perfect, thank you!

David Crossley October 15, 2024 at 4:38 AM

Yes Mike. I have already started working on the Workflow via FOLIO-3994. Later you might want to add some more to mod-reporting make lint, but for now focus on the Workflow.

Mike Taylor October 14, 2024 at 3:51 PM

Would it be OK if I assign this to you?

Done

Details

Assignee

Reporter

Priority

Development Team

None

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created October 8, 2024 at 10:27 AM
Updated November 21, 2024 at 4:31 PM
Resolved November 21, 2024 at 4:31 PM
TestRail: Cases
TestRail: Runs