Skip to content

Commit

Permalink
*: add marklint check for changed files in PR (#1406)
Browse files Browse the repository at this point in the history
* *: Add marklint check for docs

Signed-off-by: Aylei <rayingecho@gmail.com>

* Trigger check

Signed-off-by: Aylei <rayingecho@gmail.com>

* add the rule number for each lint rule
  • Loading branch information
aylei authored and yikeke committed Aug 5, 2019
1 parent f410df4 commit 8ccd684
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 4 deletions.
44 changes: 40 additions & 4 deletions circle.yml → .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
version: 2

jobs:
lint:
docker:
- image: circleci/ruby:2.4.1-node
working_directory: ~/pingcap/docs
steps:
- checkout

- run:
name: "Install markdownlint"
command: |
sudo npm install -g markdownlint-cli
markdownlint --version
- run:
name: "Lint README"
command: markdownlint README.md

- run:
name: "Lint edited files"
command: |
git remote add upstream https://github.com/pingcap/docs.git
git fetch upstream
markdownlint $(git diff-tree --name-only --no-commit-id -r upstream/master..HEAD -- '*.md' ':(exclude).github/*' ':(exclude)v1.0/*' ':(exclude)v2.0/*' ':(exclude)v2.1-legacy/*')
build:
docker:
- image: andelf/doc-build:0.1.9
working_directory: ~/pingcap/docs
branches:
only:
- master
- website-preview

steps:
- checkout

Expand Down Expand Up @@ -46,3 +68,17 @@ jobs:

- store_artifacts:
path: /tmp/artifacts

workflows:
version: 2
lint:
jobs:
- lint
build:
jobs:
- build:
filters:
branches:
only:
- master
- website-preview
97 changes: 97 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
comment: 'Rules for PingCAP docs'

# disable all by default
default: false

# MD001
heading-increment: true

# MD003
heading-style:
style: atx

# MD009
no-trailing-spaces: true

# MD010
no-hard-tabs: true

# MD007
ul-indent:
indent: 4

# MD012
no-multiple-blanks: true

# commands-show-output: true

# MD018
no-missing-space-atx: true

# MD019
no-multiple-space-atx: true

# MD022
blanks-around-headings: true

# MD023
heading-start-left: true

# MD024
no-duplicate-heading:
siblings_only: true

# MD025
single-title:
front_matter_title: ''

# MD026
no-trailing-punctuation:
punctuation: '.,;:!。,;:!'

# MD027
no-multiple-space-blockquote: true

# MD029
ol-prefix:
style: ordered

# MD030
list-marker-space: true

# MD031
blanks-around-fences: true

# MD032
blanks-around-lists: true

# MD034
no-bare-urls: true

# MD037
no-space-in-emphasis: true

# MD038
no-space-in-code: true

# MD039
no-space-in-links: true

# MD042
no-empty-links: true

# proper-names:
# names: ['TiDB', 'TiKV', 'PingCAP']
# code_blocks: false

# MD045
no-alt-text: true

# MD046
code-block-style:
style: fenced

# single-trailing-newline: true

# MD041
first-line-heading: true

0 comments on commit 8ccd684

Please sign in to comment.