Skip to content

Commit 49dac9b

Browse files
authored
Fix order in which "owner in .codeowner" shows up in CODEOWNERS file (#15)
1 parent 6c515b8 commit 49dac9b

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "codeowners"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55

66
[profile.release]

src/ownership.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ impl Ownership {
7070
vec![
7171
Box::new(TeamFileMapper::build(self.project.clone())),
7272
Box::new(TeamGlobMapper::build(self.project.clone())),
73-
Box::new(DirectoryMapper::build(self.project.clone())),
7473
Box::new(RubyPackageMapper::build(self.project.clone())),
7574
Box::new(JavascriptPackageMapper::build(self.project.clone())),
7675
Box::new(TeamYmlMapper::build(self.project.clone())),
7776
Box::new(TeamGemMapper::build(self.project.clone())),
77+
Box::new(DirectoryMapper::build(self.project.clone())),
7878
]
7979
}
8080
}

src/ownership/tests.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ fn test_annotations_at_the_top_of_file() {
126126
"",
127127
"# Team-specific owned globs",
128128
"",
129-
"# Owner in .codeowner",
130-
"",
131129
"# Owner metadata key in package.yml",
132130
"",
133131
"# Owner metadata key in package.json",
@@ -137,6 +135,8 @@ fn test_annotations_at_the_top_of_file() {
137135
"",
138136
"# Team owned gems",
139137
"",
138+
"# Owner in .codeowner",
139+
"",
140140
])
141141
.join("\n")
142142
)
@@ -154,8 +154,6 @@ fn test_team_specific_owned_globs() {
154154
"# Team-specific owned globs",
155155
"/packs/payroll/** @Payroll-Eng",
156156
"",
157-
"# Owner in .codeowner",
158-
"",
159157
"# Owner metadata key in package.yml",
160158
"",
161159
"# Owner metadata key in package.json",
@@ -165,6 +163,8 @@ fn test_team_specific_owned_globs() {
165163
"",
166164
"# Team owned gems",
167165
"",
166+
"# Owner in .codeowner",
167+
"",
168168
])
169169
.join("\n")
170170
)
@@ -181,8 +181,6 @@ fn test_owner_metadata_in_package() {
181181
"",
182182
"# Team-specific owned globs",
183183
"",
184-
"# Owner in .codeowner",
185-
"",
186184
"# Owner metadata key in package.yml",
187185
"/packs/payroll_package/**/** @Payroll-Eng",
188186
"",
@@ -194,6 +192,8 @@ fn test_owner_metadata_in_package() {
194192
"",
195193
"# Team owned gems",
196194
"",
195+
"# Owner in .codeowner",
196+
"",
197197
])
198198
.join("\n")
199199
)
@@ -210,8 +210,6 @@ fn test_team_owned_gems() {
210210
"",
211211
"# Team-specific owned globs",
212212
"",
213-
"# Owner in .codeowner",
214-
"",
215213
"# Owner metadata key in package.yml",
216214
"",
217215
"# Owner metadata key in package.json",
@@ -222,6 +220,8 @@ fn test_team_owned_gems() {
222220
"# Team owned gems",
223221
"/components/payroll_calculator/**/** @Payroll-Eng",
224222
"",
223+
"# Owner in .codeowner",
224+
"",
225225
])
226226
.join("\n")
227227
)

tests/fixtures/valid_project/.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
# Team-specific owned globs
1616
/ruby/app/payments/**/* @PaymentsTeam
1717

18-
# Owner in .codeowner
19-
/ruby/app/payroll/**/** @PayrollTeam
20-
2118
# Owner metadata key in package.yml
2219
/ruby/packages/payroll_flow/**/** @PayrollTeam
2320

@@ -30,3 +27,6 @@
3027

3128
# Team owned gems
3229
/gems/payroll_calculator/**/** @PayrollTeam
30+
31+
# Owner in .codeowner
32+
/ruby/app/payroll/**/** @PayrollTeam

0 commit comments

Comments
 (0)