Skip to content

Commit

Permalink
Add hooks for goreleaser and sorting the spelling file
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Gilmer committed Jun 23, 2020
1 parent 21d4054 commit c346c03
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .markdownlintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"default": true,
"first-header-h1": false,
"first-line-h1": false,
"line_length": false,
"no-multiple-blanks": false
"MD024": {
"siblings_only": true
},
"MD014": false,
"MD033": false,
"MD040": false,
"MD046": false
}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
repos:

- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
rev: v3.1.0
hooks:
- id: check-json
- id: check-yaml
- id: trailing-whitespace

- repo: git://github.com/igorshubovych/markdownlint-cli
rev: v0.17.0
rev: v0.23.1
hooks:
- id: markdownlint
entry: markdownlint --ignore .github/*.md

- repo: git://github.com/trussworks/pre-commit-hooks
rev: v0.0.1
rev: v0.0.3
hooks:
- id: markdown-toc
- id: mdspell
15 changes: 15 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
types: ["file", "markdown"]
pass_filenames: false

- id: goreleaser-check
name: Validate goreleaser config yaml
description: Validate goreleaser config yaml
entry: goreleaser check
language: system
files: '.goreleaser.yml'
pass_filenames: false

- id: markdown-toc
name: Generate a Table of Contents in Markdown files
description: Generate a Table of Contents in Markdown files
Expand All @@ -31,3 +39,10 @@
args: ["--ignore-numbers", "--ignore-acronyms", "--en-us", "-r"]
additional_dependencies: ["markdown-spellcheck"]
types: ["file", "markdown"]

- id: spelling-sort
name: Sort spelling doc
description: Sort mdspell spelling file
entry: /usr/bin/sort -u -o .spelling .spelling
language: script
pass_filenames: false
2 changes: 2 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ CircleCI
adr-log
circleci-validate
config
goreleaser
goreleaser-check
markdown-toc
mdspell
pre-commit
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

* [circleci-validate](#circleci-validate)
* [gen-docs](#gen-docs)
* [goreleaser-check](#goreleaser-check)
* [markdown-toc](#markdown-toc)
* [mdspell](#mdspell)
* [spelling-sort](#spelling-sort)

Regenerate with "pre-commit run -a markdown-toc"

Expand All @@ -31,6 +33,15 @@ per the docs on that module.
By default it will only look in the `docs/` directory of your repo. You can pass in different directories by using
the `args` parameter like this: `args: ["docs/adr", "docs/rfc"]`

## goreleaser-check

Validate goreleaser config yaml located at `.goreleaser.yml`. In order for this to run you will need to install
the `goreleaser` CLI tool locally with:

```sh
brew install goreleaser
```

## markdown-toc

Generate a Table of Contents using [markdown-toc](https://www.npmjs.com/package/markdown-toc). It will modify files
Expand All @@ -40,3 +51,7 @@ with comments in it per the docs on that module.

Run spellcheck on markdown files using [markdown-spellcheck](https://www.npmjs.com/package/markdown-spellcheck). It
will ignore words listed in a `.spelling` file in your repo.

## spelling-sort

Run `sort` on the `.spelling` file used by the `markdown-spellcheck` tool. This keeps the file tidy as it is used.

0 comments on commit c346c03

Please sign in to comment.