Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit 5372ce5

Browse files
null-ls: use specific configuration file
use `extra_args` to set a specific location path for the markdownlint rules configuration A relative path to the rules file can be used without the the use of `vim.fn.expand()` function (which causes an error) Without a specific configuration file, a markdownlint configuration file in the root directory of a project is used, e.g. `.markdownlint.yaml` Resolve #1
1 parent 32ccdea commit 5372ce5

3 files changed

Lines changed: 265 additions & 2 deletions

File tree

.markdownlint.yaml

Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
---
2+
# Example markdownlint configuration with properties set to their default value
3+
4+
# Default state for all rules
5+
default: true
6+
7+
# Path to configuration file to extend
8+
extends: null
9+
10+
# MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time
11+
MD001: true
12+
13+
# MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading
14+
MD002:
15+
# Heading level
16+
level: 1
17+
18+
# MD003/heading-style/header-style - Heading style
19+
MD003:
20+
# Heading style
21+
style: "consistent"
22+
23+
# MD004/ul-style - Unordered list style
24+
MD004:
25+
# List style
26+
style: "consistent"
27+
28+
# MD005/list-indent - Inconsistent indentation for list items at the same level
29+
MD005: true
30+
31+
# MD006/ul-start-left - Consider starting bulleted lists at the beginning of the line
32+
MD006: true
33+
34+
# MD007/ul-indent - Unordered list indentation
35+
MD007:
36+
# Spaces for indent
37+
indent: 2
38+
# Whether to indent the first level of the list
39+
start_indented: false
40+
# Spaces for first level indent (when start_indented is set)
41+
start_indent: 2
42+
43+
# MD009/no-trailing-spaces - Trailing spaces
44+
MD009:
45+
# Spaces for line break
46+
# br_spaces: 2
47+
# Allow spaces for empty lines in list items
48+
list_item_empty_lines: false
49+
# Include unnecessary breaks
50+
strict: false
51+
52+
# MD010/no-hard-tabs - Hard tabs
53+
MD010:
54+
# Include code blocks
55+
code_blocks: true
56+
# Fenced code languages to ignore
57+
ignore_code_languages: []
58+
# Number of spaces for each hard tab
59+
spaces_per_tab: 1
60+
61+
# MD011/no-reversed-links - Reversed link syntax
62+
MD011: true
63+
64+
# MD012/no-multiple-blanks - Multiple consecutive blank lines
65+
MD012:
66+
# Consecutive blank lines
67+
maximum: 2
68+
69+
# MD013/line-length - Line length
70+
MD013:
71+
# Number of characters
72+
line_length: 420
73+
# Number of characters for headings
74+
heading_line_length: 60
75+
# Number of characters for code blocks
76+
code_block_line_length: 180
77+
# Include code blocks
78+
code_blocks: false
79+
# Include tables
80+
tables: false
81+
# Include headings
82+
headings: true
83+
# Include headings
84+
headers: true
85+
# Strict length checking
86+
strict: false
87+
# Stern length checking
88+
stern: false
89+
90+
# MD014/commands-show-output - Dollar signs used before commands without showing output
91+
MD014: true
92+
93+
# MD018/no-missing-space-atx - No space after hash on atx style heading
94+
MD018: true
95+
96+
# MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading
97+
MD019: true
98+
99+
# MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style heading
100+
MD020: true
101+
102+
# MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading
103+
MD021: true
104+
105+
# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines
106+
MD022:
107+
# Blank lines above heading
108+
lines_above: 1
109+
# Blank lines below heading
110+
lines_below: 1
111+
112+
# MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line
113+
MD023: true
114+
115+
# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
116+
MD024:
117+
# Only check sibling headings
118+
allow_different_nesting: false
119+
# Only check sibling headings
120+
siblings_only: false
121+
122+
# MD025/single-title/single-h1 - Multiple top-level headings in the same document
123+
MD025:
124+
# Heading level
125+
level: 1
126+
# RegExp for matching title in front matter
127+
front_matter_title: "^\\s*title\\s*[:=]"
128+
129+
# MD026/no-trailing-punctuation - Trailing punctuation in heading
130+
MD026:
131+
# Punctuation characters not allowed at end of headings
132+
punctuation: ".,;:!。,;:!"
133+
134+
# MD027/no-multiple-space-blockquote - Multiple spaces after blockquote symbol
135+
MD027: true
136+
137+
# MD028/no-blanks-blockquote - Blank line inside blockquote
138+
MD028: true
139+
140+
# MD029/ol-prefix - Ordered list item prefix
141+
MD029:
142+
# List style
143+
style: "one_or_ordered"
144+
145+
# MD030/list-marker-space - Spaces after list markers
146+
MD030:
147+
# Spaces for single-line unordered list items
148+
ul_single: 1
149+
# Spaces for single-line ordered list items
150+
ol_single: 1
151+
# Spaces for multi-line unordered list items
152+
ul_multi: 1
153+
# Spaces for multi-line ordered list items
154+
ol_multi: 1
155+
156+
# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines
157+
MD031:
158+
# Include list items
159+
list_items: true
160+
161+
# MD032/blanks-around-lists - Lists should be surrounded by blank lines
162+
MD032: true
163+
164+
# MD033/no-inline-html - Inline HTML
165+
MD033:
166+
# Allowed elements
167+
allowed_elements: [ "a", "div", "iframe", "img", "p" ]
168+
169+
# MD034/no-bare-urls - Bare URL used
170+
MD034: true
171+
172+
# MD035/hr-style - Horizontal rule style
173+
MD035:
174+
# Horizontal rule style
175+
style: "consistent"
176+
177+
# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading
178+
MD036:
179+
# Punctuation characters
180+
punctuation: ".,;:!?。,;:!?"
181+
182+
# MD037/no-space-in-emphasis - Spaces inside emphasis markers
183+
MD037: true
184+
185+
# MD038/no-space-in-code - Spaces inside code span elements
186+
MD038: false
187+
188+
# MD039/no-space-in-links - Spaces inside link text
189+
MD039: true
190+
191+
# MD040/fenced-code-language - Fenced code blocks should have a language specified
192+
MD040:
193+
# List of languages
194+
allowed_languages: []
195+
# Require language only
196+
language_only: false
197+
198+
# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
199+
MD041:
200+
# Heading level
201+
level: 1
202+
# RegExp for matching title in front matter
203+
front_matter_title: "^\\s*title\\s*[:=]"
204+
205+
# MD042/no-empty-links - No empty links
206+
MD042: true
207+
208+
# MD043/required-headings/required-headers - Required heading structure
209+
MD043: false
210+
# List of headings
211+
# headings: []
212+
# List of headings
213+
# headers: []
214+
# Match case of headings
215+
# match_case: false
216+
217+
# MD044/proper-names - Proper names should have the correct capitalization
218+
MD044:
219+
# List of proper names
220+
names: []
221+
# Include code blocks
222+
code_blocks: true
223+
# Include HTML elements
224+
html_elements: true
225+
226+
# MD045/no-alt-text - Images should have alternate text (alt text)
227+
MD045: true
228+
229+
# MD046/code-block-style - Code block style
230+
MD046: false
231+
# Block style
232+
# style: "consistent"
233+
234+
# MD047/single-trailing-newline - Files should end with a single newline character
235+
MD047: true
236+
237+
# MD048/code-fence-style - Code fence style
238+
MD048:
239+
# Code fence style
240+
style: "consistent"
241+
242+
# MD049/emphasis-style - Emphasis style should be consistent
243+
MD049:
244+
# Emphasis style should be consistent
245+
style: "consistent"
246+
247+
# MD050/strong-style - Strong style should be consistent
248+
MD050:
249+
# Strong style should be consistent
250+
style: "consistent"
251+
252+
# MD051/link-fragments - Link fragments should be valid
253+
MD051: true
254+
255+
# MD052/reference-links-images - Reference links and images should use a label that is defined
256+
MD052: true
257+
258+
# MD053/link-image-reference-definitions - Link and image reference definitions should be needed
259+
MD053:
260+
# Ignored definitions
261+
ignored_definitions:
262+
- "//"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Added
44
- git: remove neogit SPC gn key binding (defined in `mappings.lua`)
5+
- null-ls: use central markdownlint rules file in astronvim-config directory
56

67
# 2023-07-12
78

plugins/null-ls.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ return {
1414

1515
null_ls.builtins.formatting.markdownlint.with {
1616
-- pass arguments to modify/override the null-ls builtin configuration
17-
args = {
17+
extra_args = {
1818
"--config ",
19-
"/home/practicalli/.markdownlint.yaml",
19+
"~/.config/astro-config/tool-config/markdownlint.yaml",
2020
},
2121
},
2222
}

0 commit comments

Comments
 (0)