admin管理员组

文章数量:1414628

I'm running markdownlint against some Markdown files and the rules configurations I have don't seem to be getting applied.

Here's my config file:

.markdownlint.yml

default: true
ignore_front_matter: true
MD013:
  line_length: 240

Here's my document:

test.md

---
omit:
  - thing1
---
# Header

These documents will serve as reference for the back-end automation supporting the Abc123 project.

I'm using this Docker image. I run this command:

mdl --config .markdownlint.yml test.md

Or with Docker:

docker run --rm -it -v ./myrepo:/repo --workdir /repo/docs markdownlint/markdownlint --config .markdownlint.yml test.md

I get this output:

test.md:7: MD013 Line length

test.md:3: MD032 Lists should be surrounded by blank lines

MD013 is triggering because the default line length is 80, but it shouldn't be because my configuration increases it to 240. MD032 should not be triggering on line 3 because I have ignore_front_matter enabled (as described here).

I know it's processing the config file because when I use --verbose I get:

Loaded config from /repo/docs/.markdownlint.yml

I copied the configuration from here.

I've tried with a config in json and yml with no change. What am I doing wrong here?

I'm running markdownlint against some Markdown files and the rules configurations I have don't seem to be getting applied.

Here's my config file:

.markdownlint.yml

default: true
ignore_front_matter: true
MD013:
  line_length: 240

Here's my document:

test.md

---
omit:
  - thing1
---
# Header

These documents will serve as reference for the back-end automation supporting the Abc123 project.

I'm using this Docker image. I run this command:

mdl --config .markdownlint.yml test.md

Or with Docker:

docker run --rm -it -v ./myrepo:/repo --workdir /repo/docs markdownlint/markdownlint --config .markdownlint.yml test.md

I get this output:

test.md:7: MD013 Line length

test.md:3: MD032 Lists should be surrounded by blank lines

MD013 is triggering because the default line length is 80, but it shouldn't be because my configuration increases it to 240. MD032 should not be triggering on line 3 because I have ignore_front_matter enabled (as described here).

I know it's processing the config file because when I use --verbose I get:

Loaded config from /repo/docs/.markdownlint.yml

I copied the configuration from here.

I've tried with a config in json and yml with no change. What am I doing wrong here?

Share Improve this question edited Feb 21 at 5:02 jeremywat asked Feb 21 at 4:56 jeremywatjeremywat 1,0764 silver badges17 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

It appears that the issue is the configuration file is specifically for the Node.js version of Markdownlint (markdownlint-cli2), and is not compatible with the Ruby variation I'm using (mdl) from markdownlint/markdownlint.

When I use markdownlint-cli2 it works:

docker run --rm -it -v ./myrepo:/repo --workdir /repo/docs davidanson/markdownlint-cli2 --config .markdownlint.yml test.md

本文标签: markdownMarkdownlint not respecting configuration fileStack Overflow