@@ -682,24 +682,26 @@ def get_sources(
682
682
path = Path (s )
683
683
is_stdin = False
684
684
685
+ # Compare the logic here to the logic in `gen_python_files`.
685
686
if is_stdin or path .is_file ():
687
+ root_relative_path = path .absolute ().relative_to (root ).as_posix ()
688
+
689
+ root_relative_path = "/" + root_relative_path
690
+
691
+ # Hard-exclude any files that matches the `--force-exclude` regex.
692
+ if path_is_excluded (root_relative_path , force_exclude ):
693
+ report .path_ignored (
694
+ path , "matches the --force-exclude regular expression"
695
+ )
696
+ continue
697
+
686
698
normalized_path : Optional [str ] = normalize_path_maybe_ignore (
687
699
path , root , report
688
700
)
689
701
if normalized_path is None :
690
702
if verbose :
691
703
out (f'Skipping invalid source: "{ normalized_path } "' , fg = "red" )
692
704
continue
693
- if verbose :
694
- out (f'Found input source: "{ normalized_path } "' , fg = "blue" )
695
-
696
- normalized_path = "/" + normalized_path
697
- # Hard-exclude any files that matches the `--force-exclude` regex.
698
- if path_is_excluded (normalized_path , force_exclude ):
699
- report .path_ignored (
700
- path , "matches the --force-exclude regular expression"
701
- )
702
- continue
703
705
704
706
if is_stdin :
705
707
path = Path (f"{ STDIN_PLACEHOLDER } { str (path )} " )
@@ -709,6 +711,8 @@ def get_sources(
709
711
):
710
712
continue
711
713
714
+ if verbose :
715
+ out (f'Found input source: "{ normalized_path } "' , fg = "blue" )
712
716
sources .add (path )
713
717
elif path .is_dir ():
714
718
path = root / (path .resolve ().relative_to (root ))
0 commit comments