File tree Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change 1
1
name : " Check code formatting"
2
2
3
3
permissions :
4
- contents : read
4
+ contents : write
5
+ pull-requests : write
6
+ repository-projects : write
5
7
6
8
on :
7
9
pull_request :
37
39
- name : Fetch code formatting utils
38
40
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
39
41
with :
40
- repository : ${{ github.repository }}
41
- ref : ${{ github.base_ref }}
42
+ repository : localspook/llvm-project
43
+ ref : ${{ github.event.pull_request.head.ref }}
42
44
sparse-checkout : |
43
45
llvm/utils/git/requirements_formatting.txt
44
46
llvm/utils/git/code-format-helper.py
71
73
run : pip install -r code-format-tools/llvm/utils/git/requirements_formatting.txt
72
74
73
75
- name : Run code formatter
76
+ id : run-code-formatter
74
77
env :
75
78
GITHUB_PR_NUMBER : ${{ github.event.pull_request.number }}
76
79
CHANGED_FILES : ${{ steps.changed-files.outputs.all_changed_files }}
91
94
name : workflow-args
92
95
path : |
93
96
comments
97
+
98
+ - uses : parkerbxyz/suggest-changes@00f556dcc0c9454336b598b8872fdc11d77984d9 # v3.0.0
99
+ if : failure()
100
+ with :
101
+ token : ${{ secrets.GITHUB_TOKEN }}
102
+ comment : " Formatting can be fixed by applying the following changes:"
103
+ event : " REQUEST_CHANGES"
Original file line number Diff line number Diff line change @@ -491,8 +491,11 @@ std::vector<std::string> ClangTidyASTConsumerFactory::getCheckNames() {
491
491
ClangTidyOptions::OptionMap ClangTidyASTConsumerFactory::getCheckOptions () {
492
492
ClangTidyOptions::OptionMap Options;
493
493
std::vector<std::unique_ptr<ClangTidyCheck>> Checks =
494
- CheckFactories->createChecks (&Context);
495
- for (const auto &Check : Checks)
494
+ CheckFactories->createChecks
495
+ (&Context);
496
+ for (const
497
+
498
+ auto &Check : Checks)
496
499
Check->storeOptions (Options);
497
500
return Options;
498
501
}
Original file line number Diff line number Diff line change @@ -182,10 +182,10 @@ class ClangFormatHelper(FormatHelper):
182
182
friendly_name = "C/C++ code formatter"
183
183
184
184
def _construct_command (self , diff_expression : list [str ] | None ):
185
- cf_cmd = [self .clang_fmt_path , "--diff " ]
185
+ cf_cmd = [self .clang_fmt_path , "HEAD~1 " ]
186
186
187
- if diff_expression :
188
- cf_cmd .extend (diff_expression )
187
+ # if diff_expression:
188
+ # cf_cmd.extend(diff_expression)
189
189
190
190
# Gather the extension of all modified files and pass them explicitly to git-clang-format.
191
191
# This prevents git-clang-format from applying its own filtering rules on top of ours.
You can’t perform that action at this time.
0 commit comments