Skip to content

Commit 5a4b5c7

Browse files
committed
feat: add trademark-check
Signed-off-by: ZHANG Yuntian <yt@radxa.com>
1 parent f5a4d8e commit 5a4b5c7

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

.pre-commit-hooks.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,8 @@
7171
entry: pre_commit_hooks/main.sh check-title-initial
7272
language: script
7373
types_or: [markdown]
74+
- id: trademark-check
75+
name: Enforce proper standard when referencing trademarks
76+
entry: pre_commit_hooks/main.sh trademark-check
77+
language: script
78+
types: [markdown]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
check() {
4+
local ret=0 registered=(
5+
"Fogwise"
6+
)
7+
8+
# Add missing (r) to trademarks
9+
for i in "${registered[@]}"; do
10+
if grep -E "$i " "$1"
11+
then
12+
echo "$1: $i: (r) missing on trademark." >&2
13+
ret=1
14+
if ! $DRY_RUN
15+
then
16+
sed -i -E "s/$i /${i}® /g" "$1"
17+
fi
18+
fi
19+
done
20+
21+
return $ret
22+
}

0 commit comments

Comments
 (0)