warning 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +12 -0
- data/README.rdoc +2 -0
- data/lib/warning.rb +9 -5
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6054dca1a00f1d10743d33a9763485b627d28308c6f3ea759c13dc3d1dc93ee9
|
4
|
+
data.tar.gz: b6a1dbed6106cf3fda161ea834b198bce4576e140891043437fb1e857a2117a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23f51a39800e815957754d82f090e4372e1709176eedc4e905151d81848ebdc1173049f570d74d65be3a360358d6a2786191e58ba3edfcb5f88edb27296325c5
|
7
|
+
data.tar.gz: 4212dde6557469b9b9e1ab37200a4d27e84f629b803a533fc9fd52645efb9ed2b8382dde7e115b80d54fef187819c9c169cc09c90f71be8136540e6a41ef0659
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
=== 1.5.0 (2024-12-18)
|
2
|
+
|
3
|
+
* Handle warning formats produced by prism compiler (jeremyevans)
|
4
|
+
|
5
|
+
* Add support for :default_gem_removal as regexp argument to Warning.ignore (jamiemccarthy, jeremyevans) (#24)
|
6
|
+
|
7
|
+
=== 1.4.0 (2024-05-24)
|
8
|
+
|
9
|
+
* Add support for :ignored_block as regexp argument to Warning.ignore (jeremyevans)
|
10
|
+
|
11
|
+
* Support new warning format in Ruby 3.4 (jeremyevans)
|
12
|
+
|
1
13
|
=== 1.3.0 (2022-07-14)
|
2
14
|
|
3
15
|
* Allow Warning.clear to take a block, and restore current state after block (splattael) (#18, #20)
|
data/README.rdoc
CHANGED
data/lib/warning.rb
CHANGED
@@ -4,18 +4,20 @@ module Warning
|
|
4
4
|
module Processor
|
5
5
|
# Map of symbols to regexps for warning messages to ignore.
|
6
6
|
IGNORE_MAP = {
|
7
|
-
ambiguous_slash: /: warning: ambiguous first argument; put parentheses or a space even after
|
8
|
-
arg_prefix: /: warning: `[&\*]' interpreted as argument prefix\n\z/,
|
7
|
+
ambiguous_slash: /: warning: ambiguous first argument; put parentheses or a space even after [`']\/' operator\n\z|: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after [`']\/' operator\n\z|ambiguous `\/`; wrap regexp in parentheses or add a space after `\/` operator\n\z/,
|
8
|
+
arg_prefix: /: warning: ([`'][&\*]'||ambiguous `[\*&]` has been) interpreted as( an)? argument prefix\n\z/,
|
9
9
|
bignum: /: warning: constant ::Bignum is deprecated\n\z/,
|
10
|
+
default_gem_removal: /: warning: .+? was loaded from the standard library, but will no longer be part of the default gems starting from Ruby [\d.]+\./,
|
10
11
|
fixnum: /: warning: constant ::Fixnum is deprecated\n\z/,
|
12
|
+
ignored_block: /: warning: the block passed to '.+' defined at .+:\d+ may be ignored\n\z/,
|
11
13
|
method_redefined: /: warning: method redefined; discarding old .+\n\z|: warning: previous definition of .+ was here\n\z/,
|
12
|
-
missing_gvar: /: warning: global variable
|
14
|
+
missing_gvar: /: warning: global variable [`']\$.+' not initialized\n\z/,
|
13
15
|
missing_ivar: /: warning: instance variable @.+ not initialized\n\z/,
|
14
16
|
not_reached: /: warning: statement not reached\n\z/,
|
15
17
|
shadow: /: warning: shadowing outer local variable - \w+\n\z/,
|
16
18
|
unused_var: /: warning: assigned but unused variable - \w+\n\z/,
|
17
19
|
useless_operator: /: warning: possibly useless use of [><!=]+ in void context\n\z/,
|
18
|
-
keyword_separation: /: warning: (?:Using the last argument (?:for
|
20
|
+
keyword_separation: /: warning: (?:Using the last argument (?:for [`'].+' )?as keyword parameters is deprecated; maybe \*\* should be added to the call|Passing the keyword argument (?:for [`'].+' )?as the last hash parameter is deprecated|Splitting the last argument (?:for [`'].+' )?into positional and keyword parameters is deprecated|The called method (?:[`'].+' )?is defined here)\n\z/,
|
19
21
|
safe: /: warning: (?:rb_safe_level_2_warning|rb_safe_level|rb_set_safe_level_force|rb_set_safe_level|rb_secure|rb_insecure_operation|rb_check_safe_obj|\$SAFE) will (?:be removed|become a normal global variable) in Ruby 3\.0\n\z/,
|
20
22
|
taint: /: warning: (?:rb_error_untrusted|rb_check_trusted|Pathname#taint|Pathname#untaint|rb_env_path_tainted|Object#tainted\?|Object#taint|Object#untaint|Object#untrusted\?|Object#untrust|Object#trust|rb_obj_infect|rb_tainted_str_new|rb_tainted_str_new_cstr) is deprecated and will be removed in Ruby 3\.2\.?\n\z/,
|
21
23
|
mismatched_indentations: /: warning: mismatched indentations at '.+' with '.+' at \d+\n\z/,
|
@@ -94,6 +96,8 @@ module Warning
|
|
94
96
|
# :arg_prefix :: Ignore warnings when using * or & as an argument prefix
|
95
97
|
# :ambiguous_slash :: Ignore warnings for things like <tt>method /regexp/</tt>
|
96
98
|
# :bignum :: Ignore warnings when referencing the ::Bignum constant.
|
99
|
+
# :default_gem_removal :: Ignore warnings that a gem will be removed from the default gems
|
100
|
+
# in a future Ruby version.
|
97
101
|
# :fixnum :: Ignore warnings when referencing the ::Fixnum constant.
|
98
102
|
# :keyword_separation :: Ignore warnings related to keyword argument separation.
|
99
103
|
# :method_redefined :: Ignore warnings when defining a method in a class/module where a
|
@@ -166,7 +170,7 @@ module Warning
|
|
166
170
|
# /instance variable @\w+ not initialized/ => proc do |warning|
|
167
171
|
# LOGGER.warning(warning)
|
168
172
|
# end,
|
169
|
-
# /global variable
|
173
|
+
# /global variable [`']\$\w+' not initialized/ => proc do |warning|
|
170
174
|
# LOGGER.error(warning)
|
171
175
|
# end
|
172
176
|
# )
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest-global_expectations
|
@@ -50,7 +50,7 @@ metadata:
|
|
50
50
|
changelog_uri: https://github.com/jeremyevans/ruby-warning/blob/master/CHANGELOG
|
51
51
|
documentation_uri: https://github.com/jeremyevans/ruby-warning/blob/master/README.rdoc
|
52
52
|
source_code_uri: https://github.com/jeremyevans/ruby-warning
|
53
|
-
post_install_message:
|
53
|
+
post_install_message:
|
54
54
|
rdoc_options:
|
55
55
|
- "--quiet"
|
56
56
|
- "--line-numbers"
|
@@ -72,8 +72,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
76
|
-
signing_key:
|
75
|
+
rubygems_version: 3.5.22
|
76
|
+
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: Add custom processing for warnings
|
79
79
|
test_files: []
|