File tree 2 files changed +10
-18
lines changed 2 files changed +10
-18
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ fn run_checks(args: &args::Args) -> proc_exit::ExitResult {
188
188
} ;
189
189
190
190
// Note: file_list and args.path are mutually exclusive, enforced by clap
191
- for path in file_list. as_ref ( ) . unwrap_or ( & args. path ) {
191
+ ' path : for path in file_list. as_ref ( ) . unwrap_or ( & args. path ) {
192
192
// Note paths are passed through stdin, `-` is treated like a normal path
193
193
let cwd = if path == std:: path:: Path :: new ( "-" ) {
194
194
if args. file_list . is_some ( ) {
@@ -244,8 +244,14 @@ fn run_checks(args: &args::Args) -> proc_exit::ExitResult {
244
244
. build ( )
245
245
. with_code ( proc_exit:: sysexits:: CONFIG_ERR ) ?;
246
246
if args. force_exclude {
247
- if let ignore:: Match :: Ignore ( _) = overrides. matched ( path, path. is_dir ( ) ) {
248
- continue ;
247
+ let mut ancestors = path. ancestors ( ) . collect :: < Vec < _ > > ( ) ;
248
+ ancestors. reverse ( ) ;
249
+ for path in ancestors {
250
+ match overrides. matched ( path, path. is_dir ( ) ) {
251
+ ignore:: Match :: None => { }
252
+ ignore:: Match :: Ignore ( _) => continue ' path,
253
+ ignore:: Match :: Whitelist ( _) => break ,
254
+ }
249
255
}
250
256
}
251
257
walk. overrides ( overrides) ;
Original file line number Diff line number Diff line change 1
1
bin.name = " typos"
2
2
args = " file.ignore ignore/file parent/ignore/file --force-exclude"
3
3
stdin = " "
4
- stdout = """
5
- error: `hello` should be `goodbye`
6
- --> ignore/file:1:1
7
- |
8
- 1 | hello
9
- | ^^^^^
10
- |
11
- error: `hello` should be `goodbye`
12
- --> parent/ignore/file:1:1
13
- |
14
- 1 | hello
15
- | ^^^^^
16
- |
17
- """
4
+ stdout = " "
18
5
stderr = " "
19
- status.code = 2
You can’t perform that action at this time.
0 commit comments