Skip to content

Commit

Permalink
Merge pull request #55 from CDLUC3/rubocop
Browse files Browse the repository at this point in the history
Enable Rubocop Checks for docker images
  • Loading branch information
terrywbrady authored Jan 3, 2024
2 parents 1951e81 + 8edf089 commit c1262af
Show file tree
Hide file tree
Showing 10 changed files with 341 additions and 83 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Rubocop

on: [push, pull_request]

jobs:
rubocop:
runs-on: ubuntu-20.04

steps:
# Checkout the repo
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
working-directory: mrt-services/callback

- name: 'Run Rubocop'
run: bundle exec rubocop
working-directory: mrt-services/callback

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
working-directory: mrt-inttest-services/mock-merritt-it

- name: 'Run Rubocop'
run: bundle exec rubocop
working-directory: mrt-inttest-services/mock-merritt-it

63 changes: 63 additions & 0 deletions mrt-inttest-services/mock-merritt-it/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Metrics/ClassLength:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Metrics/BlockNesting:
Enabled: false
Metrics/ParameterLists:
Enabled: false

Naming/AccessorMethodName:
Enabled: false
Style/NestedTernaryOperator:
Enabled: false
Naming/PredicateName:
Enabled: false

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
Naming/MethodParameterName:
Enabled: false
Layout/MultilineOperationIndentation:
Enabled: false
Style/GlobalVars:
Enabled: false
Style/ConditionalAssignment:
Enabled: false
Style/ClassVars:
Enabled: false

# Rubocop errors out when the following are added: https://github.com/rubocop/rubocop/issues/12548
#Layout/FirstArrayElementIndentation:
# Enabled: true
#Layout/FirstArrayElementLineBreak:
# Enabled: true
#Layout/ArrayAlignment:
# EnforcedStyle: with_fixed_indentation
#Layout/MultilineArrayBraceLayout:
# EnforcedStyle: new_line

Layout/FirstHashElementIndentation:
Enabled: true
EnforcedStyle: consistent
Layout/MultilineHashKeyLineBreaks:
Enabled: true
Layout/MultilineHashBraceLayout:
EnforcedStyle: new_line


AllCops:
NewCops: enable

9 changes: 6 additions & 3 deletions mrt-inttest-services/mock-merritt-it/Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
source "https://rubygems.org"
gem 'sinatra'
# frozen_string_literal: true

source 'https://rubygems.org'
gem 'mustache'
gem 'redcarpet'
gem 'thin'
gem 'rubocop'
gem 'sinatra'
gem 'thin'
27 changes: 27 additions & 0 deletions mrt-inttest-services/mock-merritt-it/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
daemons (1.4.1)
eventmachine (1.2.7)
json (2.7.1)
language_server-protocol (3.17.0.3)
mustache (1.1.1)
mustermann (2.0.2)
ruby2_keywords (~> 0.0.1)
parallel (1.24.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
racc (1.7.3)
rack (2.2.7)
rack-protection (2.2.3)
rack
rainbow (3.1.1)
redcarpet (3.5.1)
regexp_parser (2.8.3)
rexml (3.2.6)
rubocop (1.59.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
sinatra (2.2.3)
mustermann (~> 2.0)
Expand All @@ -21,13 +46,15 @@ GEM
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
tilt (2.1.0)
unicode-display_width (2.5.0)

PLATFORMS
ruby

DEPENDENCIES
mustache
redcarpet
rubocop
sinatra
thin

Expand Down
Loading

0 comments on commit c1262af

Please sign in to comment.