MarketSquare / robotframework-robocop

Tool for static code analysis of Robot Framework language
Apache License 2.0
177 stars 37 forks source link

Validate markdown and rst file formatting #912

Open bhirsz opened 12 months ago

bhirsz commented 12 months ago

We have several markdown or rst files in the repository. We need a way to validate them - for example using linters in precommit. Afaik Airflow uses such scripts so we can start from there.

bhirsz commented 11 months ago

The problem is that most popular Markdown linter is node js based (https://github.com/igorshubovych/markdownlint-cli). There are Python tools (such as https://github.com/jackdewinter/pymarkdown/tree/main) and they are working fine though they are more pain to configure - it is under active development and not everything is mature enough.

We can either run our precommit in docker (troublesome locally but we could run markdown etc linter in CI) or focus on supporting only Python-based tools or use MegaLinter in our CI (which prepares all different linters in docker image). I'm voting for the last since it's the least troublesome to implement and we can decide on replacing it later if the need arise.

bhirsz commented 11 months ago

Bonus is that MegaLinter supports multiple formats (rst, markdown, yaml linters on top of programming languages) and can be run either locally or in CI - we are getting Docker image ready to use.

mnojek commented 11 months ago

Good idea, I think using MegaLinter is a good idea. And with it we will have more linters to use in our CI. Also, we will start a mutual relation here, since we want to add Robocop to their tool as well ;)

bhirsz commented 11 months ago

Partly implemented by #919. Markdown files are validated. There are some issues with rst files - I will raise separate PR that enables and fixes configuration for the linter