File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,18 @@ fn check_forbidden_code() {
6
6
// Do not use certain macros, functions, etc.
7
7
if !cargo:: util:: is_ci ( ) {
8
8
// Only check these on CI, otherwise it could be annoying.
9
+ use std:: io:: Write ;
10
+ writeln ! (
11
+ std:: io:: stderr( ) ,
12
+ "\n Skipping check_forbidden_code test, set CI=1 to enable"
13
+ )
14
+ . unwrap ( ) ;
9
15
return ;
10
16
}
11
- let path = std:: path:: Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "src" ) ;
12
- for entry in walkdir:: WalkDir :: new ( path )
17
+ let root_path = std:: path:: Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "src" ) ;
18
+ for entry in walkdir:: WalkDir :: new ( & root_path )
13
19
. into_iter ( )
20
+ . filter_entry ( |e| e. path ( ) != root_path. join ( "doc" ) )
14
21
. filter_map ( |e| e. ok ( ) )
15
22
{
16
23
let path = entry. path ( ) ;
@@ -22,6 +29,7 @@ fn check_forbidden_code() {
22
29
{
23
30
continue ;
24
31
}
32
+ eprintln ! ( "checking {}" , path. display( ) ) ;
25
33
let c = fs:: read_to_string ( path) . unwrap ( ) ;
26
34
for ( line_index, line) in c. lines ( ) . enumerate ( ) {
27
35
if line. trim ( ) . starts_with ( "//" ) {
You can’t perform that action at this time.
0 commit comments