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

Upgrade Rubocop #1923

Merged
merged 33 commits into from
Jan 12, 2018
Merged

Upgrade Rubocop #1923

merged 33 commits into from
Jan 12, 2018

Conversation

blowmage
Copy link
Contributor

@blowmage blowmage commented Jan 11, 2018

This PR upgrades the dependency on Rubocop, updates the code match the most recent style guide, and removes unnecessary configuration and fixes configuration warnings in the individual gems' .rubocop.yml files.

[fixes #1838]

Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
The Firestore credentials class should have been made public before releasing.
Update the documentation to reflect that it is public.
Add a default file path for gcloud SDK credentials.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
@blowmage blowmage added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Jan 11, 2018
@blowmage blowmage added the api: oslogin Issues related to the Cloud OS Login API API. label Jan 11, 2018
@blowmage blowmage self-assigned this Jan 11, 2018
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 11, 2018
Changes needed to adhere to updated style guide in latest Rubocop.
Changes needed to adhere to updated style guide in latest Rubocop.
@blowmage blowmage force-pushed the rubocop-upgrade branch 5 times, most recently from 65201ef to 0ef8195 Compare January 12, 2018 04:10
Remove pinned rainbow dependency since Rubocop needs updated version.
Downgrade to the last version that supported Ruby 2.0.
This version is recent enough to satisfy security warnings.
@blowmage
Copy link
Contributor Author

@quartzmo @dazuma This PR has a large surface area. I'd like to minimize any future conflicts by merging this ASAP, before other PRs add code that don't adhere to the upgraded style guide. Can you review this as soon as you are able?

@blowmage
Copy link
Contributor Author

@geigerj This PR has several changes for the updated style guide that may affect how the GAPIC files are generated for new gems. Happy to discuss these changes with you.

@@ -1601,7 +1603,7 @@ def reload!
@gapi = reloaded_gapi
self
end
alias_method :refresh!, :reload!
alias refresh! reload!

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

"bigtable" => "BIGTABLE"
}[format.to_s.downcase]
val = {
"csv" => "CSV", "avro" => "AVRO",

This comment was marked as spam.

This comment was marked as spam.

@@ -211,13 +211,12 @@ def time_partitioning_type
#
def time_partitioning_type= type
reload! unless resource_full?
@gapi.time_partitioning ||=
Google::Apis::BigqueryV2::TimePartitioning.new
@gapi.time_partitioning ||= \

This comment was marked as spam.

This comment was marked as spam.

@@ -6,7 +6,7 @@ gem "minitest-autotest", "~> 1.0"
gem "minitest-focus", "~> 1.1"
gem "minitest-rg", "~> 5.2"
gem "autotest-suffix", "~> 1.1"
gem "rubocop", "<= 0.35.1"
gem "rubocop", "~> 0.50.0"

This comment was marked as spam.

This comment was marked as spam.

@dazuma
Copy link
Member

dazuma commented Jan 12, 2018

My vague recollection was that we had pinned Rubocop to an early version because newer versions drop support for certain older versions of Ruby that we still support. I'd be happy to be misremembering, though. (Maybe I'm thinking about a different gem?) Just wanted to make sure we still work with all the Ruby versions we support.

@blowmage
Copy link
Contributor Author

We originally pinned Rubocop because 0.36.0 was released and made massive changes to the style guide and every gem build broke because of it. The upgrade to 0.50 (and 0.52), while intensive, was much simpler than the upgrade to 0.36 would have been. But that's why we originally pinned the dependency.

@blowmage
Copy link
Contributor Author

All in all, while I believe in keeping on the technology treadmill, I find the churn in Rubocop's style guide to be frustrating. I've been very happy to stay on one style guide for a longer period of time, rather than upgrading every time a new Rubocop version is released. But will concede that an entire year between updating the style guide may be too long.

gem "google-cloud-bigquery", path: "../google-cloud-bigquery"
gem "google-cloud-container", path: "../google-cloud-container"

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

gem "google-cloud-bigquery", path: "../google-cloud-bigquery"
gem "google-cloud-container", path: "../google-cloud-container"

This comment was marked as spam.

@@ -68,7 +68,7 @@ def add_response_labels span, env
response_body.bytesize.to_s
set_label labels, label_keys::HTTP_STATUS_CODE, response_status.to_s

if 300 <= response_status && response_status < 400 && response_url
if response_status >= 300 && response_status < 400 && response_url

This comment was marked as spam.

Copy link
Member

@quartzmo quartzmo left a comment

Choose a reason for hiding this comment

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

@blowmage Thank you for taking this on, it must have been a maddening task! I especially appreciate how you removed the unneeded rubocop overrides that resulted from copy/pasting .rubocop.yml. Great work!

@blowmage
Copy link
Contributor Author

@dazuma Do you have any concerns? I'd like to get this merged ASAP.

Copy link
Member

@dazuma dazuma left a comment

Choose a reason for hiding this comment

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

No other questions. LGTM. Thanks for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. api: bigtable Issues related to the Bigtable API. api: clouddebugger Issues related to the Cloud Debugger API. api: clouderrorreporting Issues related to the Error Reporting API. api: cloudresourcemanager Issues related to the Resource Manager API. api: cloudtrace Issues related to the Cloud Trace API. api: compute Issues related to the Compute Engine API. api: core api: datastore Issues related to the Datastore API. api: dns Issues related to the Cloud DNS API. api: firestore Issues related to the Firestore API. api: language Issues related to the Cloud Natural Language API API. api: logging Issues related to the Cloud Logging API. api: monitoring Issues related to the Cloud Monitoring API. api: oslogin Issues related to the Cloud OS Login API API. api: pubsub Issues related to the Pub/Sub API. api: spanner Issues related to the Spanner API. api: speech Issues related to the Speech-to-Text API. api: storage Issues related to the Cloud Storage API. api: translation Issues related to the Cloud Translation API API. api: videointelligence Issues related to the Video Intelligence API API. api: vision Issues related to the Cloud Vision API. cla: yes This human has signed the Contributor License Agreement. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade rubocop
4 participants