Skip to content

Conversation

gmlewis
Copy link
Collaborator

@gmlewis gmlewis commented Oct 6, 2025

Note that there are many Go field names that do not match the JSON tag names, but changing them all would be a massive breaking API change that is probably unnecessary, and can instead be addressed on a one-by-one basis.

Additionally, one JSON tag had a typo which I've fixed in this PR.

…tag name

Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.11%. Comparing base (4505771) to head (b58c405).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3757   +/-   ##
=======================================
  Coverage   91.11%   91.11%           
=======================================
  Files         187      187           
  Lines       16702    16702           
=======================================
  Hits        15218    15218           
  Misses       1296     1296           
  Partials      188      188           

☔ View full report in Codecov by Sentry.
📢 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.

Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
@gmlewis
Copy link
Collaborator Author

gmlewis commented Oct 6, 2025

@stevehipwell - @alexandear - @zyfy29 - might you have time for a code review? Thank you!

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Oct 6, 2025
Comment on lines +145 to +148
jsonfieldname:
type: module
description: Reports mismatches between Go field and JSON tag names.
original-url: github.com/google/go-github/v75/tools/jsonfieldname

Choose a reason for hiding this comment

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

Did you try @ldez tagliatelle that is bundled with golangci-lint?

Copy link
Contributor

Choose a reason for hiding this comment

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

@gmlewis I'm happy to review but this seems like a good suggestion?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's try enabling tagliatelle

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Did you try @ldez tagliatelle that is bundled with golangci-lint?

Yes, I did, but couldn't coerce it to do what I wanted, where the JSON tag is the source-of-truth, not the Go field name.

Others are welcome to try to get the same results as this PR if you wish, but I was unable to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's try enabling tagliatelle

OK, @alexandear, then I will mark this PR as "DO NOT MERGE" until you are able to get comparable results with tagliatelle.

Copy link
Contributor

Choose a reason for hiding this comment

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

I may add an option about that. Don't hesitate to open an issue https://github.com/ldez/tagliatelle.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note, @alexandear - that your PR should make NO breaking API changes (as I have done here), but instead should flag inconsistencies with // TODO: ... (as I've also done) so that they can be addressed in separate "Breaking API Change" PRs.

The majority of the existing inconsistencies are actually due to agreed-upon discussions where the renaming was deemed to be clearer for end-users of this client library (although you can see that I flagged many with TODO to investigate as some appear to be mistakes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE Do not merge this PR. NeedsInvestigation NeedsReview PR is awaiting a review before merging. waiting for reply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants