Skip to content

Commit 6692a50

Browse files
authored
Setup Standard and Rubocop #1930 (#1933)
Fix: bundle exec rubocop instead of bin/rubocop Call lint command in docker container Add Lint Job Add rubocop action
1 parent 57f847f commit 6692a50

File tree

6 files changed

+2055
-0
lines changed

6 files changed

+2055
-0
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,14 @@ jobs:
9494
name: |
9595
unit_tests_coverage
9696
integration_tests_coverage
97+
98+
lint:
99+
runs-on: ubuntu-latest
100+
needs: setup
101+
steps:
102+
- uses: actions/checkout@v3
103+
- run: docker compose build web
104+
- uses: ./.github/actions/gems-cache
105+
106+
- name: Lint Ruby files
107+
run: docker compose run --rm --no-deps web bundle exec rubocop --parallel

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ config/settings/*.local.yml
3838
public/system
3939
examples.txt
4040
Procfile.local
41+
.overcommit.yml
4142

4243
# Artefacts
4344
/coverage

.rubocop.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
inherit_from: .rubocop_todo.yml
2+
3+
# The behavior of RuboCop can be controlled via the .rubocop.yml
4+
# configuration file. It makes it possible to enable/disable
5+
# certain cops (checks) and to alter their behavior if they accept
6+
# any parameters. The file can be placed either in your home
7+
# directory or in some project directory.
8+
#
9+
# RuboCop will start looking for the configuration file in the directory
10+
# where the inspected file is and continue its way up to the root directory.
11+
#
12+
13+
require:
14+
- standard
15+
- rubocop-rails
16+
- rubocop-rspec
17+
18+
inherit_gem:
19+
standard: config/base.yml
20+
21+
AllCops:
22+
NewCops: enable
23+
Exclude:
24+
- node_modules/**/*
25+
- public/**/*
26+
- vendor/**/*
27+
28+
Rails:
29+
Enabled: true # enable rubocop-rails cops
30+
RSpec:
31+
Enabled: true # enable rubocop-rspec cops
32+
RSpec/DescribeClass:
33+
Enabled: false # ignore missing comments on classes
34+
Bundler/DuplicatedGem:
35+
Enabled: false # ignore duplicated gem errors because we will have duplicated gems when dual booting

0 commit comments

Comments
 (0)