Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add an option to exclude everything in .gitignore#18696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ilevkivskyi merged 3 commits intopython:masterfromilevkivskyi:exclude-gitignore
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Use fscache
  • Loading branch information
@ilevkivskyi
ilevkivskyi committedFeb 18, 2025
commita011d027ec63f3ca4f692fcc402e5b701e9ab538
4 changes: 3 additions & 1 deletionmypy/find_sources.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -120,7 +120,9 @@ def find_sources_in_dir(self, path: str) -> list[BuildSource]:

if matches_exclude(subpath, self.exclude, self.fscache, self.verbosity >= 2):
continue
if self.exclude_gitignore and matches_gitignore(subpath, self.verbosity >= 2):
if self.exclude_gitignore and matches_gitignore(
subpath, self.fscache, self.verbosity >= 2
):
continue

if self.fscache.isdir(subpath):
Expand Down
6 changes: 3 additions & 3 deletionsmypy/modulefinder.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -631,7 +631,7 @@ def find_modules_recursive(self, module: str) -> list[BuildSource]:
if (
self.options
and self.options.exclude_gitignore
and matches_gitignore(subpath, self.options.verbosity >= 2)
and matches_gitignore(subpath, self.fscache, self.options.verbosity >= 2)
):
continue

Expand DownExpand Up@@ -673,11 +673,11 @@ def matches_exclude(
return False


def matches_gitignore(subpath: str, verbose: bool) -> bool:
def matches_gitignore(subpath: str,fscache: FileSystemCache,verbose: bool) -> bool:
dir, _ = os.path.split(subpath)
for gi_path, gi_spec in find_gitignores(dir):
relative_path = os.path.relpath(subpath, gi_path)
ifos.path.isdir(relative_path):
iffscache.isdir(relative_path):
relative_path = relative_path + "/"
if gi_spec.match_file(relative_path):
if verbose:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp