fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Daniel Rainerfeat: `xtask gettext`4e3898d0d

master
3.0 KiB94 linesraw
1name: Lint
2
3on: [push, pull_request]
4
5permissions:
6  contents: read
7
8jobs:
9  format:
10    runs-on: ubuntu-latest
11    steps:
12    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
13    - uses: ./.github/actions/rust-toolchain@stable
14      with:
15        components: rustfmt
16    - name: install dependencies
17      run: pip install ruff
18    - name: build fish
19      run: cargo build --bin fish_indent
20    - name: check format
21      run: PATH="target/debug:$PATH" cargo xtask format --all --check
22    - name: check rustfmt
23      run: find build.rs crates src -type f -name '*.rs' | xargs rustfmt --check
24
25  shellcheck:
26    runs-on: ubuntu-latest
27    steps:
28    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
29    - uses: ./.github/actions/rust-toolchain@stable
30    - name: Update package database
31      run: sudo apt-get update
32    - name: Install shellcheck
33      run: sudo apt install shellcheck
34    - name: shellcheck
35      run: cargo xtask shellcheck
36
37  po_files_up_to_date:
38    runs-on: ubuntu-latest
39    steps:
40    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
41    - uses: ./.github/actions/rust-toolchain@stable
42    - name: Install deps
43      uses: ./.github/actions/install-dependencies
44    - name: Check PO files
45      run: cargo xtask gettext check
46
47  clippy:
48    runs-on: ubuntu-latest
49    strategy:
50      matrix:
51        include:
52          - rust_version: "stable"
53            features: ""
54          - rust_version: "stable"
55            features: "--no-default-features"
56          - rust_version: "stable"
57            features: "--all-features"
58          - rust_version: "msrv"
59            features: ""
60    steps:
61    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
62    - uses: ./.github/actions/rust-toolchain
63      with:
64        toolchain_channel: ${{ matrix.rust_version }}
65        components: clippy
66    - name: Update package database
67      run: sudo apt-get update
68    - name: Install deps
69      run: |
70        sudo apt install gettext
71    - name: Patch Cargo.toml to deny unknown lints
72      run: |
73        if [ "${{ matrix.rust_version }}" = stable ]; then
74          sed -i /^rust.unknown_lints/d Cargo.toml
75        fi
76    - name: cargo clippy
77      run: cargo clippy --workspace --all-targets ${{ matrix.features }} -- --deny=warnings
78
79  rustdoc:
80    runs-on: ubuntu-latest
81    steps:
82    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
83    - uses: ./.github/actions/rust-toolchain@stable
84    - name: Update package database
85      run: sudo apt-get update
86    - name: Install deps
87      run: |
88        sudo apt install gettext
89    - name: cargo doc
90      run: |
91        RUSTDOCFLAGS='-D warnings' cargo doc --workspace
92    - name: cargo doctest
93      run: |
94        cargo test --doc --workspace