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

Refactor/rubocop line tidy #693

Merged
merged 11 commits into from
Apr 11, 2020
Merged

Refactor/rubocop line tidy #693

merged 11 commits into from
Apr 11, 2020

Conversation

luke-hill
Copy link
Contributor

@luke-hill luke-hill commented Jan 3, 2020

Summary

Improve Rubocop LineLength (And a few other minor styles)

Details

Rebase and fix up an old PR fixing up some LineLength issues

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:

NB: I've not updated the TODO as I want to standardise the TODO first by doing some additional cleanups and removing some patches around certain methods so we have a single source of truth

@luke-hill luke-hill requested a review from mvz January 3, 2020 09:44
.rubocop.yml Outdated Show resolved Hide resolved
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Layout/SpaceAroundOperators:
Copy link
Contributor

Choose a reason for hiding this comment

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

These additions to the todo file don't make sense anymore. Can you rebase this branch and remove the old commit that regenerates the todo file?

lib/aruba/api/core.rb Outdated Show resolved Hide resolved
lib/aruba/api/core.rb Outdated Show resolved Hide resolved
lib/aruba/api/core.rb Outdated Show resolved Hide resolved
lib/aruba/config_wrapper.rb Outdated Show resolved Hide resolved
else
Aruba.platform.which(command, environment['PATH'])
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

expect(api.fixtures_directory.to_s).to eq expand_path('test/fixtures')
}
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Hopefully we can tackle these soon.

end

context 'when subscriber to event, the block is called and get\'s an instance of the event passed as payload' do
context 'when subscriber to event, the block is called and gets an instance of the event passed as payload' do
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

it { expect { bus.register(event_klass) }.to raise_error ArgumentError }
it 'raises an ArgumentError' do
expect { bus.register(event_klass) }.to raise_error ArgumentError
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice improvements to this file!

@mvz
Copy link
Contributor

mvz commented Jan 27, 2020

I'll take a look at this again next weekend.

@luke-hill
Copy link
Contributor Author

@mvz I'm aware I need to fix conflicts, but could you re-review this first to work out if I only need to do small things or not?

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.

Just two more nits and then it's good to go.

fail ArgumentError, 'Expanding "~/" to "/" is not allowed' if path.to_s == '/'
fail ArgumentError, %(Expanding "~/" to a relative path "#{path}" is not allowed) unless path.absolute?
raise ArgumentError, 'Expanding "~/" to "/" is not allowed' if path.to_s == '/'
raise ArgumentError, "Expanding '~/' to a relative path #{path} is not allowed" unless path.absolute?
Copy link
Contributor

Choose a reason for hiding this comment

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

Please restore the original quotes inside this string for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't as there's an interpolation

# rubocop:enable Layout/LineLength
unless Aruba.platform.exist? path
raise ArgumentError, "Fixture #{rest} does not exist in fixtures directory #{aruba.fixtures_directory}. "\
"This was the one we found first on your system from all possible candidates: #{aruba_fixture_candidates}."
Copy link
Contributor

Choose a reason for hiding this comment

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

Since it's only used here, and only for formatting, I think aruba_fixture_andidates should be a local variable instead of a method.

@mvz
Copy link
Contributor

mvz commented Mar 7, 2020

@luke-hill done!

@mvz
Copy link
Contributor

mvz commented Mar 16, 2020

@luke-hill are you planning to work on this soon? If not I can fix this up, fix the spec failures, and merge.

@luke-hill
Copy link
Contributor Author

I'll get on this this week

@luke-hill luke-hill requested a review from mvz March 18, 2020 13:49
@mvz mvz mentioned this pull request Mar 18, 2020
8 tasks
lib/aruba/api/core.rb Outdated Show resolved Hide resolved
@mvz
Copy link
Contributor

mvz commented Apr 11, 2020

I'm going to rebase and merge this.

@mvz mvz force-pushed the refactor/rubocop_line_tidy branch from 1a9c980 to 88d6f24 Compare April 11, 2020 09:06
@mvz mvz merged commit 6a7af20 into master Apr 11, 2020
@luke-hill luke-hill deleted the refactor/rubocop_line_tidy branch April 14, 2020 07:39
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