Skip to content

Commit b29742f

Browse files
committed
Suggest changes instead of automatically fixing them
1 parent 521e5eb commit b29742f

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/format.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ jobs:
1111
format:
1212
runs-on: ubuntu-latest
1313
permissions:
14-
contents: write
14+
contents: read
15+
pull-requests: write
1516

1617
steps:
1718
- name: Checkout code
@@ -37,24 +38,36 @@ jobs:
3738
- name: Apply C++ formatting fixes
3839
run: find cpp2rust tests -name '*.cpp' -o -name '*.h' -o -name '*.c' | xargs clang-format -i
3940

41+
- name: Suggest C++ formatting fixes
42+
if: github.event_name == 'pull_request'
43+
uses: reviewdog/action-suggester@v1
44+
with:
45+
tool_name: clang-format
46+
4047
- name: Apply Rust lint fixes
4148
run: |
4249
cargo clippy --fix --allow-dirty --manifest-path rules/Cargo.toml --all-targets
4350
cargo +nightly clippy --fix --allow-dirty --manifest-path rule-preprocessor/Cargo.toml --all-targets
4451
cargo clippy --fix --allow-dirty --manifest-path libcc2rs/Cargo.toml --all-targets
4552
53+
- name: Suggest Rust lint fixes
54+
if: github.event_name == 'pull_request'
55+
uses: reviewdog/action-suggester@v1
56+
with:
57+
tool_name: clippy
58+
4659
- name: Apply Rust formatting fixes
4760
run: |
4861
cargo fmt --manifest-path rules/Cargo.toml
4962
cargo fmt --manifest-path rule-preprocessor/Cargo.toml
5063
cargo fmt --manifest-path libcc2rs/Cargo.toml
5164
find tests -name '*.rs' -print0 | xargs -0 rustfmt
5265
53-
- name: Commit auto-fixes
54-
if: github.ref != 'refs/heads/master'
55-
uses: stefanzweifel/git-auto-commit-action@v5
66+
- name: Suggest Rust formatting fixes
67+
if: github.event_name == 'pull_request'
68+
uses: reviewdog/action-suggester@v1
5669
with:
57-
commit_message: "Automatically apply formatting and lint fixes"
70+
tool_name: rustfmt
5871

5972
- name: Check C++ formatting
6073
run: find cpp2rust tests -name '*.cpp' -o -name '*.h' -o -name '*.c' | xargs clang-format --dry-run --Werror

0 commit comments

Comments
 (0)