Tools: Add Markdown to lint option

Created on 21 Jan 2019  路  10Comments  路  Source: nf-core/tools

I found this nice tool for linting markdown: https://github.com/DavidAnson/markdownlint. It would be nice to lint also the Markdown documentation.

linting

Most helpful comment

This was quite easy actually:

# .travis.yml
install:
  # Install markdownlint-cli
  - sudo apt-get install npm && npm install -g markdownlint-cli
script:
- markdownlint ${TRAVIS_BUILD_DIR}/docs -c ${TRAVIS_BUILD_DIR}/conf/markdown-lint.yaml

and

# markdown-lint.yaml
# Markdownlint configuration file
default: true,
line-length: false

Tested on nfcore/rnafusion: https://travis-ci.com/nf-core/rnafusion/jobs/172479363

All 10 comments

Agreed, looks great! Maybe worth turning off some of the stricter rules (eg. I don't agree with Multiple consecutive blank lines being a problem), but could catch a lot of minor errors..

Should be easy to run on travis too - just install, then run it for all *.md files.

This is the tool I'll test on nfcore/rnafusion markdownlint-cli

My OCD is going to love this 馃

Can we run this on GitHub issue / PR comments as well please?? 馃槅

This was quite easy actually:

# .travis.yml
install:
  # Install markdownlint-cli
  - sudo apt-get install npm && npm install -g markdownlint-cli
script:
- markdownlint ${TRAVIS_BUILD_DIR}/docs -c ${TRAVIS_BUILD_DIR}/conf/markdown-lint.yaml

and

# markdown-lint.yaml
# Markdownlint configuration file
default: true,
line-length: false

Tested on nfcore/rnafusion: https://travis-ci.com/nf-core/rnafusion/jobs/172479363

Nice! Can we lint all *.md files in the repo, not just in docs? ie. the readme and changelog too...

...I wonder if we should use a python package for this and built it into the lint tests command? Would be easier for people to test locally then.

Yes, we definitely can lint everything. I wasn't able to find any python package sadly 馃槩.

Should I make a PR nf-core/tools and change .travis.yml to run the lint as I did on nf-core/rnafusion?

Yes please 馃憤 In two places - .travis.yml for the main repo and also in the template .travis.yml for the generated pipelines.

Created PR #259, waiting for comments

Was this page helpful?
0 / 5 - 0 ratings