3
3
//! - there are no stray `.stderr` files
4
4
5
5
use ignore:: Walk ;
6
- use lazy_static:: lazy_static;
7
- use regex:: Regex ;
8
- use std:: collections:: { HashMap , HashSet } ;
6
+ use std:: collections:: HashMap ;
9
7
use std:: ffi:: OsStr ;
10
8
use std:: fs;
11
9
use std:: path:: { Path , PathBuf } ;
@@ -90,12 +88,6 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
90
88
91
89
pub fn check ( path : & Path , bad : & mut bool ) {
92
90
check_entries ( & path, bad) ;
93
-
94
- // the list of files in ui tests that are allowed to start with `issue-XXXX`
95
- let mut allowed_issue_filenames: HashSet < String > = HashSet :: from (
96
- include ! ( "issues.txt" ) . map ( |path| path. replace ( "/" , std:: path:: MAIN_SEPARATOR_STR ) ) ,
97
- ) ;
98
-
99
91
let ( ui, ui_fulldeps) = ( path. join ( "ui" ) , path. join ( "ui-fulldeps" ) ) ;
100
92
let paths = [ ui. as_path ( ) , ui_fulldeps. as_path ( ) ] ;
101
93
crate :: walk:: walk_no_read ( & paths, |_, _| false , & mut |entry| {
@@ -108,11 +100,6 @@ pub fn check(path: &Path, bad: &mut bool) {
108
100
{
109
101
tidy_error ! ( bad, "file {} has unexpected extension {}" , file_path. display( ) , ext) ;
110
102
}
111
-
112
- // NB: We do not use file_stem() as some file names have multiple `.`s and we
113
- // must strip all of them.
114
- let testname =
115
- file_path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . split_once ( '.' ) . unwrap ( ) . 0 ;
116
103
if ext == "stderr" || ext == "stdout" {
117
104
// Test output filenames have one of the formats:
118
105
// ```
@@ -124,7 +111,11 @@ pub fn check(path: &Path, bad: &mut bool) {
124
111
//
125
112
// For now, just make sure that there is a corresponding
126
113
// `$testname.rs` file.
127
-
114
+ //
115
+ // NB: We do not use file_stem() as some file names have multiple `.`s and we
116
+ // must strip all of them.
117
+ let testname =
118
+ file_path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . split_once ( '.' ) . unwrap ( ) . 0 ;
128
119
if !file_path. with_file_name ( testname) . with_extension ( "rs" ) . exists ( )
129
120
&& !testname. contains ( "ignore-tidy" )
130
121
{
@@ -137,38 +128,6 @@ pub fn check(path: &Path, bad: &mut bool) {
137
128
}
138
129
}
139
130
}
140
-
141
- if ext == "rs" {
142
- lazy_static ! {
143
- static ref ISSUE_NAME_REGEX : Regex =
144
- Regex :: new( r"^issues?[-_]?\d{3,}" ) . unwrap( ) ;
145
- }
146
-
147
- if ISSUE_NAME_REGEX . is_match ( testname) {
148
- // these paths are always relative to the passed `path` and always UTF8
149
- let stripped_path = file_path. strip_prefix ( path) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
150
- if !allowed_issue_filenames. remove ( stripped_path) {
151
- tidy_error ! (
152
- bad,
153
- "UI test `{}` should use a name that describes the test and link the issue in a comment instead." ,
154
- file_path. display( ) ,
155
- ) ;
156
- }
157
- }
158
- }
159
131
}
160
132
} ) ;
161
-
162
- // if an excluded file is renamed, it must be removed from this list
163
- if allowed_issue_filenames. len ( ) > 0 {
164
- for file_name in allowed_issue_filenames {
165
- let mut p = PathBuf :: from ( path) ;
166
- p. push ( file_name) ;
167
- tidy_error ! (
168
- bad,
169
- "file `{}` no longer exists and should be removed from the exclusions in `src/tools/tidy/src/issues.txt`" ,
170
- p. display( )
171
- ) ;
172
- }
173
- }
174
133
}
0 commit comments