Skip to content

Commit

Permalink
publish lite (PaddlePaddle#1800)
Browse files Browse the repository at this point in the history
  • Loading branch information
Superjomn committed Aug 16, 2019
1 parent 0ca102d commit 699d6cd
Show file tree
Hide file tree
Showing 2,158 changed files with 187,047 additions and 362 deletions.
24 changes: 23 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# This file is used by clang-format to autoformat paddle source code
#
# The clang-format is part of llvm toolchain.
# It need to install llvm and clang to format source code style.
#
# The basic usage is,
# clang-format -i -style=file PATH/TO/SOURCE/CODE
#
# The -style=file implicit use ".clang-format" file located in one of
# parent directory.
# The -i means inplace change.
#
# The document of clang-format is
# http://clang.llvm.org/docs/ClangFormat.html
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
BasedOnStyle: Google
BasedOnStyle: Google
IndentWidth: 2
TabWidth: 2
ContinuationIndentWidth: 4
AccessModifierOffset: -1 # The private/protected/public has no indent in class
Standard: Cpp11
AllowAllParametersOfDeclarationOnNextLine: true
BinPackParameters: false
BinPackArguments: false
...
66 changes: 29 additions & 37 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,50 @@ repos:
sha: v1.0.1
hooks:
- id: remove-crlf
files: (src/).*\.(md|py|mm|swift|java|c|cc|cxx|cpp|cu|h|hpp|hxx)$
- id: remove-tabs
files: (test/|src/).*\.(md|py|mm|swift|java|c|cc|cxx|cpp|cu|h|hpp|hxx)$

files: (?!.*third_party)^.*$ | (?!.*book)^.*$ ^mobile/ ^metal/ ^web/
#- repo: https://github.com/PaddlePaddle/mirrors-yapf.git
#sha: 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
#hooks:
#- id: yapf
#files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: 5bf6c09bfa1297d3692cadd621ef95f1284e33c0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
files: (?!.*tar.gz)^.*$
files: (?!.*third_party)^.*$ | (?!.*book)^.*$
- id: end-of-file-fixer
files: (test/|src/).*\.(md|py|mm|swift|java|c|cc|cxx|cpp|h|hpp|hxx)$
- id: trailing-whitespace
files: (test/|src/).*\.(md|py|mm|swift|java|c|cc|cxx|cpp|h|hpp|hxx)$

- repo: local
hooks:
- id: copyright
name: copyright
entry: python ./tools/pre-commit.hooks/copyright.hook
language: system
files: (test/|src/).*\.(c|cc|cxx|cpp|h|hpp|hxx|py)$
exclude: (?!.*third_party)^.*$ | (?!.*book)^.*$

- repo: local
hooks:
- id: clang-format
- id: clang-format-with-version-check
name: clang-format
description: Format files with ClangFormat.
entry: bash ./tools/pre-commit.hooks/clang-format.hook -i
entry: bash ./tools/codestyle/clang_format.hook -i
language: system
files: (test/|src/).*\.(c|cc|cxx|cpp|h|hpp|hxx)$

files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto)$ ^mobile/ ^metal/ ^web/
- repo: local
hooks:
- id: cpplint
- id: cpplint-cpp-source
name: cpplint
description: Check C++ code style using cpplint.
entry: bash ./tools/pre-commit.hooks/cpplint.hook
description: Check C++ code style using cpplint.py.
entry: bash ./tools/codestyle/cpplint_pre_commit.hook
language: system
files: (test/|src/).*\.(c|cc|cxx|cpp|h|hpp|hxx)$
exclude: (?!.*third_party)^.*$ | (?!.*book)^.*$i | *\.pb\.cpp


#
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx)$ ^mobile/ ^metal/ ^web/
#- repo: local
# hooks:
# - id: clang-tidy
# name: clang-tidy
# description: Check C++ code style using clang-tidy.
# entry: bash ./tools/pre-commit.hooks/.clang-tidy.hook -i
# language: system
# files: (src).*\.(c|cc|cxx|cpp|h|hpp|hxx)$
#hooks:
#- id: pylint-doc-string
#name: pylint
#description: Check python docstring style using docstring_checker.
#entry: bash ./tools/codestyle/pylint_pre_commit.hook
#language: system
#files: \.(py)$
- repo: local
hooks:
- id: copyright_checker
name: copyright_checker
entry: python ./tools/codestyle/copyright.hook
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$ ^mobile/ ^metal/ ^web/
exclude: (?!.*third_party)^.*$ | (?!.*book)^.*$
Loading

0 comments on commit 699d6cd

Please sign in to comment.