Skip to content

Commit

Permalink
Merge pull request #267 from DataDog/anmarchenko/codeowners_parsing_bug
Browse files Browse the repository at this point in the history
[SDTEST-1304] Fix inline comments handling when parsing CODEOWNERS files
  • Loading branch information
anmarchenko authored Dec 9, 2024
2 parents 8174017 + 1bbc99d commit fc3e0d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/datadog/ci/codeowners/matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/datadog/ci/codeowners/matcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fc3e0d1

Please sign in to comment.