Pre-commit hooks to enforce snakemake formatting - #2
Open
dgruano wants to merge 11 commits into
Open
Conversation
This reverts commit c9c2d63.
Collaborator
Author
|
Some notes after discussing with @Sergio-ote:
These formatting changes should balance keeping the commit diffs clean and avoid formatting data files. Virtually, formatting changes will be reduced to:
Let me know what you think! |
Collaborator
Author
|
As a last change, I included the packages needed to build the documentation in the PR is ready for review. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Add development environment configuration, include
pre-commitandsnakefmtto ensure proper formatting and document all this in theCONTRIBUTING.mddocs.According to the Snakemake workflow catalog, formatting is faling.
pre-commit is installed with conda. Hooks are configured in
.pre-commit-config.yaml and installed withpre-commit install`. Hooks include snakefmt and fixes for other common formatting errors.pre-commit hooks are ran automatically on all committed files before a commit, which fails if any hook needs to modify a file. In that case,
git add -uto include all changes made by pre-commit. The nextgit commitwill have proper formatting.For all files that were misformatted, I ran the hooks with
pre-commit run --all-files. I included all rule files in one commit and the rest in another commit. @Sergio-ote , feel free to cherry-pick the configuration and documentation commits and run the hooks yourself to avoid a bump in the modified lines by me seen by git.Also @Sergio-ote , can you share how you configured the environment to build the docs? This is the only check missing on my end.
Cheers!
Validation
.test/.test/dry-run builds the CoreBlock DAGmkdocs build --strictpasses, if documentation was changed