You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: show CODEOWNERS diff when validate detects a stale file (#107)
`validate` previously reported only "CODEOWNERS out of date" with no
indication of what differed, forcing developers to re-run the tool
locally to discover the delta.
The stale-file error now includes a line-oriented diff between the
on-disk CODEOWNERS file and the freshly generated one (git-style
`-`/`+` prefixes, changed lines only), so CI output explains what is
out of date.
let diff = TextDiff::from_lines(current, generated);
169
+
170
+
diff.iter_all_changes()
171
+
.filter_map(|change| {
172
+
let line = change.value().trim_end_matches('\n');
173
+
match change.tag(){
174
+
ChangeTag::Delete => Some(format!("-{line}")),
175
+
ChangeTag::Insert => Some(format!("+{line}")),
176
+
ChangeTag::Equal => None,
177
+
}
178
+
})
179
+
.join("\n")
180
+
}
181
+
166
182
implError{
167
183
pubfncategory(&self) -> String{
168
184
matchself{
169
185
Error::FileWithoutOwner{path: _ } => "Some files are missing ownership".to_owned(),
170
186
Error::FileWithMultipleOwners{path: _,owners: _ } => "Code ownership should only be defined for each file in one way. The following files have declared ownership in multiple ways".to_owned(),
0 commit comments