diff --git a/lib/datadog/ci/codeowners/matcher.rb b/lib/datadog/ci/codeowners/matcher.rb index e515a365..02f0f1ce 100644 --- a/lib/datadog/ci/codeowners/matcher.rb +++ b/lib/datadog/ci/codeowners/matcher.rb @@ -42,7 +42,7 @@ def parse(codeowners_file_path) File.open(codeowners_file_path, "r") do |f| f.each_line do |line| - line.strip! + line.strip!&.sub!(/#.*$/, "") next if line.empty? next if comment?(line) diff --git a/spec/datadog/ci/codeowners/matcher_spec.rb b/spec/datadog/ci/codeowners/matcher_spec.rb index 1687ad56..5dc42342 100644 --- a/spec/datadog/ci/codeowners/matcher_spec.rb +++ b/spec/datadog/ci/codeowners/matcher_spec.rb @@ -41,7 +41,7 @@ <<-CODEOWNERS # Comment line /path/to/*.rb @owner3 - /path/to/file.rb @owner1 @owner2 + /path/to/file.rb @owner1 @owner2 #This is an inline comment. CODEOWNERS end