markdown - Markdownlint not respecting configuration file? - Stack Overflow

I'm running markdownlint against some Markdown files and the rules configurations I have don'

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745166755a4614680.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信