Skip to content
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

Add rubocop to ci #938

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- run: bundle install && bundle exec rubocop
name: "Run RuboCop"
env:
RUBOCOP: yes
- run: bundle install && bundle exec rake test:rails
env:
RAILS: 5.2.8
Expand Down
17 changes: 17 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
inherit_from: .rubocop_todo.yml

# The behavior of RuboCop can be controlled via the .rubocop.yml
# configuration file. It makes it possible to enable/disable
# certain cops (checks) and to alter their behavior if they accept
# any parameters. The file can be placed either in your home
# directory or in some project directory.
#
# RuboCop will start looking for the configuration file in the directory
# where the inspected file is and continue its way up to the root directory.
#
# See https://docs.rubocop.org/rubocop/configuration
AllCops:
DisabledByDefault: true
TargetRubyVersion: 2.5
Security:
Enabled: true
20 changes: 20 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-10-05 22:09:56 UTC using RuboCop version 1.56.4.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 5
Security/Eval:
Exclude:
- 'lib/slim/command.rb'
- 'lib/slim/translator.rb'
- 'test/literate/run.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Security/YAMLLoad:
Exclude:
- 'lib/slim/command.rb'
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ if ENV['SINATRA']
gem 'sinatra', tag: "v#{ENV['SINATRA']}"
end
end

if ENV['RUBOCOP']
gem 'rubocop'
gem 'rubocop-rails'
end