Skip to content

feat: Integrate GolangCi linter #105

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

Merged
merged 1 commit into from
May 18, 2025
Merged

feat: Integrate GolangCi linter #105

merged 1 commit into from
May 18, 2025

Conversation

SVilgelm
Copy link
Member

  • Add UnsupportedVersionError type for clearer OpenAPI version errors
  • Refactor OpenAPI version validation to use the new error type
  • Add //nolint directive to validation error creation to suppress err113 linter
  • Update test helpers in components_test.go to accept testing.TB and call tb.Helper()
  • Remove trailing blank line in operation tag validation for consistency
  • Update go.mod to require Go 1.22
  • Simplify Contact.validateSpec by ignoring validator parameter
  • Minor cleanup in RefOrSpec switch case ordering and imports

- Add UnsupportedVersionError type for clearer OpenAPI version errors
- Refactor OpenAPI version validation to use the new error type
- Add //nolint directive to validation error creation to suppress err113 linter
- Update test helpers in components_test.go to accept testing.TB and call tb.Helper()
- Remove trailing blank line in operation tag validation for consistency
- Update go.mod to require Go 1.22
- Simplify Contact.validateSpec by ignoring validator parameter
- Minor cleanup in RefOrSpec switch case ordering and imports
@Copilot Copilot AI review requested due to automatic review settings May 18, 2025 21:30
@SVilgelm SVilgelm merged commit 86ffa68 into main May 18, 2025
8 of 10 checks passed
@SVilgelm SVilgelm deleted the golangci-lint branch May 18, 2025 21:31
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates GolangCI-Lint and refactors OpenAPI validation and test helpers:

  • Introduce UnsupportedVersionError for clearer version errors and update validateSpec
  • Suppress unused‐parameter warnings in many validateSpec methods
  • Update component tests to use testing.TB/tb.Helper() and bump Go to 1.22

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated no comments.

Show a summary per file
File Description
security-requirement.go Suppress unused path param in validateSpec
schema.go Fix spelling, simplify type check, adjust loop over fields
responses.go Simplify regex using \d
ref.go Introduce SpecNotFoundError and replace fmt.Errorf calls
parameter.go Refactor name checks to switch, early exit on missing schema
operation.go Remove trailing blank line in tag validation
openapi.go Add UnsupportedVersionError and use it in version check
license.go Drop unused validator param
external-docs.go Drop unused validator param
extensions.go Add UnsupportedSpecTypeError, tighten extension loop
example.go Drop unused validator param
contact.go Drop unused validator param
components_test.go Change creators to accept testing.TB, call tb.Helper()
components.go Simplify component name regex
callback.go Return accumulated errors instead of nil in validateSpec
go.mod Update Go version to 1.22
.golangci.yml Add/configure GolangCI-Lint
.github/workflows/code.yaml Run GolangCI-Lint action, remove manual gofmt/go vet steps
Comments suppressed due to low confidence (1)

schema.go:356

  • The loop uses range n where n is an integer, which is invalid. It should be written as for i := 0; i < n; i++ { to iterate over the struct fields correctly.
for i := range n {

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.

1 participant