rubocop-fluentd 0.2.2 → 0.2.3
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.md +4 -0
- data/lib/rubocop/cop/lint/plugin_log_scope.rb +8 -1
- data/lib/rubocop/fluentd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d78546e0c0644c62cc7d4601b79402c2ce6d3efeac313b42f81fe4c7ec73b819
|
4
|
+
data.tar.gz: c89dc3efd294e5b21f686aebe6dbeec67fb0efa5fe14a857d8be644c14fdec82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ba5b3d713f3b862983997fd05b005c34c815d06616252ecd9db93d303ab108c1694ff304ad64920be505661e8560781009f98aabf920bb7263143144aa18957
|
7
|
+
data.tar.gz: e48973d36a3f0c31c21e9a4b6a1e3d5f7a81a1a274e87911b98df55e5d9ba107b5e0e6646950df8392b5d8f8420df89abb6b23f34ce634441ed7b133dbbf1401
|
data/CHANGELOG.md
CHANGED
@@ -77,7 +77,14 @@ module RuboCop
|
|
77
77
|
message = 'Use plugin scope `log` instead of global scope `$log`.'
|
78
78
|
add_offense(node, message: MSG) do |corrector|
|
79
79
|
literal = expression.last
|
80
|
-
|
80
|
+
assume_level = cop_config['AssumeConfigLogLevel'] || 'info'
|
81
|
+
threshould = LOG_LEVELS[assume_level]
|
82
|
+
if LOG_LEVELS[method.to_s] >= threshould
|
83
|
+
# no need to delay evaluation
|
84
|
+
source_code = "log.#{method} #{literal.source}"
|
85
|
+
else
|
86
|
+
source_code = "log.#{method} { #{literal.source} }"
|
87
|
+
end
|
81
88
|
# $log.xxx => log.xxx
|
82
89
|
corrector.replace(node, source_code)
|
83
90
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-fluentd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaro Hayashi
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
|
-
rubygems_version: 3.6.
|
101
|
+
rubygems_version: 3.6.9
|
102
102
|
specification_version: 4
|
103
103
|
summary: RuboCop rules for Fluentd plugin
|
104
104
|
test_files: []
|