@@ -64,10 +64,10 @@ def self.expected_contents_lines
6464 # 1) It allows the CODEOWNERS file to be used as a cache for validations
6565 # 2) It allows users to specifically see what their team will not be notified about.
6666 entry = if ignored_teams . include? ( code_team . name )
67- "# /#{ path } #{ team_mapping } "
68- else
69- "/#{ path } #{ team_mapping } "
70- end
67+ "# /#{ path } #{ team_mapping } "
68+ else
69+ "/#{ path } #{ team_mapping } "
70+ end
7171 ownership_entries << entry
7272 end
7373
@@ -99,7 +99,7 @@ def self.expected_contents_lines
9999 *header . split ( "\n " ) ,
100100 '' , # For line between header and codeowners_file_lines
101101 *codeowners_file_lines ,
102- '' # For end-of-file newline
102+ '' , # For end-of-file newline
103103 ]
104104 end
105105
@@ -156,7 +156,7 @@ def self.to_glob_cache
156156 # The codeowners file stores paths relative to the root of directory
157157 # Since a `/` means root of the file system from the perspective of ruby,
158158 # we remove that beginning slash so we can correctly glob the files out.
159- normalized_line = line . gsub ( /^# / , '' ) . gsub ( %r{^/} , ' ')
159+ normalized_line = line . delete_prefix ( '# ' ) . delete_prefix ( '/ ')
160160 split_line = normalized_line . split
161161 # Most lines will be in the format: /path/to/file my-github-team
162162 # This will skip over lines that are not of the correct form
0 commit comments