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 up approx 20% of the rubocop issues in aruba #654

Merged
merged 9 commits into from
Jul 19, 2019

Conversation

luke-hill
Copy link
Contributor

Summary

Fix up some more rubocop offenses

Details

Some auto-fixed, some manually fixed. Approx 70 failures have been fixed and the config has been regenerated

Motivation and Context

Make the codebase better, one offense at a time.

How Has This Been Tested?

CI

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (cleanup of codebase without changing any existing functionality)
  • Update documentation

Checklist:

  • I've added tests for my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@luke-hill luke-hill requested a review from mvz July 1, 2019 11:24
Copy link
Contributor

@mvz mvz left a comment

Choose a reason for hiding this comment

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

Can you please rebase this on current master so we get some feedback from Travis and Appveyor?

include Environment
include Filesystem
include Text
include Bundler
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -20,5 +20,9 @@ def method_missing(name, *args)

config[name]
end

def respond_to_missing?(*)
true
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably do something like config.key? name.

@@ -15,7 +15,7 @@ module Core

# Aruba Runtime
def aruba
@_aruba_runtime ||= Runtime.new
@aruba ||= Runtime.new
Copy link
Contributor

Choose a reason for hiding this comment

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

This may break things since Aruba::Api::Core ends up being included elsewhere.

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 checked everywhere that module was included and there was no mention of @aruba anywhere in the entire codebase where that module was included

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this change may be responsible for a lot of the build failures.

@@ -22,6 +22,10 @@ def nil?
def method_missing(*)
fail NoCommandHasBeenStoppedError, 'No last command stopped available'
end

def respond_to_missing?(*)
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose this is correct for now, but I'd really like to simplify this design.

@@ -4,18 +4,10 @@
# Aruba
module Aruba
PLATFORM_MUTEX = Mutex.new
end
PLATFORM = [Platforms::WindowsPlatform, Platforms::UnixPlatform].find(&:match?)
Copy link
Contributor

Choose a reason for hiding this comment

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

Which cop makes you change Platform to PLATFORM? I feel this file should at least define Aruba::Platform. Renaming may even be a breaking change.

Copy link
Contributor Author

@luke-hill luke-hill Jul 3, 2019

Choose a reason for hiding this comment

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

Constants should be SCREAMING_SNAKE_CASE

EDIT: From what I could tell nowhere used this constant inside the suite. But this constant "may" be accessed from outside the suite. I don't know.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should disable the cop for this particular case, since we're basically setting up a class 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 seems a proper convoluted way of doing things, but I'll alter this change for now and rebase.

@mvz
Copy link
Contributor

mvz commented Jul 12, 2019

@luke-hill could you please rebase this on current master?

@mvz
Copy link
Contributor

mvz commented Jul 12, 2019

@luke-hill I think you merged instead of rebasing? Let's wait for Travis right now and then fix that up.

@luke-hill
Copy link
Contributor Author

I fixed this up and rebased with the latest master, but yeh now we have like 100 failures regarding environment.

I did a merge commit as it's easier than rebasing when your PR is >5 commits. But yeh lord knows what's gone on here. Have we removed something in master

@mvz
Copy link
Contributor

mvz commented Jul 15, 2019

I don't have time now, but I can have a deeper look into this later in the week.

This seems to cause massive suite-wide errors when being renamed, so needs a much deeper investigation
@luke-hill
Copy link
Contributor Author

I've fixed up the issues and added a warning about that area. In theory that "shouldn't" have broken it, as we shouldn't be accessing a memo's iVar.

Still it's now all green and slightly better. It's also RtM if you're happy with it.

@mvz mvz merged commit 7c28e3c into master Jul 19, 2019
@mvz mvz deleted the refactor/fix_up_more_cops branch July 19, 2019 19:17
@mvz
Copy link
Contributor

mvz commented Jul 19, 2019

Thanks, @luke-hill!

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.

2 participants