diff --git a/.fake8 b/.fake8 new file mode 100644 index 0000000..f814bba --- /dev/null +++ b/.fake8 @@ -0,0 +1,10 @@ +[flake8] +exclude = + .git, + __pycache__, + docs/source/conf.py, + old, + build, + dist +max-complexity = 10 +max-line-length = 127 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 939a7eb..32ab2e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,10 +2,9 @@ name: Tests on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] - + branches: [master] jobs: Formatting: @@ -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" diff --git a/.yaml-lint.yml b/.yaml-lint.yml new file mode 100644 index 0000000..9045923 --- /dev/null +++ b/.yaml-lint.yml @@ -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