Skip to content

Commit 62cec23

Browse files
authored
Merge pull request #8 from jgaffiot/markdownlint
Add markdownlint to pre-commit
2 parents ef79c94 + ae509ba commit 62cec23

File tree

3 files changed

+47
-8
lines changed

3 files changed

+47
-8
lines changed

.markdownlint.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
default: true
3+
# MD007/ul-indent - Unordered list indentation
4+
MD007:
5+
# Spaces for indent
6+
indent: 4
7+
# MD013/line-length - Line length
8+
MD013:
9+
# Number of characters
10+
line_length: 88
11+
# Number of characters for headings
12+
heading_line_length: 88
13+
# Number of characters for code blocks
14+
code_block_line_length: 88

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,22 @@ repos:
5757
entry: make -j all
5858
files: Makefile
5959

60+
# Markdown
61+
- repo: https://github.com/igorshubovych/markdownlint-cli
62+
rev: v0.27.1
63+
hooks:
64+
- id: markdownlint
65+
types: [markdown]
66+
67+
# YAML
6068
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
6169
rev: 0.1.0
6270
hooks:
6371
- id: yamlfmt
6472
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '150']
6573
types: [yaml]
6674

75+
# All files + miscellanous
6776
- repo: https://github.com/pre-commit/pre-commit-hooks
6877
rev: v4.0.1
6978
hooks:

README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
# Tools
2+
13
<!-- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) -->
24
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
35

4-
# Tools
56
Yet another small C++ generic library, extending the standard library for ease
67
of use.
78

89
## Content
10+
911
- DataBase: a singleton used to parse specifically formatted files and present
1012
the content as key/values.
1113
Written before I heard of YAML... so considered as deprecated.
@@ -29,7 +31,9 @@ of use.
2931
- Vector3: yet another implementation of the 3-dimensional mathematical vector.
3032

3133
## Build
34+
3235
### Layout
36+
3337
The library is built with `cmake` and has been tested with `g++` and `clang`.
3438

3539
The build layout is included in the repository, with the `source`, `build` and
@@ -45,6 +49,7 @@ at the compilation if the optional prerequisites are installed and the Python
4549
virtual environment activated (with `poetry shell`).
4650

4751
### Prerequisites
52+
4853
Required:
4954

5055
- `make`
@@ -61,6 +66,7 @@ Optional:
6166
then run `poetry install` to install the optional Python packages
6267

6368
### Option
69+
6470
A Makefile is provided at the root to run `cmake` then `make` in a single step,
6571
with the following options:
6672

@@ -77,7 +83,9 @@ with the following options:
7783
- `clean_lib_bin`: remove the `install` directory
7884

7985
## Contribute
86+
8087
### Tooling set
88+
8189
A set of formatters and static analysis tools is used to guarantee the homogeneity
8290
of the code and catch mistakes:
8391

@@ -102,17 +110,18 @@ An other solution is to use `poetry run git commit ...` (for configuration of an
102110
for instance.
103111

104112
### Tooling installation
113+
105114
- `pre-commit`, as a Python tool, can be installed with:
106115

107-
+ `pipx`
116+
- `pipx` (preferred)
108117

109118
pipx install pre-commit
110119

111-
+ `pip` (or `pip3` on Debian-like distribution)
120+
- `pip` (or `pip3` on Debian-like distribution)
112121

113122
pip install -U pre-commit
114123

115-
+ `snap` (system-wide)
124+
- `snap` (system-wide)
116125

117126
sudo snap install pre-commit
118127

@@ -125,12 +134,16 @@ for instance.
125134
[documentation](https://python-poetry.org/docs/#installation), it is best
126135
installed with its own installer:
127136

128-
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
137+
curl -sSL \
138+
https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py \
139+
| python -
129140

130141
or on Debian-like distribution (using `python3` instead of `python` which is
131142
`python2`):
132143

133-
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
144+
curl -sSL \
145+
https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py \
146+
| python3 -
134147

135148
Once `poetry` is installed, run `poetry install --dev` to install all the project
136149
packages and the development tooling.
@@ -158,7 +171,8 @@ for instance.
158171
On Debian-like distribution, use:
159172

160173
sudo apt install clang-format-11
161-
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-11 50
174+
sudo update-alternatives --install /usr/bin/clang-format clang-format \
175+
/usr/bin/clang-format-11 50
162176

163177
- `cpplint`, a Python tool, is either installed through `poetry`, either installed
164178
at a higher level with `pip`, `pipx` or a package manager.
@@ -169,7 +183,9 @@ All together, on Ubuntu 20.04 or higher, run:
169183
libclang-11-dev python3 python3-pip
170184
sudo apt remove --purge python3-virtualenv virtualenv
171185
pip3 install virtualenv pre-commit
172-
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
186+
curl -sSL \
187+
https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py \
188+
| python3 -
173189
# cd path/to/repository/
174190
poetry install --dev
175191
poetry shell

0 commit comments

Comments
 (0)