Skip to content

Commit b6a98a3

Browse files
authored
chore: md lint pre commit (#432)
1 parent 9a943f2 commit b6a98a3

File tree

5 files changed

+471
-122
lines changed

5 files changed

+471
-122
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
### Description
1+
# Description
22

33
<!--- Add a little description on what you plan to tackle with this PR -->
44
<!--- Add resolve #issue-number in case you resolve an open issue -->
55

66
## Models used to test - Optional
77
<!--- Add here the models that you use to test the changes -->
88

9-
109
## Checklist
10+
1111
- [ ] You followed [contributing section](https://github.com/dbt-athena/dbt-athena#contributing)
1212
- [ ] You kept your Pull Request small and focused on a single feature or bug fix.
1313
- [ ] You added unit testing when necessary

.markdownlint.yaml

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

.pre-commit-config.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,10 @@ repos:
7373
additional_dependencies:
7474
- types-setuptools==67.8.0.0
7575
exclude: ^tests/
76+
77+
- repo: https://github.com/igorshubovych/markdownlint-cli
78+
rev: v0.37.0
79+
hooks:
80+
- id: markdownlint
81+
args:
82+
- --fix

CONTRIBUTING.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
# Contributing
22

33
## Requirements
4+
45
* Python from 3.7 to 3.11
56
* Virtual Environment or any other Python environment manager
67

7-
88
## Getting started
99

1010
* Clone of fork the repo
1111
* Run `make setup`, it will:
12-
1. Install all dependencies
13-
2. Install pre-commit hooks
14-
3. Generate your `.env` file
12+
1. Install all dependencies
13+
2. Install pre-commit hooks
14+
3. Generate your `.env` file
1515

1616
* Adjust `.env` file by configuring the environment variables to match your Athena development environment.
1717

1818
## Running tests
1919

2020
We have 2 different types of testing:
21+
2122
* **unit testing**: you can run this type of tests running `make unit_test`
22-
* **functional testing**: you must have an AWS account with Athena setup in order to launch this type of tests and have a `.env` file in place with the right values.
23+
* **functional testing**: you must have an AWS account with Athena setup in order to launch this type of tests and have
24+
a `.env` file in place with the right values.
2325
You can run this type of tests running `make functional_test`
2426

2527
All type of tests can be run using `make`:
28+
2629
```bash
2730
make test
2831
```
@@ -31,17 +34,19 @@ make test
3134

3235
* Create a commit with your changes and push them to a
3336
[fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo).
34-
* Create a [pull request on
35-
Github](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).
37+
<!-- markdownlint-disable-next-line MD013 -->
38+
* Create a [pull request on Github](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).
3639
* Pull request title and message (and PR title and description) must adhere to
37-
[conventionalcommits](https://www.conventionalcommits.org).
40+
[conventional commits](https://www.conventionalcommits.org).
3841
* Pull request body should describe _motivation_.
42+
<!-- markdownlint-restore -->
3943

4044
### General Guidelines
4145

4246
* Keep your Pull Request small and focused on a single feature or bug fix.
4347
* Make sure your code is well tested.
4448
* Make sure your code is well documented.
4549
* Provide a clear description of your Pull Request to allow the reviewer to understand the context of your changes.
46-
* Consider the usage of draft Pull Request and switch to ready for review only when the CI pass or is ready for feedback.
50+
* Consider the usage of draft Pull Request and switch to ready for review only when the CI pass or is ready for
51+
feedback.
4752
* Be sure to have pre-commit installed or run `make pre-commit` before pushing your changes.

0 commit comments

Comments
 (0)