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

fix(generators): Improve consistency of migrated language generators #7662

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

cpcallen
Copy link
Contributor

The basics

The details

Resolves

Fixes minor consistency and style issues in the previously-migrated generators.

Proposed Changes

  • Replace @fileoverview with @file in a number of places.
    • Remove indentation of continuation lines in this section.
  • Remove unneeded @suppress directives.
  • Change the return type of getAdjusted on DartGenerator and JavascriptGenerator to string (and improve the @returns JSDoc), for consistency with changes made to PhpGenerator in refactor(generators): Migrate PHP generators to TypeScript #7647. It was previously string | number, but after applying required casts no numbers are now ever returned.

Reason for Changes

Consistency and cruft removal.

Additional Info

The change to the return type of getAdjusted is technically a breaking change, as external developers could have replaced our version with one that actually does return numbers, but the signature change itself is not treated as breaking since the generators have heretofore all been declared as any and we decided not to treat fixing the declarations as being a breaking change.

And improve its documentation too.

Fix the @returns doc for PythonGenerator's getAdjustedInt but
(for now) don't change the type because it does actually
return numbers in some circumstances.
@cpcallen cpcallen requested a review from a team as a code owner November 21, 2023 23:31
@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Nov 21, 2023
@cpcallen cpcallen merged commit b198e2f into google:develop Nov 28, 2023
10 checks passed
@cpcallen cpcallen deleted the refactor/6828/consistency-fixes branch November 28, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants