Changes
Page history
show how to lint locally
authored
Feb 18, 2021
by
anarcat
Show whitespace changes
Inline
Side-by-side
service/documentation.md
View page @
0d2bb561
...
@@ -39,6 +39,42 @@ To make changes there, just clone and push to this git repository:
...
@@ -39,6 +39,42 @@ To make changes there, just clone and push to this git repository:
git clone git@gitlab.torproject.org:tpo/tpa/wiki-replica.git
git clone git@gitlab.torproject.org:tpo/tpa/wiki-replica.git
Ideally, you should also setup linting locally, see below.
## Local linting configuration
While the wiki replica has continuous integration checks, it might be
good to run those locally, to make sure you don't add any new warnings
when making changes.
We currently only lint Markdown syntax, with
[
markdownlint
](
https://github.com/markdownlint/markdownlint
)
. You
can install it using the upstream instructions, but anarcat prefers to
run it under Docker, with a wrapper script like:
#!/bin/sh
exec docker run --volume "$PWD:/data/" --rm -i markdownlint/markdownlint "$@"
Drop this somewhere in your path as
`mdl`
and it will behave just as
if it was installed locally.
Then you should drop this in
`.git/hooks/pre-commit`
(if you want to
enforce checks):
```
#!/bin/bash
${
GIT_DIR
:-
.git
}
/../bin/mdl-wrapper
$(
git diff
--cached
--name-only
HEAD
)
```
... or
`.git/hooks/post-commit`
(if you just want warnings):
```
#!/bin/sh
${
GIT_DIR
:-
.git
}
/../bin/mdl-wrapper
$(
git diff-tree
--no-commit-id
--name-only
-r
HEAD
)
```
## Pager playbook
## Pager playbook
### Wiki unavailable
### Wiki unavailable
...
...
...
...