Skip to content

Commit 54bcc8e

Browse files
committed
Configure Ruby warnings in CI
1 parent f4c202b commit 54bcc8e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ gem 'rails', '>= 6.0'
99
gem 'rake'
1010
gem 'rspec'
1111
gem 'simplecov'
12+
gem 'warning'
1213

1314
# Dev tools / linter
1415
gem 'guard-rspec', require: false

spec/spec_helper.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# frozen_string_literal: true
22

3+
# Load ruby-warning gem
4+
require 'warning'
5+
6+
Warning[:deprecated] = true
7+
Warning[:experimental] = true
8+
Warning[:performance] = true if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0')
9+
10+
# Ignore all warnings in Gem dependencies
11+
Gem.path.each do |path|
12+
Warning.ignore(//, path)
13+
end
14+
15+
# Ignore OpenStruct warning (only used in tests)
16+
Warning.ignore(/OpenStruct use is discouraged for performance reasons/)
17+
318
require 'simplecov'
419
require 'simplecov_json_formatter'
520

0 commit comments

Comments
 (0)