@@ -32,11 +32,10 @@ pub fn find_file_owners(project_root: &Path, config: &Config, file_path: &Path)
3232 if let Some ( rel_str) = relative_file_path. to_str ( ) {
3333 let is_config_owned = glob_list_matches ( rel_str, & config. owned_globs ) ;
3434 let is_config_unowned = glob_list_matches ( rel_str, & config. unowned_globs ) ;
35- if is_config_owned && !is_config_unowned {
36- if let Some ( team) = teams_by_name. get ( & team_name) {
35+ if is_config_owned && !is_config_unowned
36+ && let Some ( team) = teams_by_name. get ( & team_name) {
3737 sources_by_team. entry ( team. name . clone ( ) ) . or_default ( ) . push ( Source :: TeamFile ) ;
3838 }
39- }
4039 }
4140 }
4241
@@ -194,33 +193,29 @@ fn nearest_package_owner(
194193 if let Some ( rel_str) = parent_rel. to_str ( ) {
195194 if glob_list_matches ( rel_str, & config. ruby_package_paths ) {
196195 let pkg_yml = current. join ( "package.yml" ) ;
197- if pkg_yml. exists ( ) {
198- if let Ok ( owner) = read_ruby_package_owner ( & pkg_yml) {
199- if let Some ( team) = teams_by_name. get ( & owner) {
196+ if pkg_yml. exists ( )
197+ && let Ok ( owner) = read_ruby_package_owner ( & pkg_yml)
198+ && let Some ( team) = teams_by_name. get ( & owner) {
200199 let package_path = parent_rel. join ( "package.yml" ) ;
201200 let package_glob = format ! ( "{rel_str}/**/**" ) ;
202201 return Some ( (
203202 team. name . clone ( ) ,
204203 Source :: Package ( package_path. to_string_lossy ( ) . to_string ( ) , package_glob) ,
205204 ) ) ;
206205 }
207- }
208- }
209206 }
210207 if glob_list_matches ( rel_str, & config. javascript_package_paths ) {
211208 let pkg_json = current. join ( "package.json" ) ;
212- if pkg_json. exists ( ) {
213- if let Ok ( owner) = read_js_package_owner ( & pkg_json) {
214- if let Some ( team) = teams_by_name. get ( & owner) {
209+ if pkg_json. exists ( )
210+ && let Ok ( owner) = read_js_package_owner ( & pkg_json)
211+ && let Some ( team) = teams_by_name. get ( & owner) {
215212 let package_path = parent_rel. join ( "package.json" ) ;
216213 let package_glob = format ! ( "{rel_str}/**/**" ) ;
217214 return Some ( (
218215 team. name . clone ( ) ,
219216 Source :: Package ( package_path. to_string_lossy ( ) . to_string ( ) , package_glob) ,
220217 ) ) ;
221218 }
222- }
223- }
224219 }
225220 }
226221 if current == project_root {
0 commit comments