Skip to content

Commit 64c9b57

Browse files
add typos CI (#148)
1 parent 0279229 commit 64c9b57

File tree

7 files changed

+38
-26
lines changed

7 files changed

+38
-26
lines changed

.github/workflows/ci.yml

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17+
typos:
18+
name: Typos
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: crate-ci/typos@master
23+
1724
ruff:
1825
name: Ruff
1926
runs-on: ubuntu-latest

doc/misc.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@ Glossary
147147
mix-in
148148
See `Wikipedia article <https://en.wikipedia.org/wiki/Mixin>`__.
149149

150-
Be sure to mention the mix-in before the base classe being mixed in the
150+
Be sure to mention the mix-in before the base class being mixed in the
151151
list of base classes. This way, the mix-in can override base class
152152
behavior.

pymbolic/geometric_algebra/primitives.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def __call__(self, operand):
9797

9898
@staticmethod
9999
def resolve(expr):
100-
# This method will need to be overriden by codes using this
100+
# This method will need to be overridden by codes using this
101101
# infrastructure to use the appropriate subclass of DerivativeBinder.
102102

103103
from pymbolic.geometric_algebra.mapper import DerivativeBinder

pymbolic/interop/common.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _comparison_operator(self, expr, operator=None):
134134
return prim.Comparison(left, operator, right)
135135

136136
map_Equality = partial(_comparison_operator, operator="==") # noqa: N815
137-
map_Unequality = partial(_comparison_operator, operator="!=") # noqa: N815
137+
map_Unequality = partial(_comparison_operator, operator="!=") # noqa: N815 # spellchecker: disable-line
138138
map_GreaterThan = partial(_comparison_operator, operator=">=") # noqa: N815
139139
map_LessThan = partial(_comparison_operator, operator="<=") # noqa: N815
140140
map_StrictGreaterThan = partial(_comparison_operator, operator=">") # noqa: N815
@@ -199,7 +199,7 @@ def map_comparison(self, expr):
199199
if expr.operator == "==":
200200
return self.sym.Equality(left, right)
201201
elif expr.operator == "!=":
202-
return self.sym.Unequality(left, right)
202+
return self.sym.Unequality(left, right) # spellchecker: disable-line
203203
elif expr.operator == "<":
204204
return self.sym.StrictLessThan(left, right)
205205
elif expr.operator == ">":

pymbolic/mapper/optimize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# This machinery applies AST rewriting to the mapper in a mildly brutal
3131
# manner, and as such it requires some attention from the user to
3232
# make sure all transformations applied are valid. A good way to do
33-
# this is to look at the generated code by settting print_modified_code_file
33+
# this is to look at the generated code by setting print_modified_code_file
3434
# to sys.stdout or the like.
3535

3636
# Note that this machinery is intentionally generic enough so as to also

pymbolic/polynomial.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -129,36 +129,36 @@ def __add__(self, other):
129129
else:
130130
return other.__add__(self)
131131

132-
iself = 0
133-
iother = 0
132+
i_self = 0
133+
i_other = 0
134134

135135
result = []
136-
while iself < len(self.Data) and iother < len(other.Data):
137-
exp_self = self.Data[iself][0]
138-
exp_other = other.Data[iother][0]
136+
while i_self < len(self.Data) and i_other < len(other.Data):
137+
exp_self = self.Data[i_self][0]
138+
exp_other = other.Data[i_other][0]
139139
if exp_self == exp_other:
140-
coeff = self.Data[iself][1] + other.Data[iother][1]
140+
coeff = self.Data[i_self][1] + other.Data[i_other][1]
141141
if coeff:
142142
result.append((exp_self, coeff))
143-
iself += 1
144-
iother += 1
143+
i_self += 1
144+
i_other += 1
145145
elif exp_self > exp_other:
146-
result.append((exp_other, other.Data[iother][1]))
147-
iother += 1
146+
result.append((exp_other, other.Data[i_other][1]))
147+
i_other += 1
148148
elif exp_self < exp_other:
149-
result.append((exp_self, self.Data[iself][1]))
150-
iself += 1
149+
result.append((exp_self, self.Data[i_self][1]))
150+
i_self += 1
151151

152152
# we have exhausted at least one list, exhaust the other
153-
while iself < len(self.Data):
154-
exp_self = self.Data[iself][0]
155-
result.append((exp_self, self.Data[iself][1]))
156-
iself += 1
157-
158-
while iother < len(other.Data):
159-
exp_other = other.Data[iother][0]
160-
result.append((exp_other, other.Data[iother][1]))
161-
iother += 1
153+
while i_self < len(self.Data):
154+
exp_self = self.Data[i_self][0]
155+
result.append((exp_self, self.Data[i_self][1]))
156+
i_self += 1
157+
158+
while i_other < len(other.Data):
159+
exp_other = other.Data[i_other][0]
160+
result.append((exp_other, other.Data[i_other][1]))
161+
i_other += 1
162162

163163
return Polynomial(self.Base, tuple(result))
164164

pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ inline-quotes = "double"
100100
docstring-quotes = "double"
101101
multiline-quotes = "double"
102102

103+
[tool.typos.default]
104+
extend-ignore-re = [
105+
"(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line$"
106+
]
107+
103108
[tool.ruff.lint.isort]
104109
known-first-party = ["pytools"]
105110
known-local-folder = ["pymbolic"]

0 commit comments

Comments
 (0)