Skip to content

Commit

Permalink
feat: add formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
visze committed Mar 30, 2022
1 parent 2ab3c62 commit e589376
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 24 deletions.
10 changes: 10 additions & 0 deletions .fake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
exclude =
.git,
__pycache__,
docs/source/conf.py,
old,
build,
dist
max-complexity = 10
max-line-length = 127
54 changes: 30 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: Tests

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]

branches: [master]

jobs:
Formatting:
Expand All @@ -14,41 +13,48 @@ jobs:
- uses: actions/checkout@v2
- name: Formatting
uses: github/super-linter@v4
with:
fetch-depth: 0
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_PYTHON_FLAKE8: true
PYTHON_FLAKE8_CONFIG_FILE: .flake8
VALIDATE_JSON: true
VALIDATE_YAML: true
YAML_CONFIG_FILE: .yaml-lint.yml
VALIDATE_SNAKEMAKE_SNAKEFMT: true

Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint workflow
uses: snakemake/snakemake-github-action@v1.24.0
with:
directory: .
snakefile: workflow/Snakefile
args: "--lint --configfile config/example_config.yaml"
- uses: actions/checkout@v2
- name: Lint workflow
uses: snakemake/snakemake-github-action@v1.24.0
with:
directory: .
snakefile: workflow/Snakefile
args: "--lint --configfile config/example_config.yaml"

Testing:
runs-on: ubuntu-latest
needs:
needs:
- Linting
- Formatting
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Test workflow
uses: snakemake/snakemake-github-action@v1.24.0
with:
directory: .test
snakefile: workflow/Snakefile
args: "--configfile config/example_config.yaml --use-conda --show-failed-logs --cores 3 --conda-cleanup-pkgs cache --all-temp"
- name: Test workflow
uses: snakemake/snakemake-github-action@v1.24.0
with:
directory: .test
snakefile: workflow/Snakefile
args: "--configfile config/example_config.yaml --use-conda --show-failed-logs --cores 3 --conda-cleanup-pkgs cache"

- name: Test report
uses: snakemake/snakemake-github-action@v1.24.0
with:
directory: .test
snakefile: workflow/Snakefile
args: "--configfile config/example_config.yaml --report report.zip"
- name: Test report
uses: snakemake/snakemake-github-action@v1.24.0
with:
directory: .test
snakefile: workflow/Snakefile
args: "--configfile config/example_config.yaml --report report.zip"
8 changes: 8 additions & 0 deletions .yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: default

rules:
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 127
level: warning

0 comments on commit e589376

Please sign in to comment.