markdownlint-cli icon indicating copy to clipboard operation
markdownlint-cli copied to clipboard

Allow for 'warn only' behavior

Open brandonh-msft opened this issue 4 years ago • 4 comments

Would be nice if markdownlint-cli just allowed for output of linting violations but did not exit 1. This would effectively be "warn" instead of "error".

brandonh-msft avatar Mar 22 '21 00:03 brandonh-msft

There's a request to make error/warning configurable per-rule: https://github.com/DavidAnson/markdownlint/issues/254

But for this scenario, could you just ignore the tool's exit code?

DavidAnson avatar Mar 22 '21 00:03 DavidAnson

I'm currently running this in a GitHub Actions workflow and still working on how I can get it to "ignore" the error code. So TBD there :)

Update: using set +e ... set -e got me around this for now.

While per-rule would also be nice (many linters support this as I'm sure you know) an overall setting is also. For this situation I would hate to have to go thru and specify every single supported rule just to override with "warn".

brandonh-msft avatar Mar 22 '21 15:03 brandonh-msft

FYI that CLI2 has a a GitHub Action ready to go: https://github.com/DavidAnson/markdownlint-cli2-action

Here’s how to ignore a failure: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error

DavidAnson avatar Mar 22 '21 15:03 DavidAnson

ah thanks for the GH Action reference!

brandonh-msft avatar Mar 22 '21 15:03 brandonh-msft