Skip to content

Commit cb006a9

Browse files
committed
Fix rubocop
Signed-off-by: Diogo Tridapalli <[email protected]>
1 parent de15903 commit cb006a9

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

.rubocop.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Style/ClassCheck:
33
EnforcedStyle: kind_of?
44

5-
# It's better to be more explicit about the type
6-
Style/BracesAroundHashParameters:
7-
Enabled: false
8-
95
# specs sometimes have useless assignments, which is fine
106
Lint/UselessAssignment:
117
Exclude:
@@ -54,8 +50,8 @@ Metrics/CyclomaticComplexity:
5450
Max: 17
5551

5652
# Configuration parameters: AllowURI, URISchemes.
57-
Metrics/LineLength:
58-
Max: 120
53+
Layout/LineLength:
54+
Max: 130
5955

6056
# Configuration parameters: CountKeywordArgs.
6157
Metrics/ParameterLists:

lib/xcode_summary/plugin.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ def inline_mode
9898
def ignores_warnings
9999
@ignores_warnings || false
100100
end
101-
101+
102+
# Pick a Dangerfile plugin for a chosen request_source and cache it
103+
# based on https://github.com/danger/danger/blob/master/lib/danger/plugin_support/plugin.rb#L31
102104
def plugin
103-
# Pick a Dangerfile plugin for a chosen request_source
104-
# based on https://github.com/danger/danger/blob/master/lib/danger/plugin_support/plugin.rb#L31
105105
plugins = Plugin.all_plugins.select { |plugin| Dangerfile.essential_plugin_classes.include? plugin }
106106
@plugin ||= plugins.select { |p| p.method_defined? :html_link }.map { |p| p.new(@dangerfile) }.compact.first
107107
end

spec/xcode_summary_spec.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,29 @@ module Danger
5454
it 'formats compile warnings' do
5555
@xcode_summary.report('spec/fixtures/summary.json')
5656
expect(@dangerfile.status_report[:warnings]).to eq [
57-
# rubocop:disable LineLength
57+
# rubocop:disable Layout/LineLength
5858
"**<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/Bla.m#L32'>MyWeight/Bla.m#L32</a>**: Value stored to 'theme' is never read <br />```\n theme = *ptr++;\n```",
5959
"**<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/Pods/ISO8601DateFormatter/ISO8601DateFormatter.m#L176'>MyWeight/Pods/ISO8601DateFormatter/ISO8601DateFormatter.m#L176</a>**: 'NSUndefinedDateComponent' is deprecated: first deprecated in iOS 8.0 - Use NSDateComponentUndefined instead [-Wdeprecated-declarations] <br />```\n month_or_week = NSUndefinedDateComponent,\n```"
60-
# rubocop:enable LineLength
60+
# rubocop:enable Layout/LineLength
6161
]
6262
end
6363

6464
it 'formats compile warnings with empty line' do
6565
@xcode_summary.report('spec/fixtures/summary_with_empty_line.json')
6666
expect(@dangerfile.status_report[:warnings]).to eq [
67-
# rubocop:disable LineLength
67+
# rubocop:disable Layout/LineLength
6868
"**<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/Users/marcelofabri/Developer/MyAwesomeProject/MyAwesomeProject/Classes/AppDelegate.swift#L10001'>/Users/marcelofabri/Developer/MyAwesomeProject/MyAwesomeProject/Classes/AppDelegate.swift#L10001</a>**: File should contain 400 lines or less: currently contains 10001 <br />"
69-
# rubocop:enable LineLength
69+
# rubocop:enable Layout/LineLength
7070
]
7171
end
7272

7373
it 'ignores file when ignored_files matches' do
7474
@xcode_summary.ignored_files = '**/Pods/**'
7575
@xcode_summary.report('spec/fixtures/summary.json')
7676
expect(@dangerfile.status_report[:warnings]).to eq [
77-
# rubocop:disable LineLength
77+
# rubocop:disable Layout/LineLength
7878
"**<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/Bla.m#L32'>MyWeight/Bla.m#L32</a>**: Value stored to 'theme' is never read <br />```\n theme = *ptr++;\n```"
79-
# rubocop:enable LineLength
79+
# rubocop:enable Layout/LineLength
8080
]
8181
end
8282

@@ -89,10 +89,10 @@ module Danger
8989
it 'formats test errors' do
9090
@xcode_summary.report('spec/fixtures/test_errors.json')
9191
expect(@dangerfile.status_report[:errors]).to eq [
92-
# rubocop:disable LineLength
92+
# rubocop:disable Layout/LineLength
9393
'**MyWeight.MyWeightSpec**: works_with_success, expected to eventually not be nil, got \<nil\> <br /> ' \
9494
"<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/MyWeightTests/Tests.swift#L86'>MyWeight/MyWeightTests/Tests.swift#L86</a>"
95-
# rubocop:enable LineLength
95+
# rubocop:enable Layout/LineLength
9696
]
9797
end
9898

@@ -198,9 +198,7 @@ module Danger
198198
before do
199199
@dangerfile = testing_bitbucket_dangerfile
200200
@xcode_summary = @dangerfile.xcode_summary
201-
# rubocop:disable LineLength
202201
@xcode_summary.env.request_source.pr_json = JSON.parse(IO.read('spec/fixtures/bitbucket_pr.json'), symbolize_names: true)
203-
# rubocop:enable LineLength
204202
@xcode_summary.project_root = '/Users/diogo/src/danger-xcode_summary'
205203
end
206204

0 commit comments

Comments
 (0)