Skip to content

Commit

Permalink
move Naming/ClassAndModuleCamelCase exclusion
Browse files Browse the repository at this point in the history
Declare this once in the Rubocop config instead of including it each generated class by way of the template.
  • Loading branch information
robbkidd committed Mar 19, 2024
1 parent 83d9ae9 commit 44bd254
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions semantic_conventions/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Enabled: false

Naming/ClassAndModuleCamelCase:
Exclude:
- lib/opentelemetry/semantic_conventions/**/*.rb
Naming/FileName:
Exclude:
- lib/opentelemetry-semantic_conventions.rb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
module SemanticConventions_1_10_0 # rubocop:disable Naming/ClassAndModuleCamelCase
module SemanticConventions_1_10_0
# https://github.com/open-telemetry/opentelemetry-specification/tree/v1.10.0/specification
module Resource
# Name of the cloud provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
module SemanticConventions_1_10_0 # rubocop:disable Naming/ClassAndModuleCamelCase
module SemanticConventions_1_10_0
# https://github.com/open-telemetry/opentelemetry-specification/tree/v1.10.0/specification
module Trace
# The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
require_relative '../1.10.0/resource'

module OpenTelemetry
module SemanticConventions_1_20_0 # rubocop:disable Naming/ClassAndModuleCamelCase
module SemanticConventions_1_20_0
# https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/
module Resource
def self.const_missing(const_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
require_relative '../1.10.0/trace'

module OpenTelemetry
module SemanticConventions_1_20_0 # rubocop:disable Naming/ClassAndModuleCamelCase
module SemanticConventions_1_20_0
# https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/
module Trace
def self.const_missing(const_name)
Expand Down
2 changes: 1 addition & 1 deletion semantic_conventions/templates/semantic_conventions.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
require_relative '../{{prev_spec_version}}/{{kind}}'

module OpenTelemetry
module SemanticConventions_{{spec_version | replace(".", "_")}} # rubocop:disable Naming/ClassAndModuleCamelCase
module SemanticConventions_{{spec_version | replace(".", "_")}}
# https://github.com/open-telemetry/opentelemetry-specification/blob/v{{spec_version}}/specification/
module {{module}}
{%- if (prev_spec_version | string()) != "" %}
Expand Down

0 comments on commit 44bd254

Please sign in to comment.