From 5fd43b25d309655302700d1788d877ab9af66f4d Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 22 Jul 2024 14:19:08 -0500 Subject: [PATCH] Fix typos, add typos CI --- .github/workflows/ci.yml | 7 +++++++ doc/shells.rst | 2 +- examples/shell.py | 2 +- examples/stringifier.py | 2 +- pudb/debugger.py | 4 ++-- pudb/lowlevel.py | 2 +- pudb/test/test_lowlevel.py | 2 +- pyproject.toml | 14 ++++++++++++++ 8 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f99a3f3..51435a65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,13 @@ jobs: pipx install ruff ruff check + typos: + name: Typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@master + pylint: name: Pylint runs-on: ubuntu-latest diff --git a/doc/shells.rst b/doc/shells.rst index c0e4229b..a5b23471 100644 --- a/doc/shells.rst +++ b/doc/shells.rst @@ -52,7 +52,7 @@ PuDB supports the following external shells. - Internal (same as pressing ``Ctrl-x``). This is the default. - Classic (similar to the default ``python`` interactive shell) - `IPython `_ - The `IPython` shell can also be used in a server-client fasion, which is + The `IPython` shell can also be used in a server-client fashion, which is enabled by selecting the shell `ipython_kernel` in the settings. When set, the ``!`` key will start an `IPython` kernel and wait for connection from, e.g., `qtconsole`. Like other shells, `ipython_kernel` blocks the debugger diff --git a/examples/shell.py b/examples/shell.py index 73ec439f..9b3582b4 100644 --- a/examples/shell.py +++ b/examples/shell.py @@ -25,7 +25,7 @@ def pudb_shell(_globals, _locals): # Many shells only let you pass in a single locals dictionary, rather than # separate globals and locals dictionaries. In this case, you can use # pudb.shell.SetPropagatingDict to automatically merge the two into a - # single dictionary. It does this in such a way that assignments propogate + # single dictionary. It does this in such a way that assignments propagate # to _locals, so that when the debugger is at the module level, variables # can be reassigned in the shell. from pudb.shell import SetPropagatingDict diff --git a/examples/stringifier.py b/examples/stringifier.py index 41719205..80acbb2e 100644 --- a/examples/stringifier.py +++ b/examples/stringifier.py @@ -7,7 +7,7 @@ cannot fail. PuDB also includes built-in options for using str() and repr(). Note that str() and repr() will be slower than type(), which is especially -noticable when you have many variables, or some of your variables have very +noticeable when you have many variables, or some of your variables have very large string/repr representations. Also note that if you just want to change the type for one or two variables, diff --git a/pudb/debugger.py b/pudb/debugger.py index cd5b8c61..03ba4ed1 100644 --- a/pudb/debugger.py +++ b/pudb/debugger.py @@ -2828,7 +2828,7 @@ def event_loop(self, toplevel=None): "- Size changes in sidebar boxes (contributed by Aaron Meurer)\n" "- New theme 'midnight' (contributed by Aaron Meurer)\n" "- Support for IPython 0.11 (contributed by Chris Farrow)\n" - "- Suport for custom stringifiers " + "- Support for custom stringifiers " "(contributed by Aaron Meurer)\n" "- Line wrapping in variables view " "(contributed by Aaron Meurer)\n" @@ -2951,7 +2951,7 @@ def update_var_view(self, locals=None, globals=None, focus_index=None): locals, globals) if focus_index is not None: # Have to set the focus _after_ updating the locals list, as there - # appears to be a brief moment while reseting the list when the + # appears to be a brief moment while resetting the list when the # list is empty but urwid will attempt to set the focus anyway, # which causes problems. try: diff --git a/pudb/lowlevel.py b/pudb/lowlevel.py index 8064fb0b..bc37d111 100644 --- a/pudb/lowlevel.py +++ b/pudb/lowlevel.py @@ -201,7 +201,7 @@ def lookup_module(filename): def detect_encoding(line_iter): """ The detect_encoding() function is used to detect the encoding that should - be used to decode a Python source file. It requires one argment, line_iter, + be used to decode a Python source file. It requires one argument, line_iter, an iterator on the lines to be read. It will read a maximum of two lines, and return the encoding used diff --git a/pudb/test/test_lowlevel.py b/pudb/test/test_lowlevel.py index f7b0a278..1dfb4f61 100644 --- a/pudb/test/test_lowlevel.py +++ b/pudb/test/test_lowlevel.py @@ -74,7 +74,7 @@ def main(): conf = ''. \\ replace('', '') - conf_tpl = '' # <-- imposible to set breakpoint here + conf_tpl = '' # <-- impossible to set breakpoint here main() """ diff --git a/pyproject.toml b/pyproject.toml index 176f2b77..58a19c6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,3 +40,17 @@ addopts = [ "--ignore=pudb/b.py", "--ignore=pudb/ipython.py", ] + + +[tool.typos.default] +extend-ignore-re = [ + "(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line$" +] + +[tool.typos.default.extend-words] +# Ned Batchelder, person +Ned = "Ned" + +[tool.typos.files] +extend-exclude = [ +]