xref: /rust-libc-0.2.174/ci/style.sh (revision d2c9877d)
1#!/usr/bin/env sh
2
3set -ex
4
5rustc ci/style.rs && ./style src
6
7if rustup component add rustfmt-preview ; then
8    command -v rustfmt
9    rustfmt -V
10    cargo fmt --all -- --check
11fi
12
13if shellcheck --version ; then
14    # GHA's shellcheck is too old (0.4.6) and cannot handle SC2153 correctly.
15    shellcheck -e SC2103 -e SC2153 ci/*.sh
16else
17    echo "shellcheck not found"
18    exit 1
19fi
20
21