-
Notifications
You must be signed in to change notification settings - Fork 0
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve ignore patterns #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request effectively integrates the use of ignore patterns across different parts of the codebase, ensuring consistency in handling file and directory processing. This is crucial for maintaining the integrity and expected behavior of the application when dealing with file hierarchies. Overall, the changes are well-implemented and align with the goal of preserving ignore patterns throughout the application.
Butler is in closed beta. Reply with feedback or to ask Butler to review other parts of the PR. Please give feedback with emoji reacts.
for dir in directories: | ||
dir_str = dir.as_posix() | ||
dir_path = dir if dir != Path("ROOT") else Path(".") | ||
document = get_document(dir_str, cwd, type="directory") | ||
document = get_document( | ||
dir_str, cwd, type="directory", ignore_patterns=self.ignore_patterns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for dir in directories: | |
dir_str = dir.as_posix() | |
dir_path = dir if dir != Path("ROOT") else Path(".") | |
document = get_document(dir_str, cwd, type="directory") | |
document = get_document( | |
dir_str, cwd, type="directory", ignore_patterns=self.ignore_patterns | |
document = get_document( | |
dir_str, cwd, type="directory", ignore_patterns=self.ignore_patterns | |
) | |
checksum = hash_str( | |
"".join( | |
checksums.get(dir_path / subpath, "") | |
for subpath in document.split(" | |
")[1:] | |
) | |
) |
This change ensures that the ignore patterns are consistently applied when generating the document for directories. It's a good practice to maintain consistency in how files and directories are processed, especially when ignore patterns are involved.
path = cwd if ref == "ROOT" else cwd / ref | ||
paths = sorted([p.as_posix() for p in get_paths_for_directory(path)]) | ||
paths = sorted( | ||
[ | ||
p.as_posix() | ||
for p in get_paths_for_directory(path, exclude_patterns=ignore_patterns) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path = cwd if ref == "ROOT" else cwd / ref | |
paths = sorted([p.as_posix() for p in get_paths_for_directory(path)]) | |
paths = sorted( | |
[ | |
p.as_posix() | |
for p in get_paths_for_directory(path, exclude_patterns=ignore_patterns) | |
paths = sorted( | |
[ | |
p.as_posix() | |
for p in get_paths_for_directory(path, exclude_patterns=ignore_patterns) | |
] | |
) |
Including the ignore_patterns
in the get_paths_for_directory
call here is crucial for maintaining the integrity of the directory processing, ensuring that the ignore patterns are respected across all utility functions.
No description provided.