From af8d7a01ec90ff3d91d1e67b856b8da4849516f6 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Thu, 5 May 2022 14:05:33 +0800 Subject: [PATCH] [format] added yapf pre-commit hook (#103) --- .gitignore | 2 +- .pre-commit-config.yaml | 10 ++++++++++ .style.yapf | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml create mode 100644 .style.yapf diff --git a/.gitignore b/.gitignore index 9497516..9db52f9 100644 --- a/.gitignore +++ b/.gitignore @@ -151,4 +151,4 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ .vscode/ - +data/ \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ce9887c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/pre-commit/mirrors-yapf + rev: v0.32.0 + hooks: + - id: yapf + args: ['--style=.style.yapf', '--parallel', '--in-place'] + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v13.0.1 + hooks: + - id: clang-format diff --git a/.style.yapf b/.style.yapf new file mode 100644 index 0000000..05be0dc --- /dev/null +++ b/.style.yapf @@ -0,0 +1,5 @@ +[style] +based_on_style = google +spaces_before_comment = 4 +split_before_logical_operator = true +column_limit = 120