Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: add marklint check for changed files in PR #1406

Merged
merged 4 commits into from
Aug 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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