Skip to content

Updated channel and documentation to Rubocop v0.60 #139

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 1 commit into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ source 'https://rubygems.org'

gem "activesupport", require: false
gem "mry", "~> 0.52.0", require: false
gem "parser", "~> 2.4.0"
gem "parser"
gem "pry", require: false
gem "rubocop", "~> 0.52.1", require: false
gem "rubocop", "~> 0.60", require: false
gem "rubocop-migrations", require: false
gem "rubocop-rspec", require: false
gem "safe_yaml"
Expand Down
30 changes: 16 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ GEM
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
ast (2.3.0)
ast (2.4.0)
coderay (1.1.2)
concurrent-ruby (1.0.5)
diff-lcs (1.3)
i18n (0.9.1)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.1)
method_source (0.9.0)
minitest (5.10.3)
mry (0.52.0.0)
rubocop (>= 0.41.0)
parallel (1.12.1)
parser (2.4.0.2)
ast (~> 2.3)
powerpack (0.1.1)
parser (2.5.3.0)
ast (~> 2.4.0)
powerpack (0.1.2)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
Expand All @@ -38,38 +39,39 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
rubocop (0.52.1)
rubocop (0.60.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.4.0.2, < 3.0)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
unicode-display_width (~> 1.4.0)
rubocop-migrations (0.1.2)
rubocop (~> 0.41)
rubocop-rspec (1.21.0)
rubocop (>= 0.52.0)
ruby-progressbar (1.9.0)
rubocop-rspec (1.30.1)
rubocop (>= 0.60.0)
ruby-progressbar (1.10.0)
safe_yaml (1.0.4)
thread_safe (0.3.6)
tzinfo (1.2.4)
thread_safe (~> 0.1)
unicode-display_width (1.3.0)
unicode-display_width (1.4.0)

PLATFORMS
ruby

DEPENDENCIES
activesupport
mry (~> 0.52.0)
parser (~> 2.4.0)
parser
pry
rake
rspec
rubocop (~> 0.52.1)
rubocop (~> 0.60)
rubocop-migrations
rubocop-rspec
safe_yaml

BUNDLED WITH
1.16.1
1.16.6
11 changes: 11 additions & 0 deletions config/contents/bundler/gem_comment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Add a comment describing each gem in your Gemfile.

### Example:
# bad

gem 'foo'

# good

# Helpers for the foo things.
gem 'foo'
2 changes: 1 addition & 1 deletion config/contents/bundler/insecure_protocol_source.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The symbol argument `:gemcutter`, `:rubygems` and `:rubyforge`
The symbol argument `:gemcutter`, `:rubygems`, and `:rubyforge`
are deprecated. So please change your source to URL string that
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.

Expand Down
2 changes: 1 addition & 1 deletion config/contents/gemspec/duplicated_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ in a gemspec.

Assigning to an attribute with the same name using `spec.foo =` will be
an unintended usage. On the other hand, duplication of methods such
as `spec.requirements`, `spec.add_runtime_dependency` and others are
as `spec.requirements`, `spec.add_runtime_dependency`, and others are
permitted because it is the intended use of appending values.

### Example:
Expand Down
153 changes: 114 additions & 39 deletions config/contents/layout/align_hash.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Check that the keys, separators, and values of a multi-line hash
literal are aligned according to configuration. The configuration
options are:

- key (left align keys)
- key (left align keys, one space before hash rockets and values)
- separator (align hash rockets and colons, right align keys)
- table (left align keys, hash rockets, and values)

Expand All @@ -14,81 +14,156 @@ can also be configured. The options are:
- ignore_implicit (without curly braces)
- ignore_explicit (with curly braces)

### Example:

# EnforcedHashRocketStyle: key (default)
# EnforcedColonStyle: key (default)

# good
### Example: EnforcedHashRocketStyle: key (default)
# bad
{
foo: bar,
ba: baz
:foo => bar,
:ba => baz
}
{
:foo => bar,
:ba => baz
}

# good
{
:foo => bar,
:ba => baz
}

### Example: EnforcedHashRocketStyle: separator
# bad
{
foo: bar,
ba: baz
:foo => bar,
:ba => baz
}
{
:foo => bar,
:ba => baz
:ba => baz
}

### Example:

# EnforcedHashRocketStyle: separator
# EnforcedColonStyle: separator

#good
{
foo: bar,
ba: baz
}
# good
{
:foo => bar,
:ba => baz
}

#bad
{
foo: bar,
ba: baz
}
### Example: EnforcedHashRocketStyle: table
# bad
{
:foo => bar,
:ba => baz
:ba => baz
}

# good
{
:foo => bar,
:ba => baz
}

### Example:
### Example: EnforcedColonStyle: key (default)
# bad
{
foo: bar,
ba: baz
}
{
foo: bar,
ba: baz
}

# EnforcedHashRocketStyle: table
# EnforcedColonStyle: table
# good
{
foo: bar,
ba: baz
}

#good
### Example: EnforcedColonStyle: separator
# bad
{
foo: bar,
ba: baz
ba: baz
}

# good
{
:foo => bar,
:ba => baz
foo: bar,
ba: baz
}

#bad
### Example: EnforcedColonStyle: table
# bad
{
foo: bar,
ba: baz
}

# good
{
:foo => bar,
:ba => baz
}
foo: bar,
ba: baz
}

### Example: EnforcedLastArgumentHashStyle: always_inspect (default)
# Inspect both implicit and explicit hashes.

# bad
do_something(foo: 1,
bar: 2)

# bad
do_something({foo: 1,
bar: 2})

# good
do_something(foo: 1,
bar: 2)

# good
do_something(
foo: 1,
bar: 2
)

# good
do_something({foo: 1,
bar: 2})

# good
do_something({
foo: 1,
bar: 2
})

### Example: EnforcedLastArgumentHashStyle: always_ignore
# Ignore both implicit and explicit hashes.

# good
do_something(foo: 1,
bar: 2)

# good
do_something({foo: 1,
bar: 2})

### Example: EnforcedLastArgumentHashStyle: ignore_implicit
# Ignore only implicit hashes.

# bad
do_something({foo: 1,
bar: 2})

# good
do_something(foo: 1,
bar: 2)

### Example: EnforcedLastArgumentHashStyle: ignore_explicit
# Ignore only explicit hashes.

# bad
do_something(foo: 1,
bar: 2)

# good
do_something({foo: 1,
bar: 2})
58 changes: 58 additions & 0 deletions config/contents/layout/block_alignment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
This cop checks whether the end keywords are aligned properly for do
end blocks.

Three modes are supported through the `EnforcedStyleAlignWith`
configuration parameter:

`start_of_block` : the `end` shall be aligned with the
start of the line where the `do` appeared.

`start_of_line` : the `end` shall be aligned with the
start of the line where the expression started.

`either` (which is the default) : the `end` is allowed to be in either
location. The autofixer will default to `start_of_line`.

### Example: EnforcedStyleAlignWith: either (default)
# bad

foo.bar
.each do
baz
end

# good

variable = lambda do |i|
i
end

### Example: EnforcedStyleAlignWith: start_of_block
# bad

foo.bar
.each do
baz
end

# good

foo.bar
.each do
baz
end

### Example: EnforcedStyleAlignWith: start_of_line
# bad

foo.bar
.each do
baz
end

# good

foo.bar
.each do
baz
end
2 changes: 1 addition & 1 deletion config/contents/layout/class_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ possible to group categories of macros.
end
end

@see https://github.com/bbatsov/ruby-style-guide#consistent-classes
@see https://github.com/rubocop-hq/ruby-style-guide#consistent-classes
Loading