Skip to content

Commit 88c2b6e

Browse files
Remove pre-commit in Dev Container and fix a format script (#557)
1 parent ce27cbf commit 88c2b6e

File tree

5 files changed

+6
-16
lines changed

5 files changed

+6
-16
lines changed

.devcontainer/boot.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@
55
make
66
make install
77

8-
# Set up pre-commit hook
9-
cp .devcontainer/term_settings/pre-commit .git/hooks/pre-commit
10-
118
# Set up ~/.bashrc
129
cat .devcontainer/term_settings/extra_bashrc.sh >> ~/.bashrc

.devcontainer/term_settings/pre-commit

Lines changed: 0 additions & 4 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Although any topics related to opensource COBOL 4J can be posted in [Issues](htt
1010
We will check pull requests that passed all CI checks running both tests and static code analysis.
1111
The static analysis checks whether C and Java source files are formatted using [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and [google-java-format](https://github.com/google/google-java-format) respectively, and whether [PMD](https://pmd.github.io/) finds no error and warning in Java source files.
1212

13+
Before you submit pull requests, you should run `./format` in order to format files in this repository.
14+
1315
The below sections describe how to setup and run static code analysis.
1416

1517
## Setup Development Environment
@@ -26,13 +28,10 @@ We strongly recommend using [Visual Studio Code with Dev Containers](https://cod
2628
1. (Optional) Press `Ctrl+Shift+@` to open a new terminal of Visual Studio code.
2729
1. (Optional) [Setup credentials for git](https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials).
2830

29-
> [!CAUTION]
30-
> In the dev container, [Git Hooks](https://git-scm.com/book/ms/v2/Customizing-Git-Git-Hooks) executes code formatters when starting `git commit` command. It may take a minutes when you run `git commit` for the first time.
31-
3231
## Run static analysis
3332

3433
> [!CAUTION]
35-
> CI executes formatters and static analysis tools in Almalinux 9. The behavior of these tools may differ from the one in other operatins systems.
34+
> Since the behavior of these tools may differ from the one in other operatins systems, we recommend that you run `./format` in Visual Studio Code with Dev Containers described in the previous section.
3635
3736
### check with clang-format and google-java-format
3837

CONTRIBUTING_JP.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ CIはテストとコードの静的解析を実行します。
1010
CIの静的解析はCとJavaのソースコードがそれぞれ[clang-format](https://clang.llvm.org/docs/ClangFormat.html) and [google-java-format](https://github.com/google/google-java-format)で整形されているか、
1111
[PMD](https://pmd.github.io/)によるJavaソースコードの静的解析でエラーや警告が表示されないかをチェックします。
1212

13+
Pull Request提出時には、./formatを実行してリポジトリ内のコードをフォーマットしてください。
14+
1315
下記にそれぞれのツールのセットアップと使用方法を説明します。
1416

1517
## 開発環境のセットアップ
@@ -26,14 +28,11 @@ CIの静的解析はCとJavaのソースコードがそれぞれ[clang-format](h
2628
1. (オプション)`Ctrl+Shift+@`を押して、Visual Studio Codeの新しいターミナルを開きます。
2729
1. (オプション)[gitの認証情報を設定](https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials)します。
2830

29-
> [!CAUTION]
30-
> Dev container内では、[Git Hooks](https://git-scm.com/book/ms/v2/Customizing-Git-Git-Hooks)`git commit`コマンドを開始する際にコードフォーマッタを実行します。初めて`git commit`を実行する際には数分かかることがあります。
31-
3231

3332
## 静的解析の実行
3433

3534
> [!CAUTION]
36-
> CIはAlmalinux 9でフォーマッタと静的解析ツールを実行します。これらのツールの動作は他のオペレーティングシステムとは異なる場合があります。
35+
> これらのツールの動作は他のオペレーティングシステムとは異なる場合があります。上記のVisual Studio Code with Dev Containersの環境でフォーマッタを実行することを推奨します
3736
3837
### clang-formatとgoogle-java-format
3938

cobj/format

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ codegen.c \
77
config.c \
88
error.c \
99
field.c \
10-
pplex.c \
1110
ppparse.c \
1211
ppparse.h \
1312
reserved.c \

0 commit comments

Comments
 (0)