Skip to content

Commit d3b910e

Browse files
committed
appease Rubocop
* Layout/HeredocIndentation: Use 2 spaces for indentation in a heredoc. * Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. * Style/StringConcatenation: Prefer string interpolation to string concatenation. - ... except we don't want *interpolation*; we want to join pathname components with the correct separator for the operating system. So we'll use Pathname.join explicitly instead of Pathname's :+ operator so Rubocop doesn't think we're concatonating strings.
1 parent 5d904e9 commit d3b910e

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

semantic_conventions/Rakefile

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# frozen_string_literal: true
22

33
COPYRIGHT_NOTICE = <<~COPYRIGHT_NOTICE
4-
# Copyright The OpenTelemetry Authors
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
17-
#
18-
# SPDX-License-Identifier: Apache-2.0
4+
# Copyright The OpenTelemetry Authors
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# SPDX-License-Identifier: Apache-2.0
1919
COPYRIGHT_NOTICE
2020

2121
require 'bundler/gem_tasks'
@@ -91,24 +91,24 @@ task generate_require_rollups: %i[generate_semconv] do
9191
puts "\n+++ Generating rollup/barrel files for semconv namespaces.\n"
9292

9393
Rake::FileList[ # find all the generated semconv files
94-
semconv_output_dir + "**" + "attributes.rb",
95-
semconv_output_dir + "**" + "metrics.rb",
94+
semconv_output_dir.join('**', 'attributes.rb'),
95+
semconv_output_dir.join('**', 'metrics.rb'),
9696
]
97-
.pathmap("%d") # turn the list into the parent directories (root_namespaces)
97+
.pathmap('%d') # turn the list into the parent directories (root_namespaces)
9898
.uniq # remove duplicates
9999
.each do |namespace_dir| # in each directory, write out a file to require the generated signal names
100100
directory = Pathname.new(namespace_dir)
101101
rollup_filename = directory.dirname + "#{directory.basename}.rb"
102-
File.open(rollup_filename, "w") do |rollup|
102+
File.open(rollup_filename, 'w') do |rollup|
103103
rollup << <<~FILE_HEADER
104104
# frozen_string_literal: true
105105
106106
#{COPYRIGHT_NOTICE}
107107
# This file was autogenerated. Do not edit it by hand.
108108
109109
FILE_HEADER
110-
rollup << "require_relative './#{directory.basename}/attributes.rb'\n" if File.exist?(directory + "attributes.rb")
111-
rollup << "require_relative './#{directory.basename}/metrics.rb'\n" if File.exist?(directory + "metrics.rb")
110+
rollup << "require_relative './#{directory.basename}/attributes.rb'\n" if File.exist?(directory.join('attributes.rb'))
111+
rollup << "require_relative './#{directory.basename}/metrics.rb'\n" if File.exist?(directory.join('metrics.rb'))
112112
end
113113
puts "✅ Generated file \"#{rollup_filename}\""
114114
end

0 commit comments

Comments
 (0)