Skip to content
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

fix: allow dot files with --package-suffixes #1742

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

saikonen
Copy link
Collaborator

allow files that start with . to be added via --package-suffixes

closes #1741

@nflx-mf-bot
Copy link
Collaborator

Testing[636] @ aada8b1

@nflx-mf-bot
Copy link
Collaborator

Testing[636] @ aada8b1 had 7 FAILUREs.

madhur-ob
madhur-ob previously approved these changes Feb 19, 2024
romain-intel
romain-intel previously approved these changes Feb 29, 2024
Copy link
Contributor

@romain-intel romain-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One possible alternative but mergeable in both cases.

@@ -88,8 +88,6 @@ def _walk(self, root, exclude_hidden=True, suffixes=None):
# if path and (path[0] == '.' or './' in path):
# continue
for fname in files:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a slightly safer and less expensive check would be something like:

if (fname[0] == "." and fname in suffixes) or (fname[0] != "." and any(fname.endswith(suffix) for suffix in suffixes):

This would restrict to including just files like .env and not check all random . files.

But am fine with this change as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going with your suggestion as the initial implementation ended up including arbitrary hidden files with known extensions, e.g. .hidden.py

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point -- I hadn't even thought of that.

@saikonen saikonen dismissed stale reviews from romain-intel and madhur-ob via 9e31719 February 29, 2024 11:08
@saikonen saikonen merged commit d3ec9a5 into master Feb 29, 2024
34 checks passed
@saikonen saikonen deleted the fix/allow-dot-files-for-package-suffixes branch February 29, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--package-suffixes omits dotfiles
4 participants