Skip to content

Commit 55fbeb0

Browse files
authored
chore: Move rubocop to mise (#3011)
* chore: Move rubocop to mise * relock after removing rubocop
1 parent 15ab92a commit 55fbeb0

137 files changed

Lines changed: 2906 additions & 8132 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
10-
- name: Set up Ruby
11-
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1
10+
- name: Set up mise
11+
uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
1212
with:
13-
ruby-version: "3.4"
14-
bundler-cache: true
13+
install: true
14+
cache: false # don't cache this single ruby one since it will evict the CI with all rubies
1515
- name: Run rubocop
16-
run: bundle exec rubocop
16+
run: mise run lint

.mise.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ ruby = "latest"
66
node = "lts"
77
java = "temurin-21"
88

9+
[tasks.lint]
10+
description = "Lint the whole repo with rubocop"
11+
dir = "{{ config_root }}"
12+
env.BUNDLE_GEMFILE = "{{ config_root }}/Gemfile.rubocop"
13+
run = [
14+
"bundle check >/dev/null 2>&1 || bundle install",
15+
"bundle exec rubocop"
16+
]
17+
18+
[tasks."lint:fix"]
19+
description = "Lint the whole repo with rubocop and autocorrect"
20+
dir = "{{ config_root }}"
21+
env.BUNDLE_GEMFILE = "{{ config_root }}/Gemfile.rubocop"
22+
run = [
23+
"bundle check >/dev/null 2>&1 || bundle install",
24+
"bundle exec rubocop -a"
25+
]
26+
927
[tasks."e2e:rails"]
1028
description = "Start the rails-mini e2e app"
1129
run = "cd spec/apps/rails-mini && bundle exec ruby app.rb"

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ AllCops:
1818
- "sentry-*/tmp/**/*"
1919
- "sentry-*/examples/**/*"
2020
- "sentry-*/spec/versioned/2.7/**/*"
21+
- "**/gemfiles/**/*"

AGENTS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ You can also invoke `bin/test` from any of the gem directories themselves which
3737
Root-level `bundle exec rake` runs the E2E/integration spec suite (not individual gem tests).
3838

3939
## Lint
40-
Run from within the target gem directory (e.g. `cd sentry-ruby`):
40+
Linting runs through mise tasks from the repo root. Rubocop lives in its own
41+
`Gemfile.rubocop` (not the test matrix), which the tasks select automatically.
4142

4243
| Task | Command |
4344
|------|---------|
44-
| Lint | `bundle exec rubocop path/to/file.rb` |
45-
| Lint (autofix) | `bundle exec rubocop -a path/to/file.rb` |
46-
47-
Root-level `bundle exec rubocop` lints the entire repo.
45+
| Lint the whole repo | `mise run lint` |
46+
| Lint + autocorrect | `mise run lint:fix` |
47+
| Lint specific paths | `mise run lint path/to/file.rb` |
4848

4949
## Testing Conventions
5050
- Framework: **RSpec**

Gemfile.dev

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,3 @@ gem "simplecov"
3737
# passes in all projects
3838
gem "rexml", "3.4.1"
3939
gem "simplecov-cobertura", "~> 3.0"
40-
41-
group :rubocop do
42-
gem "rubocop-rails-omakase"
43-
gem "rubocop-packaging"
44-
end

Gemfile.rubocop

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# Standalone gemfile for linting. Kept out of Gemfile.dev so rubocop and its
4+
# dependency tree never enter the per-matrix test lockfiles. Used by the `lint`
5+
# mise task via BUNDLE_GEMFILE.
6+
7+
source "https://rubygems.org"
8+
9+
gem "rubocop-rails-omakase"
10+
gem "rubocop-packaging"

Gemfile.rubocop.lock

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
activesupport (8.1.1)
5+
base64
6+
bigdecimal
7+
concurrent-ruby (~> 1.0, >= 1.3.1)
8+
connection_pool (>= 2.2.5)
9+
drb
10+
i18n (>= 1.6, < 2)
11+
json
12+
logger (>= 1.4.2)
13+
minitest (>= 5.1)
14+
securerandom (>= 0.3)
15+
tzinfo (~> 2.0, >= 2.0.5)
16+
uri (>= 0.13.1)
17+
ast (2.4.3)
18+
base64 (0.3.0)
19+
bigdecimal (4.1.2)
20+
concurrent-ruby (1.3.7)
21+
connection_pool (3.0.2)
22+
drb (2.2.3)
23+
i18n (1.14.8)
24+
concurrent-ruby (~> 1.0)
25+
json (2.20.0)
26+
language_server-protocol (3.17.0.5)
27+
lint_roller (1.1.0)
28+
logger (1.7.0)
29+
minitest (6.0.6)
30+
drb (~> 2.0)
31+
prism (~> 1.5)
32+
parallel (1.27.0)
33+
parser (3.3.10.0)
34+
ast (~> 2.4.1)
35+
racc
36+
prism (1.9.0)
37+
racc (1.8.1)
38+
rack (3.2.1)
39+
rainbow (3.1.1)
40+
regexp_parser (2.11.3)
41+
rubocop (1.82.0)
42+
json (~> 2.3)
43+
language_server-protocol (~> 3.17.0.2)
44+
lint_roller (~> 1.1.0)
45+
parallel (~> 1.10)
46+
parser (>= 3.3.0.2)
47+
rainbow (>= 2.2.2, < 4.0)
48+
regexp_parser (>= 2.9.3, < 3.0)
49+
rubocop-ast (>= 1.48.0, < 2.0)
50+
ruby-progressbar (~> 1.7)
51+
unicode-display_width (>= 2.4.0, < 4.0)
52+
rubocop-ast (1.48.0)
53+
parser (>= 3.3.7.2)
54+
prism (~> 1.4)
55+
rubocop-packaging (0.6.0)
56+
lint_roller (~> 1.1.0)
57+
rubocop (>= 1.72.1, < 2.0)
58+
rubocop-performance (1.26.1)
59+
lint_roller (~> 1.1)
60+
rubocop (>= 1.75.0, < 2.0)
61+
rubocop-ast (>= 1.47.1, < 2.0)
62+
rubocop-rails (2.34.2)
63+
activesupport (>= 4.2.0)
64+
lint_roller (~> 1.1)
65+
rack (>= 1.1)
66+
rubocop (>= 1.75.0, < 2.0)
67+
rubocop-ast (>= 1.44.0, < 2.0)
68+
rubocop-rails-omakase (1.1.0)
69+
rubocop (>= 1.72)
70+
rubocop-performance (>= 1.24)
71+
rubocop-rails (>= 2.30)
72+
ruby-progressbar (1.13.0)
73+
securerandom (0.4.1)
74+
tzinfo (2.0.6)
75+
concurrent-ruby (~> 1.0)
76+
unicode-display_width (3.2.0)
77+
unicode-emoji (~> 4.1)
78+
unicode-emoji (4.2.0)
79+
uri (1.1.1)
80+
81+
PLATFORMS
82+
ruby
83+
x86_64-linux
84+
85+
DEPENDENCIES
86+
rubocop-packaging
87+
rubocop-rails-omakase
88+
89+
CHECKSUMS
90+
activesupport (8.1.1)
91+
ast (2.4.3)
92+
base64 (0.3.0)
93+
bigdecimal (4.1.2)
94+
bundler (4.0.15) sha256=a4ceb882fe94a0e0ac63cd0813932bbfd631a14e5ac0b7975189b19a4d28d9e7
95+
concurrent-ruby (1.3.7)
96+
connection_pool (3.0.2)
97+
drb (2.2.3)
98+
i18n (1.14.8)
99+
json (2.20.0)
100+
language_server-protocol (3.17.0.5)
101+
lint_roller (1.1.0)
102+
logger (1.7.0)
103+
minitest (6.0.6)
104+
parallel (1.27.0)
105+
parser (3.3.10.0)
106+
prism (1.9.0)
107+
racc (1.8.1)
108+
rack (3.2.1)
109+
rainbow (3.1.1)
110+
regexp_parser (2.11.3)
111+
rubocop (1.82.0)
112+
rubocop-ast (1.48.0)
113+
rubocop-packaging (0.6.0)
114+
rubocop-performance (1.26.1)
115+
rubocop-rails (2.34.2)
116+
rubocop-rails-omakase (1.1.0)
117+
ruby-progressbar (1.13.0)
118+
securerandom (0.4.1)
119+
tzinfo (2.0.6)
120+
unicode-display_width (3.2.0)
121+
unicode-emoji (4.2.0)
122+
uri (1.1.1)
123+
124+
BUNDLED WITH
125+
4.0.15

bin/test

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# A cell is keyed by its committed wrapper gemfile + sibling .gemfile.lock (run
1111
# bin/relock to (re)generate those). We exec under the cell's mise Ruby with the
1212
# cell's env (BUNDLE_GEMFILE, RACK_VERSION, REDIS_RB_VERSION, RUBYOPT) and run
13-
# `bundle exec rspec` (or rake) — the same BUNDLE_FROZEN/BUNDLE_WITHOUT setup CI
14-
# uses, so a green run here means the same as a green job there.
13+
# `bundle exec rspec` (or rake) — the same BUNDLE_FROZEN setup CI uses, so a
14+
# green run here means the same as a green job there.
1515
#
1616
# bin/test -l # list every cell to choose from
1717
# bin/test --gem sentry-rails # auto-pick the newest installed Ruby cell
@@ -118,11 +118,10 @@ cell, gem =
118118

119119
ensure_installed([cell])
120120

121-
# Mirror CI's per-job env: pin to the committed lock (BUNDLE_FROZEN), skip the
122-
# rubocop group, and pass the matrix axes + rubyopt the Gemfile/specs read.
121+
# Mirror CI's per-job env: pin to the committed lock (BUNDLE_FROZEN) and pass
122+
# the matrix axes + rubyopt the Gemfile/specs read.
123123
env = cell_env(cell).merge(
124-
"BUNDLE_FROZEN" => "true",
125-
"BUNDLE_WITHOUT" => "rubocop"
124+
"BUNDLE_FROZEN" => "true"
126125
)
127126
env["RUBYOPT"] = cell.rubyopt if cell.rubyopt
128127
env["JRUBY_OPTS"] = "--debug" if cell.ruby.include?("jruby") # for more accurate coverage, as in CI

sentry-delayed_job/.rubocop.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

sentry-delayed_job/gemfiles/ruby-2.7.gemfile.lock

Lines changed: 1 addition & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)