Skip to content

Commit 368a4ca

Browse files
committed
CI: Surface Rust warnings on PRs that touch any Rust code
Idea is, if you create PRs touching Rust code often, you probably don't mind being shown new warnings introduced in new Rust releases. They've been trivial to fix and this will help us stay on top of them. Fix a typo for demo
1 parent 61fff8a commit 368a4ca

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Surface Rust warnings on PRs that touch any Rust code
2+
name: Show Rust warnings on PR
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
paths:
10+
- '**.rs'
11+
- '!**.inc.rs'
12+
merge_group:
13+
14+
concurrency:
15+
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
16+
cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
make:
23+
env:
24+
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
25+
26+
runs-on: ubuntu-24.04
27+
28+
if: >-
29+
${{!(false
30+
|| contains(github.event.head_commit.message, '[DOC]')
31+
|| contains(github.event.head_commit.message, 'Document')
32+
|| contains(github.event.pull_request.title, '[DOC]')
33+
|| contains(github.event.pull_request.title, 'Document')
34+
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
35+
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
36+
)}}
37+
38+
steps:
39+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
with:
41+
sparse-checkout-cone-mode: false
42+
sparse-checkout: /.github
43+
44+
- name: Install Rust
45+
run: rustup default beta
46+
47+
- name: Gather and translate warnings
48+
run: |
49+
cargo check --all-features --message-format=json |
50+
jq -r 'select(.reason == "compiler-message" and .message.level == "warning") |
51+
"::warning file=\(.message.spans[0].file_name),line=\(.message.spans[0].line_start),endLine=\(.message.spans[0].line_end)::\(
52+
.message.rendered | gsub("%"; "%25") | gsub("\n"; "%0A") | gsub("\r"; "%0D"))"'

zjit/src/hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl<'a> std::fmt::Display for ConstPrinter<'a> {
343343
///
344344
/// Because this is extra state external to any pointer being printed, a
345345
/// printing adapter struct that wraps the pointer along with this map is
346-
/// required to make use of this effectly. The [`std::fmt::Display`]
346+
/// required to make use of this effectively. The [`std::fmt::Display`]
347347
/// implementation on the adapter struct can then be reused to implement
348348
/// `Display` on the inner type with a default [`PtrPrintMap`], which
349349
/// does not perform any mapping.

0 commit comments

Comments
 (0)