Skip to content

refactor: Standardize body parameter names#4300

Open
alexandear wants to merge 3 commits into
google:masterfrom
alexandear-org:refactor/requestbody-name
Open

refactor: Standardize body parameter names#4300
alexandear wants to merge 3 commits into
google:masterfrom
alexandear-org:refactor/requestbody-name

Conversation

@alexandear

@alexandear alexandear commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

This PR adds the requestbody custom linter to simplify code review. Changes are non-breaking.

The requestbody does the following:

  • suggests renaming a body parameter to body
  • reports body parameters passed by pointer, because body parameters are usually required
  • reports body parameter types with an Options suffix, because Options are used for query parameters

@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.41748% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.47%. Comparing base (0eacd34) to head (ad918f5).

Files with missing lines Patch % Lines
github/codespaces_secrets.go 85.71% 0 Missing and 2 partials ⚠️
github/git_refs.go 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4300   +/-   ##
=======================================
  Coverage   97.47%   97.47%           
=======================================
  Files         192      192           
  Lines       19310    19310           
=======================================
  Hits        18822    18822           
  Misses        270      270           
  Partials      218      218           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis

gmlewis commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

I'm wondering if we should standardize on an "Options" suffix for query (URL) parameters at the same time since we are standardizing on a "Request" suffix for body parameters?

If so, it seems to me like this new linter is the perfect place to put this.

Thoughts?

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Jun 14, 2026
@alexandear

Copy link
Copy Markdown
Contributor Author

I'm wondering if we should standardize on an "Options" suffix for query (URL) parameters at the same time since we are standardizing on a "Request" suffix for body parameters?

If so, it seems to me like this new linter is the perfect place to put this.

Thoughts?

Agree, good idea. I'll extend the linter.
Also should think of a better name for the linter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants