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

Rubocop friendly cops part 10 #4264

Merged
merged 5 commits into from
Jan 4, 2018

Conversation

@DavidKang DavidKang added DO NOT MERGE ⚠️ Explain yourself if you add/remove this label to a PR Frontend Things related to the OBS RoR app Test Suite / CI 💉 Things related to our tests/CI labels Dec 21, 2017
@mdeniz
Copy link
Contributor

mdeniz commented Dec 21, 2017

I created a separate PR (#4265) for having master without errors. Please remove your last commit, now it will be unneeded.

@mdeniz
Copy link
Contributor

mdeniz commented Dec 21, 2017

LGTM overall, but I have some doubts about the Fix Style/LineEndConcatenation cop, is what we want?

@@ -302,9 +302,9 @@ class NoMatchingReleaseTarget < APIException
def verify_can_modify_target_package!
return if User.current.can_modify_package?(@package)

raise CmdExecutionNoPermission, "no permission to execute command '#{params[:cmd]}' " +
raise CmdExecutionNoPermission, "no permission to execute command '#{params[:cmd]}' " \
Copy link
Member

Choose a reason for hiding this comment

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

I can live with this change, but I don't really understand it... I need to look up the reasoning for why a backslash is preferred here.

@codecov
Copy link

codecov bot commented Dec 22, 2017

Codecov Report

Merging #4264 into master will increase coverage by 0.17%.
The diff coverage is 85.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4264      +/-   ##
==========================================
+ Coverage    87.8%   87.98%   +0.17%     
==========================================
  Files         340      340              
  Lines       18588    18463     -125     
==========================================
- Hits        16321    16244      -77     
+ Misses       2267     2219      -48
Flag Coverage Δ
#api 80.17% <82.4%> (+0.16%) ⬆️
#rspec 70.43% <61.88%> (+0.2%) ⬆️

@DavidKang
Copy link
Contributor Author

@mdeniz, thanks 😸

Ana06
Ana06 previously requested changes Jan 2, 2018
Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

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

@DavidKang in e85fd02 it should be frontend] Fix Style/HashSyntax offenses (in plural).

I think it is a good practise to mention in the commit message that the offenses were autocorrected. :bowtie:

Apart from that LGTM.

Copy link
Member

@ChrisBr ChrisBr left a comment

Choose a reason for hiding this comment

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

LGTM except of a few missing parentheses and string interpolation which is probably caused by the rubocop autocorrection...

if dp.error
currentpack['problems'] << 'error-' + dp.error
end
currentpack['problems'] << 'error-' + dp.error if dp.error
Copy link
Member

Choose a reason for hiding this comment

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

[nitpick]
Guess it is autocorrected but what about string interpolation?
"error-#{dp.error}"

if @submits.has_key? key
currentpack['requests_to'].concat(@submits[key])
end
currentpack['requests_to'].concat(@submits[key]) if @submits.has_key? key
Copy link
Member

Choose a reason for hiding this comment

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

[nitpick]
Guess it is autocorrected but what about parentheses?
@submits.has_key?(key)

(rubocop/rubocop#3224 has_key? seems to be "deprecated")

if splitted.length > 2
prjname += ':' + splitted[-1]
end
prjname += ':' + splitted[-1] if splitted.length > 2
Copy link
Member

Choose a reason for hiding this comment

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

[nitpick]
String interpolation?

if actions.is_a? Hash
actions = [actions]
end
actions = [actions] if actions.is_a? Hash
Copy link
Member

Choose a reason for hiding this comment

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

[nitpick]
Parentheses?

@DavidKang DavidKang dismissed Ana06’s stale review January 4, 2018 11:12

@Ana06, I corrected the commit message. about the mention in the commit message that was autocorrected, I prefer to mention it when they are manually corrected.

@mdeniz mdeniz merged commit 6ee3220 into openSUSE:master Jan 4, 2018
@DavidKang DavidKang deleted the feature/rubocop/style_cop_4 branch January 4, 2018 11:20
@DavidKang DavidKang removed the DO NOT MERGE ⚠️ Explain yourself if you add/remove this label to a PR label Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app Test Suite / CI 💉 Things related to our tests/CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants