-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds rubocop
- Loading branch information
Thiru Njuguna
committed
Oct 27, 2018
1 parent
81fe6f9
commit 58762cd
Showing
14 changed files
with
319 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
AllCops: | ||
TargetRubyVersion: 2.5 | ||
Exclude: | ||
- lib/swaggering.rb | ||
- api/** | ||
- Guardfile | ||
- my_app.rb | ||
- spec/spec_helper.rb | ||
- tmp/** | ||
- db/schema.rb | ||
|
||
Documentation: | ||
# don't require classes to be documented | ||
Enabled: false | ||
|
||
Style/FrozenStringLiteralComment: | ||
# don't require frozen literal comment | ||
Enabled: false | ||
|
||
Encoding: | ||
# no need to always specify encoding | ||
Enabled: false | ||
|
||
AlignParameters: | ||
# allow for multi-line methods to have normal indentation. | ||
# for example: | ||
# | ||
# Person.where( | ||
# first_name: 'tom', | ||
# last_name: 'foolery' | ||
# ) | ||
EnforcedStyle: with_fixed_indentation | ||
|
||
Layout/AlignParameters: | ||
# allow for end of if to be aligned with a variable. | ||
# for example: | ||
# | ||
# foo = if a == b | ||
# 'bar' | ||
# else | ||
# 'baz' | ||
# end | ||
EnforcedStyle: with_fixed_indentation | ||
|
||
Layout/MultilineMethodCallIndentation: | ||
EnforcedStyle: indented | ||
|
||
Lint/EndAlignment: | ||
EnforcedStyleAlignWith: variable | ||
|
||
ClassAndModuleChildren: | ||
# ok to use compact style when modules are predefined. | ||
# for example the following is fine so long as we're sure that | ||
# module MDB has already been required/defined. | ||
# | ||
# class MDB::Person; end | ||
Enabled: false | ||
|
||
Style/PercentLiteralDelimiters: | ||
PreferredDelimiters: | ||
default: () | ||
"%i": () | ||
"%w": () | ||
|
||
Style/FormatString: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,16 @@ | ||
# base layer | ||
FROM ruby:2.5.1 AS base | ||
|
||
WORKDIR /usr/src/app | ||
WORKDIR /easy_rental | ||
|
||
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs && apt-get install yarn -qq | ||
|
||
RUN gem install bundler | ||
|
||
COPY Gemfile /usr/src/app/Gemfile | ||
COPY Gemfile /easy_rental/Gemfile | ||
|
||
COPY Gemfile.lock /usr/src/app/Gemfile.lock | ||
COPY Gemfile.lock /easy_rental/Gemfile.lock | ||
|
||
# development and test layer with all dependencies | ||
FROM base AS development | ||
RUN bundle install | ||
|
||
RUN bundle install -j5 --without staging production | ||
|
||
COPY . /usr/src/app | ||
|
||
# release layer | ||
FROM base AS release | ||
|
||
RUN bundle install -j5 --without development test | ||
|
||
COPY . /usr/src/app | ||
|
||
CMD puma | ||
COPY . /easy_rental |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
guard :rspec, cmd: 'rspec', all_after_pass: true, all_on_start: true do | ||
require 'guard/rspec/dsl' | ||
dsl = Guard::RSpec::Dsl.new(self) | ||
|
||
# RSpec files | ||
rspec = dsl.rspec | ||
watch(rspec.spec_helper) { rspec.spec_dir } | ||
watch(rspec.spec_support) { rspec.spec_dir } | ||
watch(rspec.spec_files) | ||
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
|
||
# Ruby files | ||
ruby = dsl.ruby | ||
dsl.watch_spec_files_for(ruby.lib_files) | ||
end | ||
|
||
guard :rubocop, cli: ['--display-cop-names'] do | ||
watch(/.+\.rb$/) | ||
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.