Skip to content

Commit b80aceb

Browse files
committed
fix make enable-git-hooks failed
1 parent a34f415 commit b80aceb

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎GNUmakefile.in‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ headerscheck: submake-generated-headers
158158
cpluspluscheck: submake-generated-headers
159159
$(top_srcdir)/src/tools/pginclude/headerscheck --cplusplus $(top_srcdir) $(abs_top_builddir)
160160

161+
# ivorysql code format
162+
code-format: submake-generated-headers
163+
@bash tools/enable-git-hooks.sh
164+
161165
#.PHONY: dist distdir distcheck docs install-docs world check-world install-world installcheck-world headerscheck cpluspluscheck
162166

163-
.PHONY: dist distcheck docs install-docs world check-world install-world installcheck-world headerscheck cpluspluscheck oracle-pg-check-world oracle-check-world oracle-installcheck-world all-check all-check-world all-installcheck-world
167+
.PHONY: dist distcheck docs install-docs world check-world install-world installcheck-world headerscheck cpluspluscheck oracle-pg-check-world oracle-check-world oracle-installcheck-world all-check all-check-world all-installcheck-world code-format
164168

‎Makefile‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,3 @@ all check oracle-check all-check install installdirs installcheck oracle-install
4444
false; \
4545
fi
4646

47-
48-
.PHONY: enable-git-hooks
49-
enable-git-hooks:
50-
@bash tools/enable-git-hooks.sh

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Furthermore, for more detailed installation instructions, please refer to the [I
3232
- [Source code installation](https://docs.ivorysql.org/en/ivorysql-doc/v4.5/v4.5/6#Source-code-installation)
3333

3434
## Developer Formatting hooks and CI:
35-
- A pre-commit formatting hook is provided at `.githooks/pre-commit`. Enable it with `git config core.hooksPath .githooks`, or run `make enable-git-hooks` (equivalently `bash tools/enable-git-hooks.sh`).
35+
- A pre-commit formatting hook is provided at `.githooks/pre-commit`. Enable it with `git config core.hooksPath .githooks`, or run `make code-format` (equivalently `bash tools/enable-git-hooks.sh`).
3636
- The hook depends only on in-tree tools `src/tools/pgindent` and `src/tools/pg_bsd_indent`. On commit it formats staged C/C++ files with pgindent and re-adds them to the staged area.
3737
- A Cirrus workflow `FormatCheck` runs `pgindent --check` on files changed in a PR.
3838

‎README_CN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ IvorySQL 项目采用 Apache 2.0 许可协议发布,并鼓励各种形式的
1818

1919
## 开发者代码格式化
2020
- 提交前自动格式化(推荐):
21-
- 已克隆仓库:在仓库根目录执行 `make enable-git-hooks`(或 `bash tools/enable-git-hooks.sh`)
21+
- 已克隆仓库:在仓库根目录执行 `make code-format`(或 `bash tools/enable-git-hooks.sh`)
2222
- 提交时行为:Git 钩子会自动用 `pgindent` 格式化已暂存的 C/C++ 文件并回加到暂存区,未通过二次校验会阻止提交。
2323
- PR 阶段:Cirrus 将运行 `FormatCheck`(pgindent --check)对差异文件做只读校验。
2424

0 commit comments

Comments
 (0)