Skip to content

Commit 8b18fef

Browse files
Use US spelling for consistency, plus add typos configuration to pyproject.toml.
1 parent ae37e94 commit 8b18fef

22 files changed

+75
-47
lines changed

CHANGELOG

+13-13
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ New features:
471471
* The color depth logic has been refactored and moved to the `Output`
472472
implementations. Added `get_default_color_depth` method to `Output`
473473
objects.
474-
* All line feets are now preceded by a carriage return in the telnet
474+
* All line feet are now preceded by a carriage return in the telnet
475475
connection stdout.
476476
- Introduce `REPLACE_SINGLE` input mode for Vi key bindings.
477477
- Improvements to the checkbox implementation:
@@ -1141,7 +1141,7 @@ Fixes:
11411141

11421142
New features:
11431143
- Allow users to enter Vi digraphs in reverse order.
1144-
- Improved autocompletion behaviour. See IPython issue #9658.
1144+
- Improved autocompletion behavior. See IPython issue #9658.
11451145
- Added a 'clear' function in the shortcuts module.
11461146

11471147
For future compatibility:
@@ -1162,7 +1162,7 @@ For future compatibility:
11621162

11631163
Fixes:
11641164
- Bugfix for Python2 in readline-like completion.
1165-
- Bugfix in readline-like completion visualisation.
1165+
- Bugfix in readline-like completion visualization.
11661166

11671167
New features:
11681168
- Added `erase_when_done` parameter to the `Application` class. (This was
@@ -1175,7 +1175,7 @@ New features:
11751175

11761176
Fixes:
11771177
- Don't select the first completion when `complete_while_typing` is False.
1178-
(Restore the old behaviour.)
1178+
(Restore the old behavior.)
11791179

11801180

11811181
1.0.1: 2016-06-15
@@ -1327,7 +1327,7 @@ Backwards-incompatible changes:
13271327
the `vi_mode` parameter in `KeyBindingManager`.
13281328
- The default accept_action for the default Buffer in Application now becomes
13291329
IGNORE. This is a much more sensible default. Pass RETURN_DOCUMENT to get
1330-
the previous behaviour,
1330+
the previous behavior,
13311331
- Always expect an EventLoop instance in CommandLineInterface. Creating it in
13321332
__init__ caused a memory leak.
13331333

@@ -1344,8 +1344,8 @@ Fixes:
13441344
- Correctly align right prompt to the top when the left prompt consists of
13451345
multiple lines.
13461346
- Correctly use Token.Transparent as default token for a TokenListControl.
1347-
- Fix in syntax synchronisation. (Better handle the case when no
1348-
synchronisation point was found.)
1347+
- Fix in syntax synchronization. (Better handle the case when no
1348+
synchronization point was found.)
13491349
- Send SIGTSTP to the whole process group.
13501350
- Correctly raise on_buffer_changed on all text changes.
13511351
- Fix in regular_languages.GrammarLexer. (Fixes bug in ptipython syntax
@@ -1403,7 +1403,7 @@ New features:
14031403
`create_prompt_layout`.
14041404
- Some improvements to the default style.
14051405
- Also handle Ctrl-R and Ctrl-S in Vi mode when searching.
1406-
- Added TabsProcessor: a tool to visualise tabs instead of displaying ^I.
1406+
- Added TabsProcessor: a tool to visualize tabs instead of displaying ^I.
14071407
- Give a better error message when trying to run in git-bash.
14081408
- Support for ANSI color names in style dictionaries.
14091409

@@ -1421,7 +1421,7 @@ New features:
14211421
they process one line at a time.)
14221422
- Lexers work differently. `Lexer.lex_document` should now return a function
14231423
that returns the tokens for one line. PygmentsLexer has been optimized that
1424-
it becomes 'lazy', and it has optional syntax synchronisation. That means,
1424+
it becomes 'lazy', and it has optional syntax synchronization. That means,
14251425
that the lexer doesn't have to start the lexing at the beginning of the
14261426
document. (Which would be slow for big documents.)
14271427

@@ -1672,7 +1672,7 @@ New features:
16721672
- Added `prompt_toolkit.layout.utils.iter_token_lines`.
16731673
- Allow `None` values on the focus stack.
16741674
- Buffers can be readonly. Added `IsReadOnly` filter.
1675-
- `eager` behaviour for key bindings. When a key binding is eager it will be
1675+
- `eager` behavior for key bindings. When a key binding is eager it will be
16761676
executed as soon as it's matched, even when there is another binding that
16771677
starts with this key sequence.
16781678
- Custom margins for BufferControl.
@@ -1738,7 +1738,7 @@ Fixes:
17381738
New features:
17391739
- CompletionsMenu got a scroll_offset.
17401740
- Use 256 colors and ANSI sequences when ConEmu ANSI support has been detected.
1741-
- Added PyperclipClipboard for synchronisation with the system clipboard.
1741+
- Added PyperclipClipboard for synchronization with the system clipboard.
17421742
and clipboard parameter in shortcut functions.
17431743
- Filter for enabling/disabling handling of Vi 'v' binding.
17441744

@@ -2033,7 +2033,7 @@ New features:
20332033
- prompt_toolkit.contrib.shortcuts.get_input has been extended.
20342034

20352035
Fixed:
2036-
- Behaviour of Control+left/right/up/down.
2036+
- Behavior of Control+left/right/up/down.
20372037
- Backspace in incremental search.
20382038
- Hide completion menu correctly when the cursor position changes.
20392039

@@ -2108,7 +2108,7 @@ New features:
21082108
- Experimental Win32 support added.
21092109

21102110
Fixed:
2111-
- Behaviour of 'r' and 'R' key bindings in Vi mode.
2111+
- Behavior of 'r' and 'R' key bindings in Vi mode.
21122112
- Detect multiline correctly for ptpython when there are triple quoted strings.
21132113
- Some other small improvements.
21142114

PROJECTS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Shells:
3737
- `athenacli <https://github.com/dbcli/athenacli>`_: A CLI for AWS Athena.
3838
- `vulcano <https://github.com/dgarana/vulcano>`_: A framework for creating command-line applications that also runs in REPL mode.
3939
- `kafka-shell <https://github.com/devshawn/kafka-shell>`_: A supercharged shell for Apache Kafka.
40-
- `starterTree <https://github.com/thomas10-10/starterTree>`_: A command launcher organised in a tree structure with fuzzy autocompletion
40+
- `starterTree <https://github.com/thomas10-10/starterTree>`_: A command launcher organized in a tree structure with fuzzy autocompletion
4141
- `git-delete-merged-branches <https://github.com/hartwork/git-delete-merged-branches>`_: Command-line tool to delete merged Git branches
4242

4343
Full screen applications:

docs/pages/advanced_topics/rendering_flow.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ What happens when a :class:`~prompt_toolkit.renderer.Renderer` objects wants a
3333
:class:`~prompt_toolkit.layout.Container` to be rendered on a certain
3434
:class:`~prompt_toolkit.layout.screen.Screen`?
3535

36-
The visualisation happens in several steps:
36+
The visualization happens in several steps:
3737

3838
1. The :class:`~prompt_toolkit.renderer.Renderer` calls the
3939
:meth:`~prompt_toolkit.layout.Container.write_to_screen` method

docs/pages/asking_for_input.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ Adding a right prompt
656656
---------------------
657657

658658
The :func:`~prompt_toolkit.shortcuts.prompt` function has out of the box
659-
support for right prompts as well. People familiar to ZSH could recognise this
659+
support for right prompts as well. People familiar to ZSH could recognize this
660660
as the `RPROMPT` option.
661661

662662
So, similar to adding a bottom toolbar, we can pass an ``rprompt`` argument.
@@ -706,7 +706,7 @@ Adding custom key bindings
706706
--------------------------
707707

708708
By default, every prompt already has a set of key bindings which implements the
709-
usual Vi or Emacs behaviour. We can extend this by passing another
709+
usual Vi or Emacs behavior. We can extend this by passing another
710710
:class:`~prompt_toolkit.key_binding.KeyBindings` instance to the
711711
``key_bindings`` argument of the :func:`~prompt_toolkit.shortcuts.prompt`
712712
function or the :class:`~prompt_toolkit.shortcuts.PromptSession` class.

docs/pages/full_screen_apps.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ Input processors
385385
A :class:`~prompt_toolkit.layout.processors.Processor` is used to postprocess
386386
the content of a :class:`~prompt_toolkit.layout.BufferControl` before it's
387387
displayed. It can for instance highlight matching brackets or change the
388-
visualisation of tabs and so on.
388+
visualization of tabs and so on.
389389

390390
A :class:`~prompt_toolkit.layout.processors.Processor` operates on individual
391391
lines. Basically, it takes a (formatted) line and produces a new (formatted)
@@ -410,11 +410,11 @@ Some build-in processors:
410410
+----------------------------------------------------------------------------+-----------------------------------------------------------+
411411
| :class:`~prompt_toolkit.layout.processors.AppendAutoSuggestion` | Append auto suggestion text. |
412412
+----------------------------------------------------------------------------+-----------------------------------------------------------+
413-
| :class:`~prompt_toolkit.layout.processors.ShowLeadingWhiteSpaceProcessor` | Visualise leading whitespace. |
413+
| :class:`~prompt_toolkit.layout.processors.ShowLeadingWhiteSpaceProcessor` | Visualize leading whitespace. |
414414
+----------------------------------------------------------------------------+-----------------------------------------------------------+
415-
| :class:`~prompt_toolkit.layout.processors.ShowTrailingWhiteSpaceProcessor` | Visualise trailing whitespace. |
415+
| :class:`~prompt_toolkit.layout.processors.ShowTrailingWhiteSpaceProcessor` | Visualize trailing whitespace. |
416416
+----------------------------------------------------------------------------+-----------------------------------------------------------+
417-
| :class:`~prompt_toolkit.layout.processors.TabsProcessor` | Visualise tabs as `n` spaces, or some symbols. |
417+
| :class:`~prompt_toolkit.layout.processors.TabsProcessor` | Visualize tabs as `n` spaces, or some symbols. |
418418
+----------------------------------------------------------------------------+-----------------------------------------------------------+
419419

420420
A :class:`~prompt_toolkit.layout.BufferControl` takes only one processor as

docs/pages/getting_started.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Several use cases: prompts versus full screen terminal applications
2121
--------------------------------------------------------------------
2222

2323
`prompt_toolkit` was in the first place meant to be a replacement for readline.
24-
However, when it became more mature, we realised that all the components for
24+
However, when it became more mature, we realized that all the components for
2525
full screen applications are there and `prompt_toolkit` is very capable of
2626
handling many use situations. `Pyvim
2727
<http://github.com/prompt-toolkit/pyvim>`_ and `pymux

docs/pages/progress_bars.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Both the title and the labels can be :ref:`formatted text <formatted_text>`.
127127
Formatting the progress bar
128128
---------------------------
129129

130-
The visualisation of a :class:`~prompt_toolkit.shortcuts.ProgressBar` can be
130+
The visualization of a :class:`~prompt_toolkit.shortcuts.ProgressBar` can be
131131
customized by using a different sequence of formatters. The default formatting
132132
looks something like this:
133133

examples/full-screen/split-screen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def get_titlebar_text():
9494
# sure that we won't wait for that key binding to match, but instead execute
9595
# Ctrl-Q immediately, we can pass eager=True. (Don't make a habit of adding
9696
# `eager=True` to all key bindings, but do it when it conflicts with another
97-
# existing key binding, and you definitely want to override that behaviour.
97+
# existing key binding, and you definitely want to override that behavior.
9898

9999

100100
@kb.add("c-c", eager=True)

examples/progress-bar/styled-rainbow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
"""
3-
A simple progress bar, visualised with rainbow colors (for fun).
3+
A simple progress bar, visualized with rainbow colors (for fun).
44
"""
55
import time
66

pyproject.toml

+28
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,31 @@ ignore = [
3636
[tool.ruff.isort]
3737
known-first-party = ["prompt_toolkit"]
3838
known-third-party = ["pygments", "asyncssh"]
39+
40+
[tool.typos.default]
41+
extend-ignore-re = [
42+
"Formicidae",
43+
"Iterm",
44+
"goes",
45+
"iterm",
46+
"prepend",
47+
"prepended",
48+
"prev",
49+
"ret",
50+
"rouble",
51+
"x1b\\[4m",
52+
# Deliberate spelling mistakes in autocorrection.py
53+
"wolrd",
54+
"impotr",
55+
# Lorem ipsum.
56+
"Nam",
57+
"varius",
58+
]
59+
60+
locale = 'en-us' # US English.
61+
62+
[tool.typos.files]
63+
extend-exclude = [
64+
"tests/test_cli.py",
65+
"tests/test_regular_languages.py",
66+
]

src/prompt_toolkit/contrib/regular_languages/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
---------------------------------
3131
3232
- Syntax highlighting: We could use this for instance to give file names
33-
different colour.
33+
different color.
3434
- Parse the result: .. We can extract the file names and commands by using a
3535
regular expression with named groups.
3636
- Input validation: .. Don't accept anything that does not match this grammar.

src/prompt_toolkit/input/posix_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class PosixStdinReader:
2626
On Python3, this can be 'surrogateescape', which is the default.
2727
2828
'surrogateescape' is preferred, because this allows us to transfer
29-
unrecognised bytes to the key bindings. Some terminals, like lxterminal
29+
unrecognized bytes to the key bindings. Some terminals, like lxterminal
3030
and Guake, use the 'Mxx' notation to send mouse events, where each 'x'
3131
can be any possible byte.
3232
"""

src/prompt_toolkit/layout/containers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,7 @@ def copy_line(
20502050
new_buffer_row[x + xpos] = char
20512051

20522052
# When we print a multi width character, make sure
2053-
# to erase the neighbours positions in the screen.
2053+
# to erase the neighbors positions in the screen.
20542054
# (The empty string if different from everything,
20552055
# so next redraw this cell will repaint anyway.)
20562056
if char_width > 1:
@@ -2537,7 +2537,7 @@ def do_scroll(
25372537
scroll_offset_end=offsets.right,
25382538
cursor_pos=get_cwidth(current_line_text[: ui_content.cursor_position.x]),
25392539
window_size=width - current_line_prefix_width,
2540-
# We can only analyse the current line. Calculating the width off
2540+
# We can only analyze the current line. Calculating the width off
25412541
# all the lines is too expensive.
25422542
content_size=max(
25432543
get_cwidth(current_line_text), self.horizontal_scroll + width

src/prompt_toolkit/layout/controls.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ class _ProcessedLine(NamedTuple):
491491

492492
class BufferControl(UIControl):
493493
"""
494-
Control for visualising the content of a :class:`.Buffer`.
494+
Control for visualizing the content of a :class:`.Buffer`.
495495
496496
:param buffer: The :class:`.Buffer` object to be displayed.
497497
:param input_processors: A list of
@@ -603,7 +603,7 @@ def preferred_width(self, max_available_width: int) -> int | None:
603603
width can be done by calculating the longest line, but this would
604604
require applying all the processors to each line. This is
605605
unfeasible for a larger document, and doing it for small
606-
documents only would result in inconsistent behaviour.
606+
documents only would result in inconsistent behavior.
607607
"""
608608
return None
609609

src/prompt_toolkit/layout/menus.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ def any_completion_has_meta() -> bool:
679679
filter=full_filter & show_meta & any_completion_has_meta,
680680
)
681681

682-
# Initialise split.
682+
# Initialize split.
683683
super().__init__([completions_window, meta_window], z_index=z_index)
684684

685685

src/prompt_toolkit/layout/processors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def apply_transformation(
288288

289289
if from_ == 0 and to == 0 and len(fragments) == 0:
290290
# When this is an empty line, insert a space in order to
291-
# visualise the selection.
291+
# visualize the selection.
292292
return Transformation([(selected_fragment, " ")])
293293
else:
294294
for i in range(from_, to):

src/prompt_toolkit/lexers/pygments.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
class SyntaxSync(metaclass=ABCMeta):
3333
"""
34-
Syntax synchroniser. This is a tool that finds a start position for the
34+
Syntax synchronizer. This is a tool that finds a start position for the
3535
lexer. This is especially important when editing big documents; we don't
3636
want to start the highlighting by running the lexer from the beginning of
3737
the file. That is very slow when editing.
@@ -67,12 +67,12 @@ class RegexSync(SyntaxSync):
6767
Synchronize by starting at a line that matches the given regex pattern.
6868
"""
6969

70-
# Never go more than this amount of lines backwards for synchronisation.
70+
# Never go more than this amount of lines backwards for synchronization.
7171
# That would be too CPU intensive.
7272
MAX_BACKWARDS = 500
7373

7474
# Start lexing at the start, if we are in the first 'n' lines and no
75-
# synchronisation position was found.
75+
# synchronization position was found.
7676
FROM_START_IF_NO_SYNC_POS_FOUND = 100
7777

7878
def __init__(self, pattern: str) -> None:
@@ -88,13 +88,13 @@ def get_sync_start_position(
8888
lines = document.lines
8989

9090
# Scan upwards, until we find a point where we can start the syntax
91-
# synchronisation.
91+
# synchronization.
9292
for i in range(lineno, max(-1, lineno - self.MAX_BACKWARDS), -1):
9393
match = pattern.match(lines[i])
9494
if match:
9595
return i, match.start()
9696

97-
# No synchronisation point found. If we aren't that far from the
97+
# No synchronization point found. If we aren't that far from the
9898
# beginning, start at the very beginning, otherwise, just try to start
9999
# at the current line.
100100
if lineno < self.FROM_START_IF_NO_SYNC_POS_FOUND:
@@ -228,7 +228,7 @@ def lex_document(self, document: Document) -> Callable[[int], StyleAndTextTuples
228228
line_generators: dict[LineGenerator, int] = {}
229229

230230
def get_syntax_sync() -> SyntaxSync:
231-
"The Syntax synchronisation object that we currently use."
231+
"The Syntax synchronization object that we currently use."
232232
if self.sync_from_start():
233233
return SyncFromStart()
234234
else:
@@ -271,7 +271,7 @@ def get_generator(i: int) -> LineGenerator:
271271
return generator
272272

273273
# No generator found. Determine starting point for the syntax
274-
# synchronisation first.
274+
# synchronization first.
275275

276276
# Go at least x lines back. (Make scrolling upwards more
277277
# efficient.)
@@ -291,7 +291,7 @@ def get_generator(i: int) -> LineGenerator:
291291
generator = create_line_generator(row, column)
292292

293293
# If the column is not 0, ignore the first line. (Which is
294-
# incomplete. This happens when the synchronisation algorithm tells
294+
# incomplete. This happens when the synchronization algorithm tells
295295
# us to start parsing in the middle of a line.)
296296
if column:
297297
next(generator)
@@ -316,7 +316,7 @@ def get_line(i: int) -> StyleAndTextTuples:
316316
# Remove the next item from the cache.
317317
# (It could happen that it's already there, because of
318318
# another generator that started filling these lines,
319-
# but we want to synchronise these lines with the
319+
# but we want to synchronize these lines with the
320320
# current lexer's state.)
321321
if num + 1 in cache:
322322
del cache[num + 1]

src/prompt_toolkit/output/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def flush(self) -> None:
6666
@abstractmethod
6767
def erase_screen(self) -> None:
6868
"""
69-
Erases the screen with the background colour and moves the cursor to
69+
Erases the screen with the background color and moves the cursor to
7070
home.
7171
"""
7272

0 commit comments

Comments
 (0)