-
Notifications
You must be signed in to change notification settings - Fork 97
57 lines (48 loc) · 1.49 KB
/
format-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT
name: Kani Format Check
on:
pull_request:
merge_group:
push:
# Not just any push, as that includes tags.
# We don't want to re-trigger this workflow when tagging an existing commit.
branches:
- '**'
jobs:
format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout Kani
uses: actions/checkout@v4
- name: Execute copyright check
run: ./scripts/ci/run-copyright-check.sh
# Ignore failures here for now until we can pindown a version.
- name: Check C code formatting
continue-on-error: true
run: ./scripts/run-clang-format.sh -d
- name: Check Python code formatting
run: |
pip3 install --upgrade autopep8
./scripts/run-autopep8.sh
clippy-check:
runs-on: ubuntu-20.04
steps:
- name: Checkout Kani
uses: actions/checkout@v4
- name: Setup Kani Dependencies
uses: ./.github/actions/setup
with:
os: ubuntu-20.04
- name: 'Install jq for parsing.'
run: |
sudo apt-get install -y jq
- name: 'Run Clippy'
run: |
cargo clippy --workspace -- -D warnings
- name: 'Print Clippy Statistics'
run: |
rm .cargo/config.toml
(cargo clippy --all --message-format=json 2>/dev/null | \
jq 'select(.message!=null) | .message.code.code' | grep -v '^null$' | \
sort | uniq -c) || true