Skip to content

Commit

Permalink
ci: add job to check spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiapple852 committed Dec 24, 2024
1 parent dc46600 commit ecd2f08
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .config/spellcheck.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Project settings where a Cargo.toml exists and is passed
# ${CARGO_MANIFEST_DIR}/.config/spellcheck.toml

# Also take into account developer comments
dev_comments = true

# Skip the README.md file as defined in the cargo manifest
skip_readme = false

[Hunspell]
lang = "en_US"
search_dirs = ["."]
extra_dictionaries = ["trippy.dic"]

# If set to `true`, the OS specific default search paths
# are skipped and only explicitly specified ones are used.
skip_os_lookups = false

# Use the builtin dictionaries if none were found in
# in the configured lookup paths.
# Usually combined with `skip_os_lookups=true`
# to enforce the `builtin` usage for consistent
# results across distributions and CI runs.
# Setting this will still use the dictionaries
# specified in `extra_dictionaries = [..]`
# for topic specific lingo.
use_builtin = true


[Hunspell.quirks]
# Transforms words that are provided by the tokenizer
# into word fragments based on the capture groups which are to
# be checked.
# If no capture groups are present, the matched word is whitelisted.
transform_regex = ["^'([^\\s])'$", "^[0-9]+x$"]
# Accepts `alphabeta` variants if the checker provides a replacement suggestion
# of `alpha-beta`.
allow_concatenation = true
# And the counterpart, which accepts words with dashes, when the suggestion has
# recommendations without the dashes. This is less common.
allow_dashed = false
# Check the expressions in the footnote references. By default this is turned on
# to remain backwards compatible but disabling it could be particularly useful
# when one uses abbreviations instead of numbers as footnote references. For
# instance by default the fragment `hello[^xyz]` would be spellchecked as
# `helloxyz` which is obviously a misspelled word, but by turning this check
# off, it will skip validating the reference altogether and will only check the
# word `hello`.
check_footnote_references = false

[NlpRules]
# Allows the user to override the default included
# exports of LanguageTool, with other custom
# languages

# override_rules = "/path/to/rules_binencoded.bin"
# override_tokenizer = "/path/to/tokenizer_binencoded.bin"

[Reflow]
# Reflows doc comments to adhere to adhere to a given maximum line width limit.
max_line_length = 80
107 changes: 107 additions & 0 deletions .config/trippy.dic
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
100
%
'
+
100ms
10ms
1s
300s
5s
=
>
ASN
BSD4
CSV
Cloudflare
DF
DSCP
ECMP
ECN
Endianness
FreeBSD
GeoIp
Geolocation
Graphviz
ICMPv4
ICMPv6
IPinfo
IPs
IPv4
IPv6
MaxMind
NAT'ed
Num
ROFF
RTT
TBD
TODO
TOS
TXT
Trippy
Tui
XDG
accessor
addr
addrs
asn
boolean
calc
checksum
checksums
cidr
cloneable
config
connectionless
datagram
dec
deserialization
dest
dns
dublin
endianness
enqueue
enqueued
enqueuing
frontend
geolocation
getsockname
holsravbwdt
hostname
hostnames
icmp
impl
ip
ipv6
jitter
json
localhost
lookups
macOS
mmdb
mpls
multipath
newtype
paris
rfc1889
rfc2460
rfc3550
rfc4443
rfc4884
src
stddev
struct
submodule
syscall
tcp
timestamp
toml
traceroute
trippy
ttl
tui
tuple
u8
udp
uninitialised
unix
unselected
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,15 @@ jobs:
uses: webiny/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
allowed-commit-types: "feat,fix,chore,docs,style,refactor,test,build,ci,revert"
allowed-commit-types: "feat,fix,chore,docs,style,refactor,test,build,ci,revert"

spelling:
runs-on: ubuntu-22.04
steps:
- name: Install cargo-spellcheck
uses: taiki-e/install-action@v2
with:
tool: cargo-spellcheck
- uses: actions/checkout@v4
- name: Run cargo-spellcheck
run: cargo spellcheck --code 1

0 comments on commit ecd2f08

Please sign in to comment.