diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..2e95e732c58ecdeb092d3cae16cece794ae1ff6d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +.git/ +.gitignore diff --git a/.gitignore b/.gitignore index 0a0dd02414c32ede8d58d2556709827f9a98bf5c..e7f8501f2c04d0ddb9a27202b3e91d33c47d9de8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ +deprecated +*~ pandoc.template -.DS_Store \ No newline at end of file +.DS_Store +.idea +py_env* +*.ipynb +build diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..dcf88e09e5b8ece0b6360d8ed5bab544e068b6cb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "paddle"] + path = paddle + url = https://github.com/PaddlePaddle/Paddle.git + branch = develop diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0d8234b69cb092a25eb884a754600168f9a67f75..e06e02f312e8c594a28249e7e9d32eb5a60bf7e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,42 @@ -- repo: https://github.com/Lucas-C/pre-commit-hooks.git - sha: c25201a00e6b0514370501050cf2a8538ac12270 +- repo: https://github.com/pre-commit/mirrors-yapf.git + sha: v0.16.0 hooks: - - id: remove-crlf -- repo: https://github.com/reyoung/mirrors-yapf.git - sha: v0.13.2 - hooks: - - id: yapf - files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$ # Bazel BUILD files follow Python syntax. + - id: yapf + files: \.py$ - repo: https://github.com/pre-commit/pre-commit-hooks - sha: 7539d8bd1a00a3c1bfd34cdb606d3a6372e83469 + sha: a11d9314b22d8f8c7556443875b731ef05965464 hooks: - id: check-merge-conflict - id: check-symlinks - id: detect-private-key + files: (?!.*paddle)^.*$ - id: end-of-file-fixer + files: \.md$ + - id: trailing-whitespace + files: \.md$ +- repo: https://github.com/Lucas-C/pre-commit-hooks + sha: v1.0.1 + hooks: + - id: forbid-crlf + files: \.md$ + - id: remove-crlf + files: \.md$ + - id: forbid-tabs + files: \.md$ + - id: remove-tabs + files: \.md$ +- repo: https://github.com/reyoung/pre-commit-hooks-jinja-compile.git + sha: 4a369cc72a4a2b8d3813ab8cc17abb5f5b21ef6c + hooks: + - id: convert-jinja2-into-html + # The argument means repleace filename from pattern `.*/([^/]*)\.tmpl` to `\1` + args: ['--filename_pattern=.*/([^/]*)\.tmpl', '--filename_repl=\1'] +- repo: local + hooks: + - id: convert-markdown-into-html + name: convert-markdown-into-html + description: Convert README.md into index.html and README.cn.md into index.cn.html + entry: python .pre-commit-hooks/convert_markdown_into_html.py + language: system + files: .+README(\.cn)?\.md$ + diff --git a/.tmpl/convert-markdown-into-html.sh b/.pre-commit-hooks/convert_markdown_into_html.py old mode 100755 new mode 100644 similarity index 61% rename from .tmpl/convert-markdown-into-html.sh rename to .pre-commit-hooks/convert_markdown_into_html.py index 149c686bc502b7fed97453e0769a7ef6ee841b76..66f44ef23c5d9a82436dfbe4b6bcdfc4e69ab55a --- a/.tmpl/convert-markdown-into-html.sh +++ b/.pre-commit-hooks/convert_markdown_into_html.py @@ -1,8 +1,8 @@ -markdown_file=$1 +import argparse +import re +import sys -# Notice: the single-quotes around EOF below make outputs -# verbatium. c.f. http://stackoverflow.com/a/9870274/724872 -cat <<'EOF' +HEAD = """
- - + + + + +