Skip to content

style: autocorrect rubocop offenses in appengine and jobs samples - #1908

Open
torreypayne wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
torreypayne:style/fix-rubocop-errors
Open

style: autocorrect rubocop offenses in appengine and jobs samples#1908
torreypayne wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
torreypayne:style/fix-rubocop-errors

Conversation

@torreypayne

Copy link
Copy Markdown
Member

Fixes Rubocop errors reported in presubmit:

  • appengine/rails-hello_world/bin/setup: Style/MethodDefParentheses
  • appengine/standard-static-files/rails/bin/setup: Style/MethodDefParentheses
  • appengine/static_files/rails/bin/setup: Style/MethodDefParentheses
  • jobs/V3/filter_search_sample.rb: Layout/IndentationWidth, Layout/ClosingParenthesisIndentation

Autocorrected via Rubocop CLI (bundle exec rubocop -a).

@torreypayne
torreypayne requested review from a team as code owners July 31, 2026 21:32
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Jul 31, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request removes parentheses from the system! method definition in several setup scripts and adjusts the indentation of the max_compensation parameter in jobs/V3/filter_search_sample.rb. The review feedback correctly points out that this indentation change introduces a layout inconsistency relative to the sibling min_compensation parameter and suggests a uniform formatting structure for better readability.

Comment on lines +234 to +237
jobs::Money.new currency_code: "USD",
units: max_unit,
nanos: 500_000_000
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The auto-correction of max_compensation has introduced a significant layout inconsistency. While max_compensation is now indented with 4 spaces, its sibling argument min_compensation (on line 238) remains indented with 51 spaces.

To maintain readability and consistency, it is highly recommended to format both arguments of jobs::CompensationRange.new uniformly. For example, you can wrap the arguments in standard parentheses and format them like this:

  compensation_range = jobs::CompensationRange.new(
    max_compensation: jobs::Money.new(
      currency_code: "USD",
      units:         max_unit,
      nanos:         500_000_000
    ),
    min_compensation: jobs::Money.new(
      currency_code: "USD",
      units:         min_unit,
      nanos:         0
    )
  )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please fix!

@aandreassa

Copy link
Copy Markdown
Contributor

Lets also use chore just in case. Not sure what style does.

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

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants