Skip to content

Commit 814426c

Browse files
authored
[CodeStyle][Typos] Add typos to pre-commit (#7544)
1 parent fa14ac1 commit 814426c

File tree

7 files changed

+295
-8
lines changed

7 files changed

+295
-8
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ repos:
1818
types: [text]
1919
- id: remove-tabs
2020
types: [text]
21+
- repo: https://github.com/PFCCLab/typos-pre-commit-mirror.git
22+
rev: v1.38.1
23+
hooks:
24+
- id: typos
25+
args: [--force-exclude]
2126
# Document hooks
2227
- repo: https://github.com/PFCCLab/dochooks
2328
rev: v0.6.0

_typos.toml

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
[files]
2+
# The following files will be excluded from spell check during commits
3+
extend-exclude = []
4+
5+
[default]
6+
# Ignore 1-3 letter words, refer to https://github.com/crate-ci/typos/issues/1079
7+
extend-ignore-words-re = ["^[a-zA-Z]{1,3}$"]
8+
# refer to https://github.com/crate-ci/typos/blob/master/docs/reference.md#example-configurations
9+
extend-ignore-re = [
10+
# Ignore lines by `# typos: disable-line`
11+
"(?Rm)^.*(#|//)\\s*typos:\\s*disable-line$",
12+
# Ignore block by `# typos: off` and `# typos: on`
13+
"(?s)(#|//)\\s*typos:\\s*off.*?\\n\\s*(#|//)\\s*typos:\\s*on"
14+
]
15+
16+
[default.extend-words]
17+
# PaddlePaddle specific words
18+
CANN = "CANN"
19+
Clas = "Clas"
20+
arange = "arange"
21+
22+
# These words need to be fixed
23+
Accuray = "Accuray"
24+
Adventages = "Adventages"
25+
Archetecture = "Archetecture"
26+
Asynchoronous = "Asynchoronous"
27+
Attrbute = "Attrbute"
28+
Attribtue = "Attribtue"
29+
Bounary = "Bounary"
30+
Classfication = "Classfication"
31+
Comparision = "Comparision"
32+
Contructing = "Contructing"
33+
Creenshot = "Creenshot"
34+
DELCARE = "DELCARE"
35+
Dateset = "Dateset"
36+
Discription = "Discription"
37+
Distrbuted = "Distrbuted"
38+
Driect = "Driect"
39+
Embeddding = "Embeddding"
40+
Embeding = "Embeding"
41+
Engish = "Engish"
42+
Fasle = "Fasle"
43+
Flase = "Flase"
44+
Generater = "Generater"
45+
Gloabal = "Gloabal"
46+
Imporvement = "Imporvement"
47+
Interfce = "Interfce"
48+
Kernal = "Kernal"
49+
Learing = "Learing"
50+
Moible = "Moible"
51+
Nervana = "Nervana"
52+
Numberic = "Numberic"
53+
Operaton = "Operaton"
54+
Optimizaing = "Optimizaing"
55+
Optimzier = "Optimzier"
56+
Paremeter = "Paremeter"
57+
Pipline = "Pipline"
58+
Porgram = "Porgram"
59+
Prallel = "Prallel"
60+
Propegation = "Propegation"
61+
Propogation = "Propogation"
62+
Protocal = "Protocal"
63+
Pyhton = "Pyhton"
64+
REGISTE = "REGISTE"
65+
Reivew = "Reivew"
66+
Reuqest = "Reuqest"
67+
Setment = "Setment"
68+
Similarily = "Similarily"
69+
Simle = "Simle"
70+
Sovler = "Sovler"
71+
Successed = "Successed"
72+
Tansformer = "Tansformer"
73+
Tenosr = "Tenosr"
74+
Traning = "Traning"
75+
Transfomed = "Transfomed"
76+
Tthe = "Tthe"
77+
Ture = "Ture"
78+
Useage = "Useage"
79+
Varialble = "Varialble"
80+
Varible = "Varible"
81+
Varient = "Varient"
82+
Wether = "Wether"
83+
accordding = "accordding"
84+
accoustic = "accoustic"
85+
accpetance = "accpetance"
86+
accracy = "accracy"
87+
acutal = "acutal"
88+
apporach = "apporach"
89+
apporaches = "apporaches"
90+
arguements = "arguements"
91+
arguemnts = "arguemnts"
92+
assgin = "assgin"
93+
assginment = "assginment"
94+
auxilary = "auxilary"
95+
avaiable = "avaiable"
96+
baisc = "baisc"
97+
basci = "basci"
98+
beacuse = "beacuse"
99+
bechmark = "bechmark"
100+
benckmark = "benckmark"
101+
boradcast = "boradcast"
102+
brodcast = "brodcast"
103+
caculate = "caculate"
104+
cantains = "cantains"
105+
choosen = "choosen"
106+
classfication = "classfication"
107+
classfy = "classfy"
108+
cliping = "cliping"
109+
colunms = "colunms"
110+
commmit = "commmit"
111+
complie = "complie"
112+
condtional = "condtional"
113+
conjuction = "conjuction"
114+
containg = "containg"
115+
contruct = "contruct"
116+
contructed = "contructed"
117+
contruction = "contruction"
118+
contxt = "contxt"
119+
convertion = "convertion"
120+
convinience = "convinience"
121+
correponding = "correponding"
122+
corresonding = "corresonding"
123+
correspoinding = "correspoinding"
124+
corss = "corss"
125+
creatation = "creatation"
126+
creats = "creats"
127+
dafault = "dafault"
128+
datas = "datas"
129+
decribe = "decribe"
130+
decribes = "decribes"
131+
deocder = "deocder"
132+
desgin = "desgin"
133+
desginated = "desginated"
134+
desigin = "desigin"
135+
determinated = "determinated"
136+
diffcult = "diffcult"
137+
dimention = "dimention"
138+
dimentions = "dimentions"
139+
dirrectories = "dirrectories"
140+
disucssion = "disucssion"
141+
egde = "egde"
142+
enviornment = "enviornment"
143+
erros = "erros"
144+
evalute = "evalute"
145+
exampels = "exampels"
146+
exection = "exection"
147+
exlusive = "exlusive"
148+
exmaple = "exmaple"
149+
exsits = "exsits"
150+
feeded = "feeded"
151+
flaot = "flaot"
152+
fliters = "fliters"
153+
follwing = "follwing"
154+
formated = "formated"
155+
formater = "formater"
156+
forword = "forword"
157+
foward = "foward"
158+
functinal = "functinal"
159+
fundemental = "fundemental"
160+
funtion = "funtion"
161+
gard = "gard"
162+
generaly = "generaly"
163+
gloabl = "gloabl"
164+
heigh = "heigh"
165+
ilter = "ilter"
166+
imge = "imge"
167+
implememted = "implememted"
168+
indeces = "indeces"
169+
indentical = "indentical"
170+
indicies = "indicies"
171+
indx = "indx"
172+
infered = "infered"
173+
inferface = "inferface"
174+
infor = "infor"
175+
ingore = "ingore"
176+
instert = "instert"
177+
instrinsics = "instrinsics"
178+
interchangable = "interchangable"
179+
intializers = "intializers"
180+
intput = "intput"
181+
lable = "lable"
182+
learing = "learing"
183+
legth = "legth"
184+
lengthes = "lengthes"
185+
lenth = "lenth"
186+
leran = "leran"
187+
libary = "libary"
188+
likey = "likey"
189+
mantained = "mantained"
190+
matrics = "matrics"
191+
mdule = "mdule"
192+
mechnism = "mechnism"
193+
memeory = "memeory"
194+
memroy = "memroy"
195+
messege = "messege"
196+
metaphore = "metaphore"
197+
metrices = "metrices"
198+
muliply = "muliply"
199+
mulitplying = "mulitplying"
200+
mutbale = "mutbale"
201+
neeeded = "neeeded"
202+
nessesary = "nessesary"
203+
numberic = "numberic"
204+
occurence = "occurence"
205+
opeartor = "opeartor"
206+
opeartors = "opeartors"
207+
operaters = "operaters"
208+
optmization = "optmization"
209+
outpu = "outpu"
210+
outpus = "outpus"
211+
overrided = "overrided"
212+
overwrited = "overwrited"
213+
palce = "palce"
214+
parammeters = "parammeters"
215+
poniter = "poniter"
216+
porcess = "porcess"
217+
processer = "processer"
218+
promot = "promot"
219+
propegation = "propegation"
220+
provicded = "provicded"
221+
recevied = "recevied"
222+
recomment = "recomment"
223+
registerd = "registerd"
224+
registring = "registring"
225+
reivew = "reivew"
226+
relase = "relase"
227+
requirments = "requirments"
228+
resut = "resut"
229+
resuts = "resuts"
230+
sacle = "sacle"
231+
samle = "samle"
232+
satifies = "satifies"
233+
schedual = "schedual"
234+
secenarios = "secenarios"
235+
sematic = "sematic"
236+
seperator = "seperator"
237+
setted = "setted"
238+
shoule = "shoule"
239+
similary = "similary"
240+
simplier = "simplier"
241+
skiped = "skiped"
242+
softwares = "softwares"
243+
sould = "sould"
244+
specail = "specail"
245+
sperated = "sperated"
246+
splited = "splited"
247+
splitted = "splitted"
248+
stirng = "stirng"
249+
stradegy = "stradegy"
250+
subract = "subract"
251+
sucess = "sucess"
252+
sucessor = "sucessor"
253+
sucessors = "sucessors"
254+
szie = "szie"
255+
tempory = "tempory"
256+
tenosr = "tenosr"
257+
thier = "thier"
258+
traget = "traget"
259+
traing = "traing"
260+
trainning = "trainning"
261+
traning = "traning"
262+
transfered = "transfered"
263+
trasformed = "trasformed"
264+
treshold = "treshold"
265+
trian = "trian"
266+
unqiue = "unqiue"
267+
unsupport = "unsupport"
268+
updte = "updte"
269+
utill = "utill"
270+
varialbes = "varialbes"
271+
varibale = "varibale"
272+
varibales = "varibales"
273+
varience = "varience"
274+
varient = "varient"
275+
visting = "visting"
276+
warpped = "warpped"
277+
wether = "wether"
278+
wiht = "wiht"
279+
wirte = "wirte"
280+
workign = "workign"
281+
wraper = "wraper"
282+
writter = "writter"

docs/api/gen_doc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -696,23 +696,23 @@ def check_cn_en_match(path="./paddle", diff_file="en_cn_files_diff"):
696696
"""
697697
osp_join = os.path.join
698698
osp_exists = os.path.exists
699-
with open(diff_file, "w") as fo:
699+
with open(diff_file, "w") as f:
700700
tmpl = "{}\t{}\n"
701-
fo.write(tmpl.format("exist", "not_exits"))
701+
f.write(tmpl.format("exist", "not_exits"))
702702
for root, dirs, files in os.walk(path):
703703
for file in files:
704704
if file.endswith(en_suffix):
705705
cf = file.replace(en_suffix, cn_suffix)
706706
if not osp_exists(osp_join(root, cf)):
707-
fo.write(
707+
f.write(
708708
tmpl.format(
709709
osp_join(root, file), osp_join(root, cf)
710710
)
711711
)
712712
elif file.endswith(cn_suffix):
713713
ef = file.replace(cn_suffix, en_suffix)
714714
if not osp_exists(osp_join(root, ef)):
715-
fo.write(
715+
f.write(
716716
tmpl.format(
717717
osp_join(root, file), osp_join(root, ef)
718718
)

docs/design/concurrent/select_op.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ blocks {
161161
idx: 1
162162
parent_idx: 0
163163
...
164-
// Fill a tensor with the case index (ie: 0,1,2,3,ect.)
164+
// Fill a tensor with the case index (ie: 0,1,2,3,etc.)
165165
ops {
166166
outputs {
167167
parameter: "Out"

docs/dev_guides/custom_device_docs/custom_kernel_docs/tensor_api_en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ All element data of `DenseTensor` are stored in contiguous memory, and you can r
6262
// Return:int64_t categorical variable
6363
int64_t numel() const override;
6464

65-
// Acquire the dims of tbe tensor
65+
// Acquire the dims of the tensor
6666
// Parameter:None
6767
// Return:DDim object
6868
const DDim& dims() const noexcept override;

docs/dev_guides/op_optimization/kernel_primitive_api/io_api_en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The data processing process is as follows:</br>
122122

123123
> T: Element type. </br>
124124
> NX: Each thread reads NX columns data continuously. </br>
125-
> NY: Each thread reads NY rows data, Ony NY = 1 was supported. </br>
125+
> NY: Each thread reads NY rows data, Only NY = 1 was supported. </br>
126126
> BlockSize: Device attribute, which identifies the current device thread indexing method. For GPU, threadIdx.x is used as the thread index, this parameter is not currently supported. </br>
127127
> Rank: The dimension of the original output data. </br>
128128
> IsBoundary: Identifies whether to fetch memory boundary judgment. When the total number of data processed by the Block is less than NX * NY * blockDim.x, boundary judgment is required to avoid memory access crossing the boundary. </br>

docs/templates/common_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
grad_clip (GradientClipBase, optional): Gradient cliping strategy, it's an instance of some derived class of ``GradientClipBase`` . There are three cliping strategies ( :ref:`api_fluid_clip_GradientClipByGlobalNorm` , :ref:`api_fluid_clip_GradientClipByNorm` , :ref:`api_fluid_clip_GradientClipByValue` ). Default is None, meaning there is no gradient clipping.
3232
num_filters (int): The number of filter. It is as same as the output channals numbers.
3333
dim (int, optional): A dimension along which to operate. Default is 0.
34-
is_sparse (bool, optional): Whether use sparse updating. For more information, please refer to :ref:`api_guide_sparse_update_en` . If it's True, it will ues sparse updating.
34+
is_sparse (bool, optional): Whether use sparse updating. For more information, please refer to :ref:`api_guide_sparse_update_en` . If it's True, it will use sparse updating.
3535
place (paddle.CPUPlace()|paddle.CUDAPlace(N)|None): This parameter represents which device the executor runs on, and N means the GPU's id. When this parameter is None, PaddlePaddle will set the default device according to its installation version. If Paddle is CPU version, the default device would be set to CPUPlace(). If Paddle is GPU version, the default device would be set to CUDAPlace(0). Default is None.
3636
num_filters (int): the number of convolution kernels, is also the number of output channels.
3737
"""

0 commit comments

Comments
 (0)