Skip to content

Commit 2de4b2c

Browse files
authored
Merge branch 'main' into tweaks
2 parents d8f198e + c8c5ca8 commit 2de4b2c

18 files changed

+47
-27
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,12 @@ The one plugin we consider essential for PyCharm is
644644
[RyeCharm](https://plugins.jetbrains.com/plugin/25230-ryecharm). `RyeCharm` is an all-in-one PyCharm
645645
plugin for [Astral](https://astral.sh/)-backed Python tools: [uv](https://github.com/astral-sh/uv),
646646
[Ruff](https://github.com/astral-sh/ruff), and [ty](https://github.com/astral-sh/ty). NOTE: `ty`
647-
support is provisional as that new type checker is in early alpha developement.
647+
support is provisional as that new type checker is in early alpha development.
648648

649649
#### VSCode Settings
650650

651651
While **VSCode** is a phenomenal IDE for developing in Python, the out-of-the-box experience leaves
652-
a lot to be desired. You will need to install a number of extenstions and tweak the default
652+
a lot to be desired. You will need to install a number of extensions and tweak the default
653653
configuration for many of them in order to get an optimal developer experience.
654654

655655
Recommended VSCode extensions:

.github/workflows/quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ jobs:
2929
python-version: "3.14"
3030
- name: Install the project
3131
run: uv sync --group quality
32-
- name: Run pre-commit
33-
run: uv run pre-commit run -a --show-diff-on-failure
32+
- name: Run prek
33+
run: uv run prek run -a --show-diff-on-failure

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ repos:
33
rev: "v6.0.0"
44
hooks:
55
- id: check-case-conflict
6+
- id: check-executables-have-shebangs
67
- id: check-merge-conflict
78
- id: check-toml
9+
- id: check-yaml
10+
- id: detect-private-key
811
- id: end-of-file-fixer
12+
- id: fix-byte-order-marker
13+
- id: mixed-line-ending
914
- id: trailing-whitespace
1015

1116
- repo: https://github.com/astral-sh/ruff-pre-commit
@@ -23,3 +28,13 @@ repos:
2328
additional_dependencies:
2429
- prettier@3.8.1
2530
- prettier-plugin-toml@2.0.6
31+
32+
- repo: https://github.com/crate-ci/typos
33+
rev: v1.44.0
34+
hooks:
35+
- id: typos
36+
exclude: |
37+
(?x)^(
38+
ruff.toml|
39+
tests/.*
40+
)$

.typos.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[default.extend-words]
2+
EXPLIoT = "EXPLIoT"
3+
Counterfit = "Counterfit"
4+
expliot = "expliot"
5+
counterfit = "counterfit"

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ install: ## Install the virtual environment with dependencies
77
@echo "🚀 Creating uv Python virtual environment"
88
@uv python install 3.14
99
@uv sync --python=3.14
10-
@echo "🚀 Installing Git pre-commit hooks locally"
11-
@uv run pre-commit install
10+
@echo "🚀 Installing Git prek hooks locally"
11+
@uv run prek install -f
1212
@echo "🚀 Installing Prettier using npm"
1313
@npm install -q --no-fund --include=dev
1414

1515
.PHONY: check
1616
check: ## Run code quality tools.
1717
@echo "🚀 Checking lock file consistency with 'pyproject.toml'"
1818
@uv lock --locked
19-
@echo "🚀 Linting code and documentation: Running pre-commit"
20-
@uv run pre-commit run -a
19+
@echo "🚀 Auto-formatting/Linting code and documentation: Running prek"
20+
@uv run prek run -a
2121
@echo "🚀 Static type checking: Running mypy"
2222
@uv run mypy
2323

README.md

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ examples.
107107
- [cmd2 example applications](https://github.com/python-cmd2/cmd2/tree/main/examples)
108108
- Basic cmd2 examples to demonstrate how to use various features
109109
- [Advanced Examples](https://github.com/jayrod/cmd2-example-apps)
110-
- More complex examples that demonstrate more featuers about how to put together a complete
110+
- More complex examples that demonstrate more features about how to put together a complete
111111
application
112112
- [Cookiecutter](https://github.com/cookiecutter/cookiecutter) Templates from community
113113
- Basic cookiecutter template for cmd2 application :

cmd2/argparse_custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,14 +397,14 @@ def __init__(
397397

398398
@property
399399
def choices_provider(self) -> ChoicesProviderUnbound[CmdOrSet]:
400-
"""Retreive the internal choices_provider function."""
400+
"""Retrieve the internal choices_provider function."""
401401
if self.is_completer:
402402
raise AttributeError("This instance is configured as a completer, not a choices_provider")
403403
return cast(ChoicesProviderUnbound[CmdOrSet], self.to_call)
404404

405405
@property
406406
def completer(self) -> CompleterUnbound[CmdOrSet]:
407-
"""Retreive the internal completer function."""
407+
"""Retrieve the internal completer function."""
408408
if not self.is_completer:
409409
raise AttributeError("This instance is configured as a choices_provider, not a completer")
410410
return cast(CompleterUnbound[CmdOrSet], self.to_call)

cmd2/cmd2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def remove(self, command_method: CommandFunc) -> None:
292292

293293
@dataclass(kw_only=True)
294294
class AsyncAlert:
295-
"""Contents of an asynchonous alert which display while user is at prompt.
295+
"""Contents of an asynchronous alert which display while user is at prompt.
296296
297297
:param msg: an optional message to be printed above the prompt.
298298
:param prompt: an optional string to dynamically replace the current prompt.
@@ -605,7 +605,7 @@ def __init__(
605605
# Command parsers for this Cmd instance.
606606
self._command_parsers: _CommandParsers = _CommandParsers(self)
607607

608-
# Members related to printing asychronous alerts
608+
# Members related to printing asynchronous alerts
609609
self._alert_queue: deque[AsyncAlert] = deque()
610610
self._alert_condition = threading.Condition()
611611
self._alert_allowed = False
@@ -3505,7 +3505,7 @@ def _pre_prompt() -> None:
35053505
self._alert_allowed = False
35063506

35073507
def _cmdloop(self) -> None:
3508-
"""Repeatedly issue a prompt, accept input, parse it, and dispatch to apporpriate commands.
3508+
"""Repeatedly issue a prompt, accept input, parse it, and dispatch to appropriate commands.
35093509
35103510
Parse an initial prefix off the received input and dispatch to action methods, passing them
35113511
the remainder of the line as argument.

docs/doc_conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ or [The Markdown Guide](https://www.markdownguide.org/) for a more complete refe
4949

5050
Code blocks can be created in two ways:
5151

52-
- Indent the block - this will show as a monospace code block, but won't include highighting
52+
- Indent the block - this will show as a monospace code block, but won't include highlighting
5353
- use the triple backticks followed by the code language, e.g. `python` and close with triple
5454
backticks
5555

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ each:
4242
- Demonstrates usage of `@with_default_category` decorator to group and categorize commands and
4343
`CommandSet` use
4444
- [dynamic_commands.py](https://github.com/python-cmd2/cmd2/blob/main/examples/dynamic_commands.py)
45-
- Shows how `do_*` commands can be dynamically created programatically at runtime
45+
- Shows how `do_*` commands can be dynamically created programmatically at runtime
4646
- [environment.py](https://github.com/python-cmd2/cmd2/blob/main/examples/environment.py)
4747
- Shows how to create custom `cmd2.Settable` parameters which serve as internal environment
4848
variables
@@ -63,7 +63,7 @@ each:
6363
- Shows how to use various `cmd2` application lifecycle hooks
6464
- [migrating.py](https://github.com/python-cmd2/cmd2/blob/main/examples/migrating.py)
6565
- A simple `cmd` application that you can migrate to `cmd2` by changing one line
66-
- [modular_commands.py](https://github.com/python-cmd2/cmd2/blob/main/examples/modular_commands.py)
66+
- [modular_commandsets.py](https://github.com/python-cmd2/cmd2/blob/main/examples/modular_commandsets.py)
6767
- Complex example demonstrating a variety of methods to load `CommandSets` using a mix of
6868
command decorators
6969
- [paged_output.py](https://github.com/python-cmd2/cmd2/blob/main/examples/paged_output.py)

0 commit comments

Comments
 (0)