mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-21 00:31:15 -03:00
72 lines
2.1 KiB
YAML
72 lines
2.1 KiB
YAML
name: Lint
|
|
|
|
on: [push, pull_request]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
format:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
|
|
- uses: ./.github/actions/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- name: install dependencies
|
|
run: pip install ruff
|
|
- name: build fish
|
|
run: cargo build --bin fish_indent
|
|
- name: check format
|
|
run: PATH="target/debug:$PATH" cargo xtask format --all --check
|
|
- name: check rustfmt
|
|
run: find build.rs crates src -type f -name '*.rs' | xargs rustfmt --check
|
|
|
|
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- rust_version: "stable"
|
|
features: ""
|
|
- rust_version: "stable"
|
|
features: "--no-default-features"
|
|
- rust_version: "msrv"
|
|
features: ""
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
|
|
- uses: ./.github/actions/rust-toolchain
|
|
with:
|
|
toolchain_channel: ${{ matrix.rust_version }}
|
|
components: clippy
|
|
- name: Update package database
|
|
run: sudo apt-get update
|
|
- name: Install deps
|
|
run: |
|
|
sudo apt install gettext
|
|
- name: Patch Cargo.toml to deny unknown lints
|
|
run: |
|
|
if [ "${{ matrix.rust_version }}" = stable ]; then
|
|
sed -i /^rust.unknown_lints/d Cargo.toml
|
|
fi
|
|
- name: cargo clippy
|
|
run: cargo clippy --workspace --all-targets ${{ matrix.features }} -- --deny=warnings
|
|
|
|
rustdoc:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
|
|
- uses: ./.github/actions/rust-toolchain@stable
|
|
- name: Update package database
|
|
run: sudo apt-get update
|
|
- name: Install deps
|
|
run: |
|
|
sudo apt install gettext
|
|
- name: cargo doc
|
|
run: |
|
|
RUSTDOCFLAGS='-D warnings' cargo doc --workspace
|
|
- name: cargo doctest
|
|
run: |
|
|
cargo test --doc --workspace
|