Skip to content

Commit a51ad0c

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 a51ad0c

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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: ./.github/actions/setup/directories
40+
41+
- name: Install Rust
42+
run: rustup default beta
43+
44+
- name: Gather and translate warnings
45+
run: |
46+
set -euo pipefail
47+
cargo check --all-features --message-format=json |
48+
jq -r 'select(.reason == "compiler-message" and .message.level == "warning") |
49+
"::warning file=\(.message.spans[0].file_name),line=\(.message.spans[0].line_start),endLine=\(.message.spans[0].line_end)::\(
50+
.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)