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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
ci:
uses: LegionIO/.github/.github/workflows/ci.yml@main

lint:
uses: LegionIO/.github/.github/workflows/lint-patterns.yml@main
excluded-files:
uses: LegionIO/.github/.github/workflows/excluded-files.yml@main

security:
uses: LegionIO/.github/.github/workflows/security-scan.yml@main
Expand All @@ -27,8 +27,8 @@ jobs:
uses: LegionIO/.github/.github/workflows/stale.yml@main

release:
needs: [ci, lint]
needs: [ci, excluded-files]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: LegionIO/.github/.github/workflows/release.yml@main
secrets:
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
52 changes: 2 additions & 50 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,2 @@
AllCops:
TargetRubyVersion: 3.4
NewCops: enable
SuggestExtensions: false

Layout/LineLength:
Max: 160

Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: space

Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table

Metrics/MethodLength:
Max: 50

Metrics/ClassLength:
Max: 1500

Metrics/ModuleLength:
Max: 1500

Metrics/BlockLength:
Max: 40
Exclude:
- 'spec/**/*'

Metrics/AbcSize:
Max: 60

Metrics/CyclomaticComplexity:
Max: 15

Metrics/PerceivedComplexity:
Max: 17

Style/Documentation:
Enabled: false

Style/SymbolArray:
Enabled: true

Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always

Naming/FileName:
Enabled: false
inherit_gem:
rubocop-legion: config/lex.yml
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.3.5] - 2026-03-30

### Changed
- update to rubocop-legion 0.1.7, resolve all offenses

## [Unreleased]

### Added
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ group :test do
gem 'rspec'
gem 'rspec_junit_formatter'
gem 'rubocop'
gem 'rubocop-legion', '~> 0.1', require: false
gem 'simplecov'
end
2 changes: 1 addition & 1 deletion lib/legion/extensions/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module Legion
module Extensions
module Node
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core, false
end
end
end
2 changes: 1 addition & 1 deletion lib/legion/extensions/node/actors/beat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Legion
module Extensions
module Node
module Actor
class Beat < Legion::Extensions::Actors::Every
class Beat < Legion::Extensions::Actors::Every # rubocop:disable Legion/Extension/EveryActorRequiresTime
def runner_function
'beat'
end
Expand Down
12 changes: 4 additions & 8 deletions lib/legion/extensions/node/helpers/rabbitmq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def cluster_health(settings: nil)
shovel_links: fetch_shovel_links(http, settings)
}
rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, SocketError, Net::OpenTimeout, Net::ReadTimeout => e
log_warn("RabbitMQ management API unreachable: #{e.message}")
log.warn("RabbitMQ management API unreachable: #{e.message}")
{ node_count: unreachable, quorum_leaders: unreachable, shovel_links: unreachable }
end

Expand Down Expand Up @@ -66,7 +66,7 @@ def fetch_shovel_links(http, settings)
(running == total ? 'ok' : 'warn')
end
{ status: status, total: total, running: running }
rescue StandardError
rescue StandardError => _e
{ status: 'ok', total: 0, running: 0 }
end

Expand All @@ -89,7 +89,7 @@ def api_get(http, path, settings)
return nil unless response.code.start_with?('2')

::JSON.parse(response.body)
rescue StandardError
rescue StandardError => _e
nil
end

Expand All @@ -115,11 +115,7 @@ def unreachable
end

def log_warn(msg)
if defined?(Legion::Logging)
Legion::Logging.warn { msg }
elsif defined?(Legion::Transport) && Legion::Transport.respond_to?(:logger)
Legion::Transport.logger.warn(msg)
end
log.warn(msg)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/legion/extensions/node/transport/messages/beat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def rss_mb
else
File.read("/proc/#{::Process.pid}/statm").split[1].to_i * (4096.0 / 1_048_576)
end
rescue StandardError
rescue StandardError => _e
0.0
end

Expand All @@ -89,7 +89,7 @@ def collect_worker_ids
return [] unless defined?(Legion::DigitalWorker)

Legion::DigitalWorker.active_local_ids
rescue StandardError
rescue StandardError => _e
[]
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/legion/extensions/node/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Legion
module Extensions
module Node
VERSION = '0.3.4'
VERSION = '0.3.5'
end
end
end
Loading