File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -148,17 +148,17 @@ pub fn check(path: &Path, bad: &mut bool) {
148
148
if ext == "rs" {
149
149
lazy_static ! {
150
150
static ref ISSUE_NAME_REGEX : Regex =
151
- Regex :: new( r"^issues?[-_]?\d{3,}" ) . unwrap( ) ;
151
+ Regex :: new( r"^issues?[-_]?( \d{3,}) " ) . unwrap( ) ;
152
152
}
153
153
154
- if ISSUE_NAME_REGEX . is_match ( testname) {
154
+ if let Some ( test_name ) = ISSUE_NAME_REGEX . captures ( testname) {
155
155
// these paths are always relative to the passed `path` and always UTF8
156
156
let stripped_path = file_path. strip_prefix ( path) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
157
157
if !allowed_issue_filenames. remove ( stripped_path) {
158
158
tidy_error ! (
159
159
bad,
160
- "UI test `{ }` should use a name that describes the test and link the issue in a comment instead. " ,
161
- file_path . display ( ) ,
160
+ "file `{stripped_path }` must begin with a descriptive name, consider `{{reason}}- issue-{issue_n}.rs` " ,
161
+ issue_n = & test_name [ 1 ] ,
162
162
) ;
163
163
}
164
164
}
You can’t perform that action at this time.
0 commit comments