Skip to content

code: Add empty folders to repo#1764

Merged
fneum merged 4 commits intomasterfrom
keep-empty-dirs
Nov 4, 2025
Merged

code: Add empty folders to repo#1764
fneum merged 4 commits intomasterfrom
keep-empty-dirs

Conversation

@euronion
Copy link
Copy Markdown
Contributor

I added the folders that will be automatically created by snakemake as empty folders with .gitkeep.

The idea is to avoid folder "popping up" when exeucting the workflow. It also makes it easier to talk about those folders in the documentation, because one doesn't always have to add "this folder will be created automatically".

Changes proposed in this Pull Request

Checklist

  • I tested my contribution locally and it works as intended.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in config/config.default.yaml.
  • Changes in configuration options are documented in doc/configtables/*.csv.
  • Sources of newly added data are documented in doc/data_sources.rst.
  • A release note doc/release_notes.rst is added.

@fneum
Copy link
Copy Markdown
Member

fneum commented Jul 31, 2025

It kind of conflicts with the purge rule which deletes resources and results folders. If we go ahead with this, the purge rule should be adjusted to delete the content of resources and results directories (rather than directories themselves).

Copy link
Copy Markdown
Member

@lkstrp lkstrp left a comment

Choose a reason for hiding this comment

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

I am a bit against .gitkeeps files, since they indicate git functionality when they are just random files. They also just hide the information if a directory actually contains anything.

Is there any other benefit then just for reference in the documentation? We could use a simple file tree instead. It's more clear anyway

@euronion
Copy link
Copy Markdown
Contributor Author

There are some minor benefits (like tab completion for the folders) and downsides (like how the folders show up in the editor (w/ content and w/o content). It also makes creating the file trees easier - you don't need to manually edit them to add those folders.

My main concern was them "popping up". From my experience, this behaviour can be a bit surprising for people that are not used to snakemake. When they read the documentation and read about folders, and then compare it with the folders they see in their file explorer that don't match the documentation - that's were confusion starts to settle in.

Happy to adjust the purge rule if we want to go forward with it.

@fneum
Copy link
Copy Markdown
Member

fneum commented Nov 1, 2025

I don't have a strong preference on this matter. @euronion, if you'd like, go ahead and adjust the purge rule.

@euronion
Copy link
Copy Markdown
Contributor Author

euronion commented Nov 3, 2025

I opted for the simple approach of recreating the folder with the .gitkeep files, i.e. this does not preserve the creation timestamps of the folders and the .gitkeep files.

@fneum fneum enabled auto-merge (squash) November 3, 2025 08:54
@euronion
Copy link
Copy Markdown
Contributor Author

euronion commented Nov 3, 2025

@lkstrp Can we merge without CI?

@fneum fneum disabled auto-merge November 4, 2025 05:42
@fneum fneum merged commit c45ef4b into master Nov 4, 2025
4 of 6 checks passed
@fneum fneum deleted the keep-empty-dirs branch November 4, 2025 05:43
toniseibold pushed a commit that referenced this pull request Dec 1, 2025
* code: Add empty folders to repo

* Update purge rule

---------

Co-authored-by: Fabian Neumann <[email protected]>
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.

3 participants