Skip to content

Commit

Permalink
lint all
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Sep 21, 2020
1 parent a49dca8 commit 427cc01
Show file tree
Hide file tree
Showing 19 changed files with 147 additions and 1,741 deletions.
139 changes: 139 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#------------------------------------------------------------------------------#
name: Lint
#------------------------------------------------------------------------------#
# Workflow conditions
on:
push:
branches:
- '*'
paths:
- '.github/workflows/lint.yaml'
- '**/*.yaml'
- '**/*.md'
- 'workflow/report/*.rst'
- '**/*.py'
- '**/Snakefile'
- '**/*.smk'
pull_request:
branches:
- '*'
release:
types: [published]
#------------------------------------------------------------------------------#
jobs:
#----------------------------------------------------------------------------#
# Check the pre-commit linters
pre_commit:
runs-on: ubuntu-latest
steps:
#------------------------------------------------------------------------#
# Checkout repo
- name: checkout repo
uses: actions/checkout@v2
#------------------------------------------------------------------------#
# Install dependencies
- name: setup Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: install pre-commit
run: |
pip install pre-commit==2.6.0
pre-commit install-hooks
# Lint all files
- name: pre-commit lint
run: pre-commit run --all-files
#----------------------------------------------------------------------------#
# Markdown template from nf-core eager to trial
# Only select files for now to prevent full workflow from failing
markdown_lint:
runs-on: ubuntu-latest
steps:
#------------------------------------------------------------------------#
# Checkout Repository
- name: checkout repo
uses: actions/checkout@v2
#------------------------------------------------------------------------#
# Install dependencies
- name: setup node
- uses: actions/setup-node@v1
with:
node-version: '10'
- name: install markdownlint
run: npm install -g markdownlint-cli

# Lint files
- name: Run Markdownlint
run: |
markdownlint -c ${GITHUB_WORKSPACE}/.github/markdown_lint.yaml $(find ${GITHUB_WORKSPACE} -name "*.md")
#----------------------------------------------------------------------------#
# YAML template from nf-core eager to trial
yaml_lint:
runs-on: ubuntu-latest
steps:
#------------------------------------------------------------------------#
# Checkout Repository
- name: checkout repo
uses: actions/checkout@v2
#------------------------------------------------------------------------#
# Install dependencies
- name: setup node
- uses: actions/setup-node@v1
with:
node-version: '10'
- name: install yaml-lint
run: npm install -g yaml-lint
# Lint files
- name: run yaml-lint
run: yamllint $(find ${GITHUB_WORKSPACE} -name "*.yaml")

#----------------------------------------------------------------------------#
# Python linting with flake8 and black
python_lint:
runs-on: ubuntu-latest
steps:
#------------------------------------------------------------------------#
# Checkout Repository
- name: checkout repo
uses: actions/checkout@v2
#------------------------------------------------------------------------#
# Install dependencies
- name: setup python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: install linters
run: pip install black flake8 flake8-bugbear
# Lint snakemake main
- name: lint snakefile
run: |
black $(find . -name "Snakefile")
flake8 $(find . -name "Snakefile")
# Lint snakemake modules
- name: lint snakefile submodules
run: |
black $(find . -name "*.smk")
flake8 $(find . -name "*.smk")
- name: lint other python
run: |
black $(find . -name "*.py")
flake8 $(find . -name "*.py")
#----------------------------------------------------------------------------#
# RST lint
rst_lint:
runs-on: ubuntu-latest
steps:
#------------------------------------------------------------------------#
- name: checkout repo
uses: actions/checkout@v2
#------------------------------------------------------------------------#
# Install dependencies
- name: setup Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install rst-lint
run: pip install restructuredtext-lint
# Lint workflow report rst files
- name: Run rst-lint
run: rst-lint workflow/report/*.rst
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

exclude: 'html'
exclude: '''
html
auspice/.*.json
'''

repos:

Expand Down Expand Up @@ -43,9 +46,12 @@ repos:
hooks:
- id: markdownlint
args: [--config=.github/markdown_lint.yaml]
exclude: narratives/.*.md

# Rst Lint
- repo: https://github.com/myint/rstcheck
rev: master
hooks:
- id: rstcheck
# Exclude auto generated rst files
exclude: docs/README.rst
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theme: jekyll-theme-cayman
theme: jekyll-theme-cayman
43 changes: 0 additions & 43 deletions scripts/fasta_extract_locus.sh

This file was deleted.

72 changes: 0 additions & 72 deletions scripts/fasta_filterGapsNs.sh

This file was deleted.

22 changes: 0 additions & 22 deletions scripts/fasta_unwrap.sh

This file was deleted.

68 changes: 0 additions & 68 deletions scripts/format_metadata_Assembly.sh

This file was deleted.

Loading

0 comments on commit 427cc01

Please sign in to comment.