diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 068ea00..cff3ac0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,13 @@ concurrency: cancel-in-progress: true jobs: + typos: + name: Typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@master + ruff: name: Ruff runs-on: ubuntu-latest diff --git a/doc/misc.rst b/doc/misc.rst index eacd0b1..df1da95 100644 --- a/doc/misc.rst +++ b/doc/misc.rst @@ -147,6 +147,6 @@ Glossary mix-in See `Wikipedia article `__. - Be sure to mention the mix-in before the base classe being mixed in the + Be sure to mention the mix-in before the base class being mixed in the list of base classes. This way, the mix-in can override base class behavior. diff --git a/pymbolic/geometric_algebra/primitives.py b/pymbolic/geometric_algebra/primitives.py index 94e1ef5..b8140f3 100644 --- a/pymbolic/geometric_algebra/primitives.py +++ b/pymbolic/geometric_algebra/primitives.py @@ -97,7 +97,7 @@ def __call__(self, operand): @staticmethod def resolve(expr): - # This method will need to be overriden by codes using this + # This method will need to be overridden by codes using this # infrastructure to use the appropriate subclass of DerivativeBinder. from pymbolic.geometric_algebra.mapper import DerivativeBinder diff --git a/pymbolic/interop/common.py b/pymbolic/interop/common.py index e8caf8b..7bd5dc5 100644 --- a/pymbolic/interop/common.py +++ b/pymbolic/interop/common.py @@ -134,7 +134,7 @@ def _comparison_operator(self, expr, operator=None): return prim.Comparison(left, operator, right) map_Equality = partial(_comparison_operator, operator="==") # noqa: N815 - map_Unequality = partial(_comparison_operator, operator="!=") # noqa: N815 + map_Unequality = partial(_comparison_operator, operator="!=") # noqa: N815 # spellchecker: disable-line map_GreaterThan = partial(_comparison_operator, operator=">=") # noqa: N815 map_LessThan = partial(_comparison_operator, operator="<=") # noqa: N815 map_StrictGreaterThan = partial(_comparison_operator, operator=">") # noqa: N815 @@ -199,7 +199,7 @@ def map_comparison(self, expr): if expr.operator == "==": return self.sym.Equality(left, right) elif expr.operator == "!=": - return self.sym.Unequality(left, right) + return self.sym.Unequality(left, right) # spellchecker: disable-line elif expr.operator == "<": return self.sym.StrictLessThan(left, right) elif expr.operator == ">": diff --git a/pymbolic/mapper/optimize.py b/pymbolic/mapper/optimize.py index 8805a8c..4295e09 100644 --- a/pymbolic/mapper/optimize.py +++ b/pymbolic/mapper/optimize.py @@ -30,7 +30,7 @@ # This machinery applies AST rewriting to the mapper in a mildly brutal # manner, and as such it requires some attention from the user to # make sure all transformations applied are valid. A good way to do -# this is to look at the generated code by settting print_modified_code_file +# this is to look at the generated code by setting print_modified_code_file # to sys.stdout or the like. # Note that this machinery is intentionally generic enough so as to also diff --git a/pymbolic/polynomial.py b/pymbolic/polynomial.py index 52ddea3..edd38f3 100644 --- a/pymbolic/polynomial.py +++ b/pymbolic/polynomial.py @@ -129,36 +129,36 @@ def __add__(self, other): else: return other.__add__(self) - iself = 0 - iother = 0 + i_self = 0 + i_other = 0 result = [] - while iself < len(self.Data) and iother < len(other.Data): - exp_self = self.Data[iself][0] - exp_other = other.Data[iother][0] + while i_self < len(self.Data) and i_other < len(other.Data): + exp_self = self.Data[i_self][0] + exp_other = other.Data[i_other][0] if exp_self == exp_other: - coeff = self.Data[iself][1] + other.Data[iother][1] + coeff = self.Data[i_self][1] + other.Data[i_other][1] if coeff: result.append((exp_self, coeff)) - iself += 1 - iother += 1 + i_self += 1 + i_other += 1 elif exp_self > exp_other: - result.append((exp_other, other.Data[iother][1])) - iother += 1 + result.append((exp_other, other.Data[i_other][1])) + i_other += 1 elif exp_self < exp_other: - result.append((exp_self, self.Data[iself][1])) - iself += 1 + result.append((exp_self, self.Data[i_self][1])) + i_self += 1 # we have exhausted at least one list, exhaust the other - while iself < len(self.Data): - exp_self = self.Data[iself][0] - result.append((exp_self, self.Data[iself][1])) - iself += 1 - - while iother < len(other.Data): - exp_other = other.Data[iother][0] - result.append((exp_other, other.Data[iother][1])) - iother += 1 + while i_self < len(self.Data): + exp_self = self.Data[i_self][0] + result.append((exp_self, self.Data[i_self][1])) + i_self += 1 + + while i_other < len(other.Data): + exp_other = other.Data[i_other][0] + result.append((exp_other, other.Data[i_other][1])) + i_other += 1 return Polynomial(self.Base, tuple(result)) diff --git a/pyproject.toml b/pyproject.toml index 16d5021..912473b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,6 +100,11 @@ inline-quotes = "double" docstring-quotes = "double" multiline-quotes = "double" +[tool.typos.default] +extend-ignore-re = [ + "(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line$" +] + [tool.ruff.lint.isort] known-first-party = ["pytools"] known-local-folder = ["pymbolic"]