[BE] Fix rule not found error message (#101745)

Prevent error message from becoming of single column of characters

Thanks @clee200 for explaining how it worked before

<!--
copilot:poem
-->
### <samp>🤖 Generated by Copilot at fef1e25</samp>

> _`reject_reason` fixed_
> _Syntax error caused trouble_
> _Autumn of bugs ends_

Pull Request resolved: https://github.com/pytorch/pytorch/pull/101745
Approved by: https://github.com/kit1980, https://github.com/osalpekar
This commit is contained in:
Nikita Shulga
2023-05-17 23:57:36 +00:00
committed by PyTorch MergeBot
parent 66e398951a
commit 124d812f38

View File

@ -1262,9 +1262,9 @@ def find_matching_merge_rule(
reject_reason_score = num_matching_files
reject_reason = "\n".join(
(
f"Not all files match rule `{rule_name}`."
f"{num_matching_files} files matched, but there are still non-matching files:"
f"{','.join(non_matching_files[:5])}{', ...' if len(non_matching_files) > 5 else ''}"
f"Not all files match rule `{rule_name}`.",
f"{num_matching_files} files matched, but there are still non-matching files:",
f"{','.join(non_matching_files[:5])}{', ...' if len(non_matching_files) > 5 else ''}",
)
)
continue