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

Enable Rubocop in CI and automatically correct the offences we can correct #1432

Closed
wants to merge 18 commits into from

Conversation

timrogers
Copy link
Contributor

No description provided.

Copy link
Contributor

@nickfloyd nickfloyd left a comment

Choose a reason for hiding this comment

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

❤️ for these changes and getting this all knocked out!

@timrogers
Copy link
Contributor Author

I'll do a manual review of the code changes before I merge, just to reduce the chance of accidental behaviour changes that aren't caught by our tests. Rubocop isn't perfect - 3e5a177 was needed to avoid broken code!

raise ArgumentError, "content or :file option required" if content.nil?

options[:content] = if Base64.respond_to?(:strict_encode64)
Base64.strict_encode64(content)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like Rubocop has borked the indentation here 😓

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It also looks like this could be removed entirely as it's targeting Ruby 1.9.2. That means that we can merge this as is, and come back in another PR to cut out this condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue created: #1433

@@ -1,11 +1,9 @@
module Octokit
class Client

# Methods for the PubSubHubbub API
#
# @see https://developer.github.com/v3/repos/hooks/#pubsubhubbub
module PubSubHubbub
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I somehow don't think this module is relevant anymore. We should remove it. It seems that we supported thie Pubsubhubbub protocol at some point (e.g. see here) but I think it's long gone. Although I can't find an announcement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue created: #1434

lib/octokit/client/pull_requests.rb Show resolved Hide resolved
lib/octokit/client/repositories.rb Outdated Show resolved Hide resolved
lib/octokit/client/repositories.rb Outdated Show resolved Hide resolved
@@ -225,10 +223,10 @@ class Unauthorized < ClientError; end
# Raised when GitHub returns a 401 HTTP status code
# and headers include "X-GitHub-OTP"
class OneTimePasswordRequired < ClientError
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this code - or anything else around OTPs - is relevant with modern GitHub authentication methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue created: #1436

lib/octokit/rate_limit.rb Outdated Show resolved Hide resolved
module Response

# Parses RSS and Atom feed responses.
class FeedParser < BaseMiddleware
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have RSS and Atom feed responses anymore? 🤔 If not, this can go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue created: #1437

octokit.gemspec Outdated
spec.version = Octokit::VERSION.dup
spec.metadata['rubygems_mfa_required'] = 'true'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should ✂️ this, and then introduce it separately. It's a bit of a weird one to sneak in through Rubocop!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 905ce0e

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue created: #1440

if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.2.0')
require 'pry-byebug'
end
require 'pry-byebug' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.2.0')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should check if pry-byebug still has this problem and remove it when it doesn't

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue created: #1439

This change was added by a Rubocop auto-correct. It's a good thing
to have, but we should add it consciously in its own PR.
@timrogers
Copy link
Contributor Author

Closing in favour of #1441

@timrogers timrogers closed this Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants