Skip to content
Merged
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
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set up Ruby
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1
- name: Set up mise
uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
with:
ruby-version: "3.4"
bundler-cache: true
install: true
cache: false # don't cache this single ruby one since it will evict the CI with all rubies
- name: Run rubocop
run: bundle exec rubocop
run: mise run lint
18 changes: 18 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ ruby = "latest"
node = "lts"
java = "temurin-21"

[tasks.lint]
description = "Lint the whole repo with rubocop"
dir = "{{ config_root }}"
env.BUNDLE_GEMFILE = "{{ config_root }}/Gemfile.rubocop"
run = [
"bundle check >/dev/null 2>&1 || bundle install",
"bundle exec rubocop"
]

[tasks."lint:fix"]
description = "Lint the whole repo with rubocop and autocorrect"
dir = "{{ config_root }}"
env.BUNDLE_GEMFILE = "{{ config_root }}/Gemfile.rubocop"
run = [
"bundle check >/dev/null 2>&1 || bundle install",
"bundle exec rubocop -a"
]

[tasks."e2e:rails"]
description = "Start the rails-mini e2e app"
run = "cd spec/apps/rails-mini && bundle exec ruby app.rb"
Expand Down
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ AllCops:
- "sentry-*/tmp/**/*"
- "sentry-*/examples/**/*"
- "sentry-*/spec/versioned/2.7/**/*"
- "**/gemfiles/**/*"
10 changes: 5 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ You can also invoke `bin/test` from any of the gem directories themselves which
Root-level `bundle exec rake` runs the E2E/integration spec suite (not individual gem tests).

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

| Task | Command |
|------|---------|
| Lint | `bundle exec rubocop path/to/file.rb` |
| Lint (autofix) | `bundle exec rubocop -a path/to/file.rb` |

Root-level `bundle exec rubocop` lints the entire repo.
| Lint the whole repo | `mise run lint` |
| Lint + autocorrect | `mise run lint:fix` |
| Lint specific paths | `mise run lint path/to/file.rb` |

## Testing Conventions
- Framework: **RSpec**
Expand Down
5 changes: 0 additions & 5 deletions Gemfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,3 @@ gem "simplecov"
# passes in all projects
gem "rexml", "3.4.1"
gem "simplecov-cobertura", "~> 3.0"

Comment thread
cursor[bot] marked this conversation as resolved.
group :rubocop do
gem "rubocop-rails-omakase"
gem "rubocop-packaging"
end
10 changes: 10 additions & 0 deletions Gemfile.rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

# Standalone gemfile for linting. Kept out of Gemfile.dev so rubocop and its
# dependency tree never enter the per-matrix test lockfiles. Used by the `lint`
# mise task via BUNDLE_GEMFILE.

source "https://rubygems.org"

gem "rubocop-rails-omakase"
gem "rubocop-packaging"
125 changes: 125 additions & 0 deletions Gemfile.rubocop.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (8.1.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
json
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.3)
base64 (0.3.0)
bigdecimal (4.1.2)
concurrent-ruby (1.3.7)
connection_pool (3.0.2)
drb (2.2.3)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
json (2.20.0)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
minitest (6.0.6)
drb (~> 2.0)
prism (~> 1.5)
parallel (1.27.0)
parser (3.3.10.0)
ast (~> 2.4.1)
racc
prism (1.9.0)
racc (1.8.1)
rack (3.2.1)
rainbow (3.1.1)
regexp_parser (2.11.3)
rubocop (1.82.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.48.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.48.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-packaging (0.6.0)
lint_roller (~> 1.1.0)
rubocop (>= 1.72.1, < 2.0)
rubocop-performance (1.26.1)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-rails (2.34.2)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rails-omakase (1.1.0)
rubocop (>= 1.72)
rubocop-performance (>= 1.24)
rubocop-rails (>= 2.30)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
uri (1.1.1)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
rubocop-packaging
rubocop-rails-omakase

CHECKSUMS
activesupport (8.1.1)
ast (2.4.3)
base64 (0.3.0)
bigdecimal (4.1.2)
bundler (4.0.15) sha256=a4ceb882fe94a0e0ac63cd0813932bbfd631a14e5ac0b7975189b19a4d28d9e7
concurrent-ruby (1.3.7)
connection_pool (3.0.2)
drb (2.2.3)
i18n (1.14.8)
json (2.20.0)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
minitest (6.0.6)
parallel (1.27.0)
parser (3.3.10.0)
prism (1.9.0)
racc (1.8.1)
rack (3.2.1)
rainbow (3.1.1)
regexp_parser (2.11.3)
rubocop (1.82.0)
rubocop-ast (1.48.0)
rubocop-packaging (0.6.0)
rubocop-performance (1.26.1)
rubocop-rails (2.34.2)
rubocop-rails-omakase (1.1.0)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
tzinfo (2.0.6)
unicode-display_width (3.2.0)
unicode-emoji (4.2.0)
uri (1.1.1)

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

ensure_installed([cell])

# Mirror CI's per-job env: pin to the committed lock (BUNDLE_FROZEN), skip the
# rubocop group, and pass the matrix axes + rubyopt the Gemfile/specs read.
# Mirror CI's per-job env: pin to the committed lock (BUNDLE_FROZEN) and pass
# the matrix axes + rubyopt the Gemfile/specs read.
env = cell_env(cell).merge(
"BUNDLE_FROZEN" => "true",
"BUNDLE_WITHOUT" => "rubocop"
"BUNDLE_FROZEN" => "true"
)
env["RUBYOPT"] = cell.rubyopt if cell.rubyopt
env["JRUBY_OPTS"] = "--debug" if cell.ruby.include?("jruby") # for more accurate coverage, as in CI
Expand Down
1 change: 0 additions & 1 deletion sentry-delayed_job/.rubocop.yml

This file was deleted.

49 changes: 1 addition & 48 deletions sentry-delayed_job/gemfiles/ruby-2.7.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading