Skip to content

Commit

Permalink
Add markdownlint in pre-commit (sql-machine-learning#2028)
Browse files Browse the repository at this point in the history
* Add markdownlint in pre-commit

* List markdown files in pre-commit.sh

* List all the markdown files to run the markdownlint check

* Temp update on cli.md

* Try pre-commit with from-ref and to-ref

* Trial: run pre-commit only on changed files

* Print CHANGED_FILES for debugging.

* DEBUG CI: Check git branch on Travis VM

* Revert pre-commit.sh to the initial version

* Run pre-commit for the difference between develop branch and the current PR branch.

* Remove the git command for printing branch
  • Loading branch information
brightcoder01 authored Jun 17, 2020
1 parent d1db613 commit 658a79d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ repos:
rev: v1.23.0
hooks:
- id: yamllint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.23.1
hooks:
- id: markdownlint
name: markdownlint
description: "Checks the style of Markdown files."
entry: markdownlint
language: node
11 changes: 6 additions & 5 deletions docs/designs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ discusssing about this command-line client tool.
requirements.txt
```
2. Generate a Dockerfile.
1. Generate a Dockerfile.
Input the command:
Expand All @@ -47,19 +47,20 @@ discusssing about this command-line client tool.
Users can make additional updates on the Dockerfile if necessary.
3. Build the Docker image for an ElasticDL job.
1. Build the Docker image for an ElasticDL job.
```bash
elasticdl zoo build --image=reg.docker.alibaba-inc.com/bright/elasticdl-wnd:1.0 .
elasticdl zoo build
--image=reg.docker.alibaba-inc.com/bright/elasticdl-wnd:1.0 .
```
4. Push the Docker image to a remote registry (optional)
1. Push the Docker image to a remote registry (optional)
```bash
elasticdl zoo push reg.docker.alibaba-inc.com/bright/elasticdl-wnd:1.0
```
5. Submit a model training/prediction/evaluation job.
1. Submit a model training/prediction/evaluation job.
```bash
elasticdl train \
Expand Down
14 changes: 3 additions & 11 deletions scripts/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@



PYTHON_SOURCE_FILES=$(find elasticdl/python \
elasticdl_preprocessing \
model_zoo \
tools \
setup.py \
scripts \
-name '*.py' -print0 | tr '\0' ' ')

GO_SOURCE_FILES=$(find elasticdl/go/ -name '*.go' -print0 | tr '\0' ' ')

pre-commit run --files "$PYTHON_SOURCE_FILES $GO_SOURCE_FILES"
PROJECT_URL=https://github.com/sql-machine-learning/elasticdl.git
REMOTE=$(git remote -v | grep $PROJECT_URL | cut -f1 | head -1)
pre-commit run --from-ref "$REMOTE/develop" --to-ref HEAD

0 comments on commit 658a79d

Please sign in to comment.