Skip to content

fix(protoc-gen-http-swagger): resolve staticcheck lint errors#19

Merged
GuangmingLuo merged 6 commits intohertz-contrib:mainfrom
spencercjh:fix/ci-supplement
Apr 22, 2026
Merged

fix(protoc-gen-http-swagger): resolve staticcheck lint errors#19
GuangmingLuo merged 6 commits intohertz-contrib:mainfrom
spencercjh:fix/ci-supplement

Conversation

@spencercjh
Copy link
Copy Markdown
Contributor

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

fix(protoc-gen-http-swagger): 修复 staticcheck lint 错误

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en: Fix the same staticcheck issues that were addressed in protoc-gen-rpc-swagger but missed in protoc-gen-http-swagger. This is a supplement to PR #18.

  • QF1003: use tagged switch instead of if/else-if chain
  • SA4001: remove redundant *& dereference

zh(optional): 修复 protoc-gen-rpc-swagger 中已处理但 protoc-gen-http-swagger 中遗漏的 staticcheck 问题,作为 PR #18 的补充。

  • QF1003: 使用 tagged switch 替代 if/else-if 链
  • SA4001: 移除多余的 *& 解引用

(Optional) Which issue(s) this PR fixes:

Supplements #18

(optional) The PR that updates user documentation:

N/A

GuangmingLuo and others added 6 commits March 4, 2026 14:32
Change-Id: I66e1255a65d225e23825d7ff37ece414e69a5b01
Change-Id: Ia640d4b7b057cf41c6cabc806c2d5fbe19f95cd6
Change-Id: I815ed9e6b1e25fa1d194a5e01ac934b4df1063f9
Change-Id: I843a281a1e8b9df500ba02ce1c41ab680ca20924
Change-Id: I39edcd0b5499011ddf71da0ccc3d7f2ae4065a85
Fix the same staticcheck issues that were addressed in protoc-gen-rpc-swagger
but missed in protoc-gen-http-swagger:
- QF1003: use tagged switch instead of if/else-if chain
- SA4001: remove redundant *& dereference

Signed-off-by: spencercjh <spencercjh@gmail.com>
Copilot AI review requested due to automatic review settings March 31, 2026 09:58
Copy link
Copy Markdown
Contributor

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 addresses staticcheck findings across the Swagger generators and updates CI linting to run staticcheck consistently.

Changes:

  • Refactors conditional chains into tagged switch statements to satisfy staticcheck QF1003.
  • Removes redundant *& dereference to satisfy staticcheck SA4001.
  • Updates GolangCI-Lint configuration and the PR-check GitHub Actions workflow (checkout/action versions, runner image, lint args).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
thrift-gen-http-swagger/generator/openapi_gen.go Replaces if/else chain with tagged switch when selecting document options.
protoc-gen-rpc-swagger/generator/reflector.go Uses tagged switch for well-known message naming and removes redundant dereference for enum schema generation.
protoc-gen-http-swagger/generator/reflector.go Same staticcheck-driven refactors as rpc-swagger reflector.
.golangci.yaml Migrates to a v2 config layout, explicitly enabling a smaller linter set including staticcheck.
.github/workflows/pr-check.yml Moves PR checks to ubuntu-latest, bumps action versions, and updates golangci-lint invocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .golangci.yaml
Comment thread .golangci.yaml
Comment thread .github/workflows/pr-check.yml
Comment thread .github/workflows/pr-check.yml
@GuangmingLuo GuangmingLuo merged commit ee5e055 into hertz-contrib:main Apr 22, 2026
10 of 13 checks passed
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.

3 participants