diff --git a/lib/datadog/ci/codeowners/matcher.rb b/lib/datadog/ci/codeowners/matcher.rb index 5b77b7bf..e515a365 100644 --- a/lib/datadog/ci/codeowners/matcher.rb +++ b/lib/datadog/ci/codeowners/matcher.rb @@ -87,7 +87,7 @@ def expand_pattern(pattern) return pattern if pattern == "*" # if pattern ends with a slash then it matches everything deeply nested in this directory - pattern += "**" if pattern.end_with?(::File::SEPARATOR) + pattern << "**" if pattern.end_with?(::File::SEPARATOR) # if pattern doesn't start with a slash then it matches anywhere in the repository if !pattern.start_with?(::File::SEPARATOR, "**#{::File::SEPARATOR}", "*#{::File::SEPARATOR}") diff --git a/lib/datadog/ci/codeowners/parser.rb b/lib/datadog/ci/codeowners/parser.rb index 60be8786..8a711fac 100644 --- a/lib/datadog/ci/codeowners/parser.rb +++ b/lib/datadog/ci/codeowners/parser.rb @@ -8,11 +8,11 @@ module Codeowners # Responsible for parsing a CODEOWNERS file class Parser DEFAULT_LOCATION = "CODEOWNERS" - POSSIBLE_CODEOWNERS_LOCATIONS = [ - "CODEOWNERS", - ".github/CODEOWNERS", - ".gitlab/CODEOWNERS", - "docs/CODEOWNERS" + POSSIBLE_CODEOWNERS_LOCATIONS = %w[ + CODEOWNERS + .github/CODEOWNERS + .gitlab/CODEOWNERS + docs/CODEOWNERS ].freeze def initialize(root_file_path) diff --git a/lib/datadog/ci/ext/environment.rb b/lib/datadog/ci/ext/environment.rb index e2fa1b8e..d301cf92 100644 --- a/lib/datadog/ci/ext/environment.rb +++ b/lib/datadog/ci/ext/environment.rb @@ -23,10 +23,7 @@ module Environment TAG_NODE_NAME = "ci.node.name" TAG_CI_ENV_VARS = "_dd.ci.env_vars" - POSSIBLE_BUNDLE_LOCATIONS = [ - "vendor/bundle", - ".bundle" - ].freeze + POSSIBLE_BUNDLE_LOCATIONS = %w[vendor/bundle .bundle].freeze module_function diff --git a/lib/datadog/ci/ext/environment/providers/gitlab.rb b/lib/datadog/ci/ext/environment/providers/gitlab.rb index 6668ee69..e0581083 100644 --- a/lib/datadog/ci/ext/environment/providers/gitlab.rb +++ b/lib/datadog/ci/ext/environment/providers/gitlab.rb @@ -75,12 +75,12 @@ def git_tag end def git_commit_author_name - name, _ = extract_name_email + name, _email = extract_name_email name end def git_commit_author_email - _, email = extract_name_email + _name, email = extract_name_email email end diff --git a/lib/datadog/ci/ext/settings.rb b/lib/datadog/ci/ext/settings.rb index a1921f6e..917fdb33 100644 --- a/lib/datadog/ci/ext/settings.rb +++ b/lib/datadog/ci/ext/settings.rb @@ -15,13 +15,13 @@ module Settings ENV_ITR_CODE_COVERAGE_EXCLUDED_BUNDLE_PATH = "DD_CIVISIBILITY_ITR_CODE_COVERAGE_EXCLUDED_BUNDLE_PATH" # Source: https://docs.datadoghq.com/getting_started/site/ - DD_SITE_ALLOWLIST = [ - "datadoghq.com", - "us3.datadoghq.com", - "us5.datadoghq.com", - "datadoghq.eu", - "ddog-gov.com", - "ap1.datadoghq.com" + DD_SITE_ALLOWLIST = %w[ + datadoghq.com + us3.datadoghq.com + us5.datadoghq.com + datadoghq.eu + ddog-gov.com + ap1.datadoghq.com ].freeze end end diff --git a/lib/datadog/ci/itr/coverage/event.rb b/lib/datadog/ci/itr/coverage/event.rb index 6e3d2a95..1e4815ea 100644 --- a/lib/datadog/ci/itr/coverage/event.rb +++ b/lib/datadog/ci/itr/coverage/event.rb @@ -21,7 +21,7 @@ def initialize(test_id:, test_suite_id:, test_session_id:, coverage:) def valid? valid = true - [:test_id, :test_suite_id, :test_session_id, :coverage].each do |key| + %i[test_id test_suite_id test_session_id coverage].each do |key| next unless send(key).nil? Datadog.logger.warn("citestcov event is invalid: [#{key}] is nil. Event: #{self}") diff --git a/lib/datadog/ci/transport/http.rb b/lib/datadog/ci/transport/http.rb index 2a1e6f43..6069c9d4 100644 --- a/lib/datadog/ci/transport/http.rb +++ b/lib/datadog/ci/transport/http.rb @@ -124,6 +124,7 @@ def trace_count def gzipped?(payload) return false if payload.nil? || payload.empty? + # no-dd-sa first_bytes = payload[0, 2] return false if first_bytes.nil? || first_bytes.empty? diff --git a/sig/datadog/ci/codeowners/parser.rbs b/sig/datadog/ci/codeowners/parser.rbs index 15f064eb..7a80bc19 100644 --- a/sig/datadog/ci/codeowners/parser.rbs +++ b/sig/datadog/ci/codeowners/parser.rbs @@ -6,7 +6,7 @@ module Datadog DEFAULT_LOCATION: "CODEOWNERS" - POSSIBLE_CODEOWNERS_LOCATIONS: ::Array["CODEOWNERS" | ".github/CODEOWNERS" | ".gitlab/CODEOWNERS" | "docs/CODEOWNERS"] + POSSIBLE_CODEOWNERS_LOCATIONS: Array[String] def initialize: (String? root_file_path) -> void diff --git a/yard/extensions.rb b/yard/extensions.rb index 69e4ac75..e3232bb8 100644 --- a/yard/extensions.rb +++ b/yard/extensions.rb @@ -131,6 +131,7 @@ class DatadogConfigurationOptionHandler < YARD::Handlers::Ruby::Base end end +# no-dd-sa def camelize(str) str.split("_").collect(&:capitalize).join end diff --git a/yard/templates/default/docstring/setup.rb b/yard/templates/default/docstring/setup.rb index 4e0b22ff..612564aa 100644 --- a/yard/templates/default/docstring/setup.rb +++ b/yard/templates/default/docstring/setup.rb @@ -5,6 +5,7 @@ # sections :index, [:private, :deprecated, :abstract, :todo, :note, :returns_void, :text], T('tags') # end +# no-dd-sa def deprecated return unless object.has_tag?(:deprecated)