Housekeeping

- Use setup ruby action
- Update gems
- Rubocop fixes
- Don't mutate params
This commit is contained in:
Hakan Ensari 2020-05-02 15:13:50 +01:00
parent 663034093f
commit 72fe6022c9
6 changed files with 30 additions and 20 deletions

View File

@ -5,8 +5,6 @@ on: [push, pull_request]
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: ruby:2.7.1
services: services:
postgres: postgres:
image: postgres:12 image: postgres:12
@ -17,6 +15,7 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
- run: gem install bundler - run: gem install bundler
- run: bundle install --jobs 4 --retry 3 - run: bundle install --jobs 4 --retry 3
- run: bundle exec rake - run: bundle exec rake

View File

@ -1,8 +1,9 @@
inherit_from: ".rubocop_todo.yml" inherit_from: ".rubocop_todo.yml"
require: require:
- rubocop-minitest
- rubocop-performance - rubocop-performance
- rubocop-sequel - rubocop-sequel
AllCops: AllCops:
TargetRubyVersion: 2.6 TargetRubyVersion: 2.7

View File

@ -1,15 +1,21 @@
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Metrics/AbcSize: Metrics/AbcSize:
Max: 21.79 Max: 21.79
Metrics/BlockLength: Metrics/BlockLength:
ExcludedMethods: ['dataset_module', 'describe', 'helpers'] ExcludedMethods: ['describe', 'helpers']
Metrics/MethodLength: Metrics/MethodLength:
Max: 13 Max: 13
Style/Documentation: Style/Documentation:
Enabled: false Enabled: false
# New cops
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Style/ExponentialNotation:
Enabled: true
Style/HashEachMethods: Style/HashEachMethods:
Enabled: true Enabled: true
Style/HashTransformKeys: Style/HashTransformKeys:

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
source 'http://rubygems.org' source 'https://rubygems.org'
ruby '2.7.1' ruby '2.7.1'
@ -19,6 +19,7 @@ group :test do
gem 'minitest-around' gem 'minitest-around'
gem 'minitest-focus' gem 'minitest-focus'
gem 'rack-test' gem 'rack-test'
gem 'rubocop-minitest'
gem 'rubocop-performance' gem 'rubocop-performance'
gem 'rubocop-sequel' gem 'rubocop-sequel'
gem 'simplecov' gem 'simplecov'

View File

@ -1,5 +1,5 @@
GEM GEM
remote: http://rubygems.org/ remote: https://rubygems.org/
specs: specs:
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
@ -10,7 +10,7 @@ GEM
docile (1.3.2) docile (1.3.2)
et-orbi (1.2.4) et-orbi (1.2.4)
tzinfo tzinfo
fugit (1.3.3) fugit (1.3.4)
et-orbi (~> 1.1, >= 1.1.8) et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.1) raabro (~> 1.1)
hashdiff (1.0.1) hashdiff (1.0.1)
@ -27,13 +27,13 @@ GEM
i18n (>= 0.6.4, <= 2) i18n (>= 0.6.4, <= 2)
mustermann (1.1.1) mustermann (1.1.1)
ruby2_keywords (~> 0.0.1) ruby2_keywords (~> 0.0.1)
oj (3.10.5) oj (3.10.6)
ox (2.13.2) ox (2.13.2)
parallel (1.19.1) parallel (1.19.1)
parser (2.7.0.5) parser (2.7.1.2)
ast (~> 2.4.0) ast (~> 2.4.0)
pg (1.2.3) pg (1.2.3)
public_suffix (4.0.3) public_suffix (4.0.4)
raabro (1.1.6) raabro (1.1.6)
rack (2.2.2) rack (2.2.2)
rack-cors (1.1.1) rack-cors (1.1.1)
@ -46,7 +46,7 @@ GEM
raindrops (0.19.1) raindrops (0.19.1)
rake (13.0.1) rake (13.0.1)
rexml (3.2.4) rexml (3.2.4)
rubocop (0.81.0) rubocop (0.82.0)
jaro_winkler (~> 1.5.1) jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.7.0.1) parser (>= 2.7.0.1)
@ -54,6 +54,8 @@ GEM
rexml rexml
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0) unicode-display_width (>= 1.4.0, < 2.0)
rubocop-minitest (0.9.0)
rubocop (>= 0.74)
rubocop-performance (1.5.2) rubocop-performance (1.5.2)
rubocop (>= 0.71.0) rubocop (>= 0.71.0)
rubocop-sequel (0.0.6) rubocop-sequel (0.0.6)
@ -63,8 +65,8 @@ GEM
rufus-scheduler (3.6.0) rufus-scheduler (3.6.0)
fugit (~> 1.1, >= 1.1.6) fugit (~> 1.1, >= 1.1.6)
safe_yaml (1.0.5) safe_yaml (1.0.5)
sequel (5.31.0) sequel (5.32.0)
sequel_pg (1.12.5) sequel_pg (1.13.0)
pg (>= 0.18.0, != 1.2.0) pg (>= 0.18.0, != 1.2.0)
sequel (>= 4.38.0) sequel (>= 4.38.0)
simplecov (0.18.5) simplecov (0.18.5)
@ -77,10 +79,10 @@ GEM
rack-protection (= 2.0.8.1) rack-protection (= 2.0.8.1)
tilt (~> 2.0) tilt (~> 2.0)
tilt (2.0.10) tilt (2.0.10)
tzinfo (2.0.1) tzinfo (2.0.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (1.7.0) unicode-display_width (1.7.0)
unicorn (5.5.4) unicorn (5.5.5)
kgio (~> 2.6) kgio (~> 2.6)
raindrops (~> 0.7) raindrops (~> 0.7)
vcr (5.1.0) vcr (5.1.0)
@ -102,6 +104,7 @@ DEPENDENCIES
rack-cors rack-cors
rack-test rack-test
rake rake
rubocop-minitest
rubocop-performance rubocop-performance
rubocop-sequel rubocop-sequel
rufus-scheduler rufus-scheduler

View File

@ -56,7 +56,7 @@ helpers do
def json(data) def json(data)
json = Oj.dump(data, mode: :compat) json = Oj.dump(data, mode: :compat)
callback = params.delete('callback') callback = params['callback']
if callback if callback
content_type :js content_type :js