Skip to content

Fix: Lint errors after rubocop update. #136

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

Merged
merged 3 commits into from
Nov 9, 2018
Merged

Conversation

rashidsp
Copy link
Contributor

@rashidsp rashidsp commented Nov 6, 2018

Summary

  • In PR Test against ruby version(s) #133 Rubocop's latest version 0.60.0 was installed, due to which later PRs were getting failed with lint errors.
  • Configured rubocop with latest version 0.60.0.
  • Fixed lint errors.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 13dfbe7 on rashid/lint-errors into 742cf09 on master.

@coveralls
Copy link

coveralls commented Nov 6, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling ac87ad0 on rashid/lint-errors into 742cf09 on master.

if logger_valid?(logger) && level
logger.log(level, "#{Optimizely::Helpers::Constants::INPUT_VARIABLES[key.to_s.upcase]} is invalid")
end
logger.log(level, "#{Optimizely::Helpers::Constants::INPUT_VARIABLES[key.to_s.upcase]} is invalid") if logger_valid?(logger) && level
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I find this is harder to read than before, is that really one of our int rules? If so we should change it so that it won't complain about this. @apanzerj what are your thoughts on this kind of styling rule?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Plz review the addressed change, it's also complying with rubocop rules.

if variation_id == ''
@config.logger.log(Logger::DEBUG, 'Bucketed into an empty traffic range. Returning nil.')
end
@config.logger.log(Logger::DEBUG, 'Bucketed into an empty traffic range. Returning nil.') if variation_id == ''
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here, is there a way to invert this relationship? Seems like it makes it harder to read

@oakbani
Copy link
Contributor

oakbani commented Nov 8, 2018

@rashidsp I would suggest that rather than modifying code or adding extra lines to comply with rubocop rule, ignore this particular rule in rubocop.yml.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

lgtm

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.

4 participants