-
Notifications
You must be signed in to change notification settings - Fork 189
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
Provide a way to ignore files in a hex package upload #506
Comments
One other idea would be to add a config option (in the hex.config) file. That would then make a global hex rule for any packages that user creates. |
I think an |
The problem with I mentioned this in passing in other tickets so let me repeat here. I'd like to discuss solving the problem of unneeded files with a whitelist approach using either (or some combination of):
thoughts? |
The manifest seems like too much work and I don't see how we can automate it. Too many mistakes |
we could do here's one idea how manifest could work: instead of Ok, let's go with (edit: updated paragraph about manifest being annoying) |
But what will be exclude_files? Is it a regex? a pattern? Is it configured globally? |
if anyone is interested, I've put together manifest package that handles |
It should probably behave the same as |
@ericmj then how would you ignore every .DS_STORE? Would you have to list all of them? Would you make it a glob? |
It would be a glob as: |
@ericmj i wonder if exclude_patterns with regexes would be better. |
Let's go with |
|
Those may be of interest:
This comment in particular is very interesting. |
@ericmj I can work on implementing this feature. I'll have a PR later this week adding the |
Closing this issue as a PR adding this functionality has been merged! 🙌 |
There currently is no solution to exclude files that should be uploaded into the package manager when releasing a version of a package. The default values will pick up files that might be created by the OS or editor while working on the package that is being released.
For example, in macOS the Finder will create a
.DS_Store
file in each directory that has been viewed through it. If I ever opened any of the directories within thelib/
with Finder, the default files will pick up the.DS_Store
files that were created (for example alib/.DS_Store
).Below is an example of the files being included when publishing a recent package. You can notice two
.DS_Store
files that ideally shouldn't be uploaded into Hex.While it is true that these files being uploaded into Hex, they also serve absolutely no purpose. It could also be argued that some might consider it unprofessional to have files not really associated with the package be uploaded as part of the package. It is also true that a developer could be careful and make sure they don't upload files they don't intend to upload but I believe being able to configure these files knowing that they will exists is also a good experience.
I know that the
.DS_Store
example is very specific, but I'm sure there are other files that it makes sense to potentially exclude.Other package manager solutions
.gitignore
and a.npmignore
file, to exclude files to be uploadedMANIFEST.in
file to exclude files to uploadedexclude_files
to list file to be excluded from the uploadProposition
Add an
exclude_files
option to the thepackage
part of themix.exs
. Given that there already exists afiles
option, it makes sense to have both the included and excluded files live in one place.The text was updated successfully, but these errors were encountered: