Add typos lint to workflow.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
17
.github/workflows/lint.yml
vendored
17
.github/workflows/lint.yml
vendored
@@ -54,6 +54,23 @@ jobs:
|
||||
excludes: ${{inputs.excludes}}
|
||||
includes: ${{inputs.includes}}
|
||||
|
||||
typos:
|
||||
if: ${{ !failure() && !cancelled() && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0]) }}
|
||||
name: Typos
|
||||
uses: ./.github/workflows/bake.yml
|
||||
with:
|
||||
bake_targets: '["typos"]'
|
||||
cargo_profiles: '["test"]'
|
||||
feat_sets: '["all"]'
|
||||
rust_toolchains: '["nightly"]'
|
||||
sys_names: ${{inputs.sys_names}}
|
||||
sys_versions: ${{inputs.sys_versions}}
|
||||
rust_targets: ${{inputs.rust_targets}}
|
||||
sys_targets: ${{inputs.sys_targets}}
|
||||
machines: ${{inputs.machines}}
|
||||
excludes: ${{inputs.excludes}}
|
||||
includes: ${{inputs.includes}}
|
||||
|
||||
audit:
|
||||
if: ${{ !failure() && !cancelled() && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0]) }}
|
||||
name: Audit
|
||||
|
||||
6
.typos.toml
Normal file
6
.typos.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[default.extend-words]
|
||||
"allocatedp" = "allocatedp"
|
||||
"conduwuit" = "conduwuit"
|
||||
"execuse" = "execuse"
|
||||
"leafs" = "leafs"
|
||||
"serialize" = "serialize"
|
||||
21
docker/Dockerfile.cargo.typos
Normal file
21
docker/Dockerfile.cargo.typos
Normal file
@@ -0,0 +1,21 @@
|
||||
# syntax = docker/dockerfile:1.11-labs
|
||||
|
||||
FROM input AS typos
|
||||
ARG rust_toolchain="nightly"
|
||||
ARG RUSTUP_HOME
|
||||
ARG CARGO_HOME
|
||||
ARG typos_args=""
|
||||
|
||||
WORKDIR /usr/src/tuwunel
|
||||
RUN \
|
||||
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \
|
||||
--mount=type=cache,dst=${CARGO_HOME},sharing=locked \
|
||||
<<EOF
|
||||
set -eux
|
||||
rustup run ${rust_toolchain} \
|
||||
typos \
|
||||
--color always \
|
||||
--exclude docker \
|
||||
--exclude nix \
|
||||
${typos_args}
|
||||
EOF
|
||||
@@ -943,6 +943,23 @@ target "audit" {
|
||||
}
|
||||
}
|
||||
|
||||
target "typos" {
|
||||
name = elem("typos", [cargo_profile, rust_toolchain, rust_target, feat_set, sys_name, sys_version, sys_target])
|
||||
tags = [
|
||||
elem_tag("typos", [cargo_profile, rust_toolchain, rust_target, feat_set, sys_name, sys_version, sys_target], "latest"),
|
||||
]
|
||||
target = "typos"
|
||||
dockerfile = "docker/Dockerfile.cargo.typos"
|
||||
matrix = cargo_rust_feat_sys
|
||||
inherits = [
|
||||
elem("deps-base", [cargo_profile, rust_toolchain, rust_target, feat_set, sys_name, sys_version, sys_target]),
|
||||
elem("cargo", [cargo_profile, rust_toolchain, rust_target, feat_set, sys_name, sys_version, sys_target]),
|
||||
]
|
||||
contexts = {
|
||||
input = elem("target:ingredients", [rust_toolchain, rust_target, feat_set, sys_name, sys_version, sys_target])
|
||||
}
|
||||
}
|
||||
|
||||
target "fmt" {
|
||||
name = elem("fmt", [cargo_profile, rust_toolchain, rust_target, feat_set, sys_name, sys_version, sys_target])
|
||||
tags = [
|
||||
@@ -1291,6 +1308,7 @@ cargo_installs = [
|
||||
"cargo-arch",
|
||||
"cargo-generate-rpm",
|
||||
"lychee",
|
||||
"typos-cli",
|
||||
]
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user