Skip to content

Commit

Permalink
feat: add typo check in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ulic-youthlic committed Feb 6, 2025
1 parent 42a7082 commit fb75f74
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,21 @@ jobs:
- name: Check test
run: |
nix build .#checks.x86_64-linux.audit 2>&1
check-typo:
runs-on: ubuntu-latest
needs: build-nixpkg
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Nix
uses: nixbuild/nix-quick-install-action@v27

- name: Restore Nix Cache
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.nix') }}

- name: Check test
run: |
nix build .#checks.x86_64-linux.typo 2>&1
1 change: 1 addition & 0 deletions .ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.git
12 changes: 12 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@
};
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
checkTypo =
pkgs.runCommandNoCCLocal "check-typo"
{
src = ./.;
nativeBuildInputs = with pkgs; [ typos ];
}
''
mkdir -p $out
cd $src && typos -c $src/typos.toml
'';
in
{
packages = {
Expand All @@ -123,6 +134,7 @@
};
checks = {
inherit (self.packages."${system}") mania;
typo = checkTypo;
audit = craneLib.cargoAudit (
commonArgs
// {
Expand Down
5 changes: 5 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[files]
ignore-hidden = false
[default]
check-filename = true
check-file = true

0 comments on commit fb75f74

Please sign in to comment.