diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86b2275..9925fe5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,10 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@master + - name: RuboCop Linter Action + uses: andrewmcodes/rubocop-linter-action@v3.3.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create master.key uses: finnp/create-file-action@master env: diff --git a/Dockerfile.dev b/Dockerfile.dev index 5ac72cf..ed42131 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -25,7 +25,6 @@ COPY ./entrypoint.dev.sh /usr/bin/entrypoint.sh RUN chmod +x /usr/bin/entrypoint.sh RUN gem install bundler --version "$BUNDLE_VERSION" -RUN gem install rubocop COPY . . diff --git a/Gemfile b/Gemfile index 572deaf..fa6d43c 100644 --- a/Gemfile +++ b/Gemfile @@ -48,6 +48,8 @@ group :development do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' + # A Ruby static code analyzer and formatter, based on the community Ruby style guide. + gem 'rubocop', '~> 1.17' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 40d58e2..ffc4120 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,6 +46,7 @@ GEM public_suffix (>= 2.0.2, < 5.0) ansi (1.5.0) arel (9.0.0) + ast (2.4.2) bcrypt (3.1.16) bcrypt (3.1.16-java) bindex (0.8.1) @@ -104,6 +105,9 @@ GEM racc (~> 1.4) nokogiri (1.11.7-x86-mingw32) racc (~> 1.4) + parallel (1.20.1) + parser (3.0.1.1) + ast (~> 2.4.1) pg (1.2.3) pg (1.2.3-x64-mingw32) pg (1.2.3-x86-mingw32) @@ -143,12 +147,26 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) + rainbow (3.0.0) rake (13.0.3) rb-fsevent (0.11.0) rb-inotify (0.10.1) ffi (~> 1.0) redis (4.3.1) regexp_parser (2.1.1) + rexml (3.2.5) + rubocop (1.17.0) + parallel (~> 1.10) + parser (>= 3.0.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.7.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.7.0) + parser (>= 3.0.1.1) + ruby-progressbar (1.11.0) ruby_dep (1.5.0) rubyzip (2.3.0) selenium-webdriver (3.142.7) @@ -229,6 +247,7 @@ DEPENDENCIES puma (~> 4.3.8) rails (~> 5.2.6) redis (~> 4.0) + rubocop (~> 1.17) selenium-webdriver simplecov simplecov-console diff --git a/README.md b/README.md index 10cf898..17fc5db 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ docker-compose run --rm app bundle exec rails test ### Rubocop ```bash -docker-compose run --rm app rubocop +docker-compose run --rm app bundle exec rubocop ``` ## Results