ci: check for typos

https://github.com/crate-ci/typos is quite nice, and is even written in Rust.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1246>
This commit is contained in:
Guillaume Desmottes 2023-04-07 14:07:12 +02:00
parent 6fc969932b
commit 68e0ae9a9c
4 changed files with 44 additions and 3 deletions

View file

@ -387,6 +387,15 @@ check commits:
- job: 'build-stable'
artifacts: false
typos:
extends: .img-stable
stage: "lint"
script:
- typos
needs:
- job: 'build-stable'
artifacts: false
clippy:
extends: .img-stable
stage: 'extras'

View file

@ -1,4 +1,4 @@
variables:
GST_RS_IMG_TAG: '2023-04-06.0'
GST_RS_STABLE: '1.68.2'
GST_RS_MSRV: '1.66.0'
GST_RS_IMG_TAG: "2023-04-76.0"
GST_RS_STABLE: "1.68.2"
GST_RS_MSRV: "1.66.0"

View file

@ -28,6 +28,7 @@ if [ "$RUST_IMAGE_FULL" = "1" ]; then
cargo install --force cargo-deny
cargo install --force cargo-outdated
cargo install --force typos-cli
# Coverage tools
rustup component add llvm-tools-preview

31
typos.toml Normal file
View file

@ -0,0 +1,31 @@
[default.extend-words]
gir = "gir"
numer = "numer" # numerator
inout = "inout"
seeked = "seeked"
BA = "BA" # sdp_message.rs
UE = "UE" # rtsp-server-record.rs
[default]
extend-ignore-identifiers-re = [
"GST_MTS_TABLE_ID_14496_OBJET_DESCRIPTOR",
# gst_rtsp_media_factory_is_stop_on_disonnect
".*is_stop_on_disonnect",
"ser_de", # gstreamer/CHANGELOG.md
]
[files]
extend-exclude = [
# don't check dot and gir files
"*.gir",
"*.dot",
# don't check submodules
"gir/*",
"gir-files/*",
"gst-gir-files/*",
# versions.txt are generated and contain git hash objects
"versions.txt",
# can't fix typos in generated code as the typo is likely in the C API
"*/src/auto/*.rs",
"*/sys/src/lib.rs",
]