Skip to content

Commit

Permalink
Adding Snakefmt instead of Snakemake lint (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonkoehn authored Sep 24, 2024
1 parent ee7aa56 commit 4b9e686
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/test-snake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,22 @@ jobs:
poetry-version: ["1.8.3"]

steps:
- uses: actions/checkout@v3
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter/slim@v5
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: branch_name
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISABLE_ERRORS: true
PYTHON_FLAKE8_CONFIG_FILE: .flake8
VALIDATE_PYTHON_FLAKE8: true
VALIDATE_SNAKEMAKE_SNAKEFMT: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -36,11 +51,6 @@ jobs:
run: |
pip install -e .
- name: Snakemake Linting
run: |
cd workflow
snakemake --lint -s Snakefile
- name: Snakemake Testing
run: |
snakemake --cores 1 --snakefile workflow/Snakefile --directory .test --verbose
Expand Down
11 changes: 4 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@ repos:
language: node
pass_filenames: true
types: [python]
- repo: https://github.com/snakemake/snakefmt
rev: v0.10.2
hooks:
- id: snakefmt
- repo: local
hooks:
- id: snakemake-lint
name: Snakemake Lint
entry: bash -c 'cd workflow && snakemake --lint'
language: system
files: (Snakefile|\.smk$)
pass_filenames: false

- id: snakemake-dryrun
name: Snakemake Dry Run
entry: bash -c 'cd workflow && snakemake -n'
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mkdocstrings = {extras = ["python"], version = "^0.21.2"}
mkdocs-gen-files = "^0.4.0"
mkdocs-literate-nav = "^0.6.0"
setuptools = "^74.1.2"
snakefmt = "^0.10.2"

[tool.coverage.report]
fail_under = 85.0
Expand Down Expand Up @@ -57,6 +58,10 @@ exclude = ["**/node_modules",
"src/typestubs"
]

[tool.snakefmt]
line_length = 88
include = '\.smk$|^Snakefile'


[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 4b9e686

Please sign in to comment.