Skip to content
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
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ RUN adduser -u 9000 -D app

COPY Gemfile Gemfile.lock /usr/src/app/

RUN gem install bundler && \
bundle install -j 4 --without=test && \
RUN apk add --update build-base && \
gem install bundler && \
bundle install --quiet -j 4 --without=test && \
chown -R app:app /usr/local/bundle && \
rm -fr ~/.gem ~/.bundle ~/.wh..gem
rm -fr ~/.gem ~/.bundle ~/.wh..gem && \
apk del build-base

COPY . /usr/src/app
RUN chown -R app:app .
Expand Down
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.57.0", require: false
gem "rubocop-migrations", require: false
gem "rubocop-rspec", require: false
gem "safe_yaml"
Expand Down
40 changes: 21 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,72 +1,74 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.1.4)
activesupport (5.2.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
i18n (>= 0.7, < 2)
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)
i18n (1.0.1)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.1)
method_source (0.9.0)
minitest (5.10.3)
minitest (5.11.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.1.0)
ast (~> 2.4.0)
powerpack (0.1.2)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
rainbow (3.0.0)
rake (12.3.0)
rake (12.3.1)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
rubocop (0.52.1)
rspec-support (3.7.1)
rubocop (0.57.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.4.0.2, < 3.0)
parser (>= 2.5)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
rubocop-migrations (0.1.2)
rubocop (~> 0.41)
rubocop-rspec (1.21.0)
rubocop (>= 0.52.0)
rubocop-rspec (1.27.0)
rubocop (>= 0.56.0)
ruby-progressbar (1.9.0)
safe_yaml (1.0.4)
thread_safe (0.3.6)
tzinfo (1.2.4)
tzinfo (1.2.5)
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.57.0)
rubocop-migrations
rubocop-rspec
safe_yaml
Expand Down
143 changes: 105 additions & 38 deletions config/contents/layout/align_hash.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,81 +14,148 @@ 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
}

# 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
}

# 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