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

Add(build): golangci-lint workflow configuration #916

Merged
merged 3 commits into from
May 18, 2023

Conversation

gen2thomas
Copy link
Collaborator

@gen2thomas gen2thomas commented May 16, 2023

Solved issues and/or description of the change

Try to solve the #544 in several steps in a state of the art way: golangci-lint. This is the first step by introducing the linter itself with most features disabled to make it pass. Afterwards some features will be enabled step by step together with resolving the existing issues.

Manual test

  • OS and Version (Win/Mac/Linux): Linux - golangci-lint has version 1.52.2 built with go1.20.2 from da04413a on 2023-03-25T18:11:28Z

Checklist

  • The PR's target branch is 'hybridgroup:dev'
  • No linter errors exist with CI --> changed it to exactly one error occur for test purposes
  • No linter errors exist locally (make fmt_check) --> changed it to exactly one error occur for test purposes
  • Documentation is updated
  • I have performed a self-review of my own code
  • Adjust PR checklist related to linter issues

@deadprogram
Copy link
Member

Seems like a very good idea!

@gen2thomas gen2thomas force-pushed the feature/golangcilint branch 5 times, most recently from 9aa5164 to a7cd3b9 Compare May 18, 2023 13:13
@gen2thomas gen2thomas marked this pull request as ready for review May 18, 2023 13:40
@gen2thomas
Copy link
Collaborator Author

one linter error exist to check the function of the new action:

drivers/i2c/sht3x_driver.go:47:23: composites: github.com/sigurn/crc8.Params struct literal uses unkeyed fields (govet)
	crc8Params         = crc8.Params{0x31, 0xff, false, false, 0x00, 0xf7, "CRC-8/SENSIRON"}

this can be fixed by disabling the linter "govet" or, much better, by the bad code style

@gen2thomas gen2thomas merged commit 6f8cff5 into hybridgroup:dev May 18, 2023
@gen2thomas gen2thomas deleted the feature/golangcilint branch May 18, 2023 13:47
gen2thomas added a commit to gen2thomas/gobot that referenced this pull request May 21, 2023
in addition add local linter settings, and adjust docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants