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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd34b2ff9474b859c0cfe8209a5b5d872db2f16a5e47151f660e0f29204a9c94
4
- data.tar.gz: 722d0abf4840e185c0fae586c0ab6ae9efc1d1d03bd4d0466c758d43a61563dd
3
+ metadata.gz: d78546e0c0644c62cc7d4601b79402c2ce6d3efeac313b42f81fe4c7ec73b819
4
+ data.tar.gz: c89dc3efd294e5b21f686aebe6dbeec67fb0efa5fe14a857d8be644c14fdec82
5
5
  SHA512:
6
- metadata.gz: ee6647f955164e0840749bf48f1c5a634520518a3047cda78f0f3f1403268ca9460ecf7d7c2fc5e1cb44d463131fa5dd9b0289f9d9fb919f36861a29ae07ba40
7
- data.tar.gz: 9e18b9374538deb1ab56d3e2f65f4b8050263a1dcb1ae34d81144d3627f472dc3962af36a18e643e0221f4c090a8cdbfa50d731969ad814665c45e90fa5cff17
6
+ metadata.gz: 5ba5b3d713f3b862983997fd05b005c34c815d06616252ecd9db93d303ab108c1694ff304ad64920be505661e8560781009f98aabf920bb7263143144aa18957
7
+ data.tar.gz: e48973d36a3f0c31c21e9a4b6a1e3d5f7a81a1a274e87911b98df55e5d9ba107b5e0e6646950df8392b5d8f8420df89abb6b23f34ce634441ed7b133dbbf1401
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## 0.2.3 - 2025-07-22
4
+
5
+ * `Lint/FluentdPluginLogScope`: Delay string evaluation if assumed log level is lower than info.
6
+
3
7
  ## 0.2.2 - 2025-07-18
4
8
 
5
9
  * `Lint/FluentdPluginLogScope`: Add `AssumeConfigLogLevel` property (`info` by default)
@@ -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
- source_code = "log.#{method} { #{literal.source} }"
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Fluentd
5
- VERSION = "0.2.2"
5
+ VERSION = "0.2.3"
6
6
  end
7
7
  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.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.7
101
+ rubygems_version: 3.6.9
102
102
  specification_version: 4
103
103
  summary: RuboCop rules for Fluentd plugin
104
104
  test_files: []