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
9 changes: 6 additions & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ jobs:
ruby_version: ${{ steps.ruby_version.outputs.versions }}
steps:
- uses: actions/checkout@v5
- id: ruby_version
uses: voxpupuli/ruby-version@v1
- id: min_ruby
run: echo "version=$(echo '${{ steps.ruby_version.outputs.versions }}' | jq -r '.[-1]')" >> $GITHUB_OUTPUT
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
# Use the minimum supported Ruby version for rubocop (last in descending list)
ruby-version: ${{ steps.min_ruby.outputs.version }}
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop
- id: ruby_version
uses: voxpupuli/ruby-version@v1

test:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ Metrics/ModuleLength:

Style/LambdaCall:
Enabled: false

Gemspec/RequiredRubyVersion:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it make more sense to update TargetRubyVersion: 2.7 to TargetRubyVersion: 3.0? Or do you have to keep linting for 2.7?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that at some point[1], but I was running into this:

> Run bundle exec rubocop
Error: RuboCop found unknown Ruby version 3.0 in `TargetRubyVersion` parameter (in .rubocop.yml).
Supported versions: 2.4, 2.5, 2.6, 2.7, 2.8
Error: Process completed with exit code 2.

Guess that could be resolved by bumping rubocop (or theforeman-rubocop), but when I did that, the newer rubocop wanted to reformat every single file we have and I'd like to avoid that (or just adding all the new stuff to rubocop_todo)

[1] - https://github.com/Dynflow/dynflow/actions/runs/19291816955/job/55164106398

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right, rubocop is also too ancient :( I guess the workaround is fine now now.

Copy link
Contributor Author

@adamruzicka adamruzicka Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record

$ bundle exec rubocop --regenerate-todo
-----B<-----SNIP----B<-----
237 files inspected, 1788 offenses detected, 1070 offenses auto-correctable
Created .rubocop_todo.yml.

So ideally, yes, but I don't want to do that here.

Edit: Tracked under #459

Enabled: false
2 changes: 1 addition & 1 deletion dynflow.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]

s.required_ruby_version = '>= 2.7.0'
s.required_ruby_version = '>= 3.0.0'

s.add_dependency "algebrick", '~> 0.7.0'
s.add_dependency "concurrent-ruby", '~> 1.1.3'
Expand Down