Skip to content

Commit 697ea8b

Browse files
committed
annotations
1 parent 1769b47 commit 697ea8b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/restyle.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,18 @@ def pop(out, context, line):
171171
return out
172172

173173

174-
def notice_changed(changed: Changed):
174+
def warning_changed(changed: Changed):
175175
print(
176-
f"::notice file={changed.file},title=Run tests/restyle.sh and re-commit {changed.file}::File {changed.file} failed clang-format style check. (lines {changed.lines})"
176+
f"::warning file={changed.file},title=Run tests/restyle.sh and re-commit {changed.file}::File {changed.file} failed clang-format style check. (lines {changed.lines})"
177177
)
178178

179179

180180
SUMMARY_PATH = pathlib.Path(os.environ.get("GITHUB_STEP_SUMMARY", os.devnull))
181181
SUMMARY_OUTPUT = SUMMARY_PATH.open("a")
182182

183-
184183
def summary_diff(changed: Changed):
185184
with contextlib.redirect_stdout(SUMMARY_OUTPUT):
185+
print(f"# {changed.file} (suggested change)")
186186
print("```diff")
187187
print(changed.hunk)
188188
print("```")
@@ -215,8 +215,8 @@ def run_format(args):
215215

216216
def run_assert(args):
217217
for changed in changed_files():
218-
if args.with_notice:
219-
notice_changed(changed)
218+
if args.with_warnings:
219+
warning_changed(changed)
220220
if args.with_summary:
221221
summary_diff(changed)
222222

@@ -247,7 +247,7 @@ def run_assert(args):
247247
assert_ = cmd.add_parser("assert")
248248
assert_.set_defaults(func=run_assert)
249249
assert_.add_argument("--with-summary", action="store_true")
250-
assert_.add_argument("--with-notice", action="store_true")
250+
assert_.add_argument("--with-warnings", action="store_true")
251251

252252
args = parser.parse_args()
253253
args.func(args)

tests/restyle.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ CLANG_FORMAT=${CLANG_FORMAT:-clang-format-15}
1313

1414
cd $root
1515
python $root/tests/restyle.py format --clang-format=$CLANG_FORMAT preset --include core --include arduino
16-
python $root/tests/restyle.py assert --with-summary --with-notice
16+
python $root/tests/restyle.py assert --with-summary --with-warnings

0 commit comments

Comments
 (0)