Commit dbc1d2e4 authored by nmilojevic1's avatar nmilojevic1

Fix rubocop offences

parent 5df7dd78
...@@ -44,7 +44,6 @@ module Gitlab ...@@ -44,7 +44,6 @@ module Gitlab
) )
end end
class << self class << self
def find(repository, sha, path, limit: MAX_DATA_DISPLAY_SIZE) def find(repository, sha, path, limit: MAX_DATA_DISPLAY_SIZE)
tree_entry(repository, sha, path, limit) tree_entry(repository, sha, path, limit)
......
...@@ -61,7 +61,7 @@ module Gitlab ...@@ -61,7 +61,7 @@ module Gitlab
end end
def evaluate(&block) def evaluate(&block)
instance_eval(&block) if block_given? instance_eval(&block) if block_given?
self self
end end
......
...@@ -137,14 +137,14 @@ RSpec.describe Gitlab::Metrics::Transaction do ...@@ -137,14 +137,14 @@ RSpec.describe Gitlab::Metrics::Transaction do
it 'adds a metric' do it 'adds a metric' do
expect(prometheus_metric).to receive(:set) expect(prometheus_metric).to receive(:set)
expect(::Gitlab::Metrics).to receive(:gauge).with(:meow_set, 'Meow set gauge', hash_including(:controller, :action), :livesum).and_return(prometheus_metric) expect(::Gitlab::Metrics).to receive(:gauge).with(:meow_set, 'Meow set gauge', hash_including(:controller, :action), :all).and_return(prometheus_metric)
transaction.set(:meow_set, 1) transaction.set(:meow_set, 1)
end end
context 'with block' do context 'with block' do
it 'overrides docstring' do it 'overrides docstring' do
expect(::Gitlab::Metrics).to receive(:gauge).with(:block_docstring_set, 'test', hash_including(:controller, :action), :livesum).and_return(prometheus_metric) expect(::Gitlab::Metrics).to receive(:gauge).with(:block_docstring_set, 'test', hash_including(:controller, :action), :all).and_return(prometheus_metric)
transaction.set(:block_docstring_set, 1) do transaction.set(:block_docstring_set, 1) do
docstring 'test' docstring 'test'
...@@ -152,7 +152,7 @@ RSpec.describe Gitlab::Metrics::Transaction do ...@@ -152,7 +152,7 @@ RSpec.describe Gitlab::Metrics::Transaction do
end end
it 'overrides labels' do it 'overrides labels' do
expect(::Gitlab::Metrics).to receive(:gauge).with(:block_labels_set, 'Block labels set gauge', hash_including(:controller, :action, :sane), :livesum).and_return(prometheus_metric) expect(::Gitlab::Metrics).to receive(:gauge).with(:block_labels_set, 'Block labels set gauge', hash_including(:controller, :action, :sane), :all).and_return(prometheus_metric)
labels = { sane: 'yes' } labels = { sane: 'yes' }
transaction.set(:block_labels_set, 1, labels) do transaction.set(:block_labels_set, 1, labels) do
...@@ -161,7 +161,7 @@ RSpec.describe Gitlab::Metrics::Transaction do ...@@ -161,7 +161,7 @@ RSpec.describe Gitlab::Metrics::Transaction do
end end
it 'filters sensitive tags' do it 'filters sensitive tags' do
expect(::Gitlab::Metrics).to receive(:gauge).with(:metric_set_with_sensitive_block, 'Metric set with sensitive block gauge', hash_excluding(sensitive_tags), :livesum).and_return(prometheus_metric) expect(::Gitlab::Metrics).to receive(:gauge).with(:metric_set_with_sensitive_block, 'Metric set with sensitive block gauge', hash_excluding(sensitive_tags), :all).and_return(prometheus_metric)
label_keys = sensitive_tags.keys label_keys = sensitive_tags.keys
transaction.set(:metric_set_with_sensitive_block, 1, sensitive_tags) do transaction.set(:metric_set_with_sensitive_block, 1, sensitive_tags) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment