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

Bump rubocop to use `v0.50.x` #6368

Merged
merged 6 commits into from Sep 22, 2017

Conversation

Projects
None yet
5 participants
@ashmaroli
Member

ashmaroli commented Sep 15, 2017

Fixes #6367

@pathawks

Thanks for taking the time to do this 🍻👍

@@ -86,7 +86,7 @@ def fsnotify_buggy?(_site)
def urls_only_differ_by_case(site)
urls_only_differ_by_case = false
urls = case_insensitive_urls(site.pages + site.docs_to_write, site.dest)
urls.each do |_case_insensitive_url, real_urls|
urls.each_value do |real_urls|

This comment has been minimized.

@pathawks

pathawks Sep 15, 2017

Member

Cool!

@pathawks

pathawks Sep 15, 2017

Member

Cool!

@parkr

Nice! One code update suggestion and some thoughts on the configuration changes. Instead of turning them off, it might be better to exclude certain files if we decide that the rule is helpful (most are).

@@ -42,12 +42,14 @@ def convert(content)
end
private
# rubocop:disable Performance/HashEachMethods
def make_accessible(hash = @config)
hash.keys.each do |key|

This comment has been minimized.

@parkr

parkr Sep 15, 2017

Member

Can we use each_key here?

@parkr

parkr Sep 15, 2017

Member

Can we use each_key here?

This comment has been minimized.

@ashmaroli

ashmaroli Sep 15, 2017

Member

each_key broke our test-suite..

@ashmaroli

ashmaroli Sep 15, 2017

Member

each_key broke our test-suite..

@@ -82,6 +86,12 @@ Metrics/ParameterLists:
Max: 4
Metrics/PerceivedComplexity:
Max: 8
Naming/FileName:
Enabled: false

This comment has been minimized.

@parkr

parkr Sep 15, 2017

Member

What fails for this one?

@parkr

parkr Sep 15, 2017

Member

What fails for this one?

This comment has been minimized.

@ashmaroli

ashmaroli Sep 15, 2017

Member

From their docs,

This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.

and flags us for the following:
- 'Gemfile'
- 'Rakefile'
- 'lib/theme_template/Gemfile'
- 'test/fixtures/test-dependency-theme/test-dependency-theme.gemspec'
- 'test/fixtures/test-theme/test-theme.gemspec'

which IMO is a bug because this cop existed as an enabled-by-default-cop earlier known as Style/FileName

@ashmaroli

ashmaroli Sep 15, 2017

Member

From their docs,

This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.

and flags us for the following:
- 'Gemfile'
- 'Rakefile'
- 'lib/theme_template/Gemfile'
- 'test/fixtures/test-dependency-theme/test-dependency-theme.gemspec'
- 'test/fixtures/test-theme/test-theme.gemspec'

which IMO is a bug because this cop existed as an enabled-by-default-cop earlier known as Style/FileName

This comment has been minimized.

@parkr

parkr Sep 21, 2017

Member

Yeah... that looks like a bug. Weird.

@parkr

parkr Sep 21, 2017

Member

Yeah... that looks like a bug. Weird.

Show outdated Hide outdated .rubocop.yml Outdated
Show outdated Hide outdated .rubocop.yml Outdated
Show outdated Hide outdated .rubocop.yml Outdated
Lint/UnreachableCode:
Severity: error
Lint/UselessAccessModifier:
Enabled: false
Lint/Void:
Enabled: false

This comment has been minimized.

@parkr

parkr Sep 15, 2017

Member

What even is this? 😂

@parkr

parkr Sep 15, 2017

Member

What even is this? 😂

This comment has been minimized.

@ashmaroli

ashmaroli Sep 15, 2017

Member

This cop checks for the use of a return with a value in a context where it will be ignored.
In our case specifically, this cop (incorrectly ?) flags Site#config= similar to the documented example

@ashmaroli

ashmaroli Sep 15, 2017

Member

This cop checks for the use of a return with a value in a context where it will be ignored.
In our case specifically, this cop (incorrectly ?) flags Site#config= similar to the documented example

This comment has been minimized.

@parkr

parkr Sep 21, 2017

Member

Oh we must return some value and it doesn't like that! We can enable it in a subsequent pass.

@parkr

parkr Sep 21, 2017

Member

Oh we must return some value and it doesn't like that! We can enable it in a subsequent pass.

@@ -44,10 +44,14 @@ Layout/SpaceInsideBrackets:
Enabled: false
Lint/EndAlignment:
Severity: error
Lint/RescueWithoutErrorClass:
Enabled: false

This comment has been minimized.

@parkr

parkr Sep 15, 2017

Member

Oooo we should enable this.

@parkr

parkr Sep 15, 2017

Member

Oooo we should enable this.

This comment has been minimized.

@ashmaroli

ashmaroli Sep 15, 2017

Member

I wasn't sure about it though, since unnamed rescue means rescuing StandardError by default.

@ashmaroli

ashmaroli Sep 15, 2017

Member

I wasn't sure about it though, since unnamed rescue means rescuing StandardError by default.

This comment has been minimized.

@parkr

parkr Sep 21, 2017

Member

Yeah, but it's always better to rescue explicitly what you want to rescue instead of everything. We can do this in a subsequent pass.

@parkr

parkr Sep 21, 2017

Member

Yeah, but it's always better to rescue explicitly what you want to rescue instead of everything. We can do this in a subsequent pass.

@@ -21,7 +21,7 @@ Layout/EmptyLinesAroundAccessModifier:
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/EndOfLine:
EnforcedStyle: lf
EnforcedStyle: native

This comment has been minimized.

@parkr

parkr Sep 15, 2017

Member

Done we want lf here?

@parkr

parkr Sep 15, 2017

Member

Done we want lf here?

This comment has been minimized.

@ashmaroli

ashmaroli Sep 15, 2017

Member

Technically, we do.. but if a developer on Windows were to run script/fmt they'd unnecessarily get taxed by Rubocop. In my own experience, it has been irritating..
A properly configured Git on Windows automatically indexes files compatible for cross-platform use.

@ashmaroli

ashmaroli Sep 15, 2017

Member

Technically, we do.. but if a developer on Windows were to run script/fmt they'd unnecessarily get taxed by Rubocop. In my own experience, it has been irritating..
A properly configured Git on Windows automatically indexes files compatible for cross-platform use.

This comment has been minimized.

@parkr

parkr Sep 21, 2017

Member

👍

@parkr

parkr Sep 21, 2017

Member

👍

@DirtyF

DirtyF approved these changes Sep 22, 2017

@pathawks

This comment has been minimized.

Show comment
Hide comment
@pathawks

pathawks Sep 22, 2017

Member

@jekyllbot: merge +dev

Member

pathawks commented Sep 22, 2017

@jekyllbot: merge +dev

@jekyllbot jekyllbot merged commit 00bad8b into jekyll:master Sep 22, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ashmaroli ashmaroli deleted the ashmaroli:bump-rubocop branch Sep 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment