Skip to content

Commit 60b7123

Browse files
authored
Merge branch 'main' into add_argtypes_with_test
2 parents 37d0709 + 21657a6 commit 60b7123

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1259
-1901
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ plugins/* @anselor
5959

6060
# Unit and Integration Tests
6161
tests/* @kmvanbrunt @tleonhardt
62-
tests_isolated/* @anselor
6362

6463
# Top-level project stuff
6564
.coveragerc @tleonhardt

.github/CONTRIBUTING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,9 @@ This bit is up to you!
346346

347347
The cmd2 project directory structure is pretty simple and straightforward. All actual code for cmd2
348348
is located underneath the `cmd2` directory. The code to generate the documentation is in the `docs`
349-
directory. Unit tests are in the `tests` directory. Integration tests are in the `tests_isolated`
350-
directory. The `examples` directory contains examples of how to use cmd2. There are various other
351-
files in the root directory, but these are primarily related to continuous integration and release
352-
deployment.
349+
directory. Unit and integration tests are in the `tests` directory. The `examples` directory
350+
contains examples of how to use cmd2. There are various other files in the root directory, but these
351+
are primarily related to continuous integration and release deployment.
353352

354353
#### Changes to the documentation files
355354

.github/workflows/tests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ jobs:
3838
- name: Run tests
3939
run: uv run python -Xutf8 -m pytest --cov --cov-config=pyproject.toml --cov-report=xml tests
4040

41-
- name: Run isolated tests
42-
run:
43-
uv run python -Xutf8 -m pytest --cov --cov-config=pyproject.toml --cov-report=xml
44-
tests_isolated
45-
4641
- name: Upload test results to Codecov
4742
if: ${{ !cancelled() }}
4843
uses: codecov/test-results-action@v1

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ time reading the [rich documentation](https://rich.readthedocs.io/).
2424
`value` property
2525
- Removed redundant setting of a parser's `prog` value in the `with_argparser()` decorator, as
2626
this is now handled centrally in `Cmd._build_parser()`
27+
- The `auto_load_commands` argument to `cmd2.Cmd.__init__` now defaults to `False`
2728

2829
- Enhancements
2930
- Enhanced all print methods (`poutput()`, `perror()`, `ppaged()`, etc.) to natively render

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ typecheck: ## Perform type checking
3434
test: ## Test the code with pytest.
3535
@echo "🚀 Testing code: Running pytest"
3636
@uv run python -Xutf8 -m pytest --cov --cov-config=pyproject.toml --cov-report=xml tests
37-
@uv run python -Xutf8 -m pytest --cov --cov-config=pyproject.toml --cov-report=xml tests_isolated
3837

3938
.PHONY: docs-test
4039
docs-test: ## Test if documentation can be built without warnings or errors

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def __init__(
323323
terminators: list[str] | None = None,
324324
shortcuts: dict[str, str] | None = None,
325325
command_sets: Iterable[CommandSet] | None = None,
326-
auto_load_commands: bool = True,
326+
auto_load_commands: bool = False,
327327
allow_clipboard: bool = True,
328328
suggest_similar_command: bool = False,
329329
) -> None:

cmd2/rich_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ def _apply_style_wrapper(cls: type[Segment], *args: Any, **kwargs: Any) -> Itera
416416
styled_segments = list(_orig_segment_apply_style(*args, **kwargs))
417417
newline_segment = cls.line()
418418

419-
# If the final segment is a newline, it will be stripped by Segment.split_lines().
419+
# If the final segment ends in a newline, that newline will be stripped by Segment.split_lines().
420420
# Save an unstyled newline to restore later.
421-
end_segment = newline_segment if styled_segments and styled_segments[-1].text == "\n" else None
421+
end_segment = newline_segment if styled_segments and styled_segments[-1].text.endswith("\n") else None
422422

423423
# Use Segment.split_lines() to separate the styled text from the newlines.
424424
# This way the ANSI reset code will appear before any newline.

codecov.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ component_management:
1414
ignore:
1515
- "examples" # ignore example code folder
1616
- "tests" # ignore unit test code folder
17-
- "tests_isolated" # ignore integration test code folder

docs/api/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
These pages document the public API for `cmd2`. If a method, class, function, attribute, or constant
44
is not documented here, consider it private and subject to change. There are many classes, methods,
5-
functions, and constants in the source code which do not begin with an underscore but are not
5+
functions, and constants in the source code that do not begin with an underscore but are not
66
documented here. When looking at the source code for this library, you cannot safely assume that
7-
because something doesn't start with an underscore, it is a public API.
7+
something is a public API just because it doesn't start with an underscore.
88

99
If a release of this library changes any of the items documented here, the version number will be
1010
incremented according to the [Semantic Version Specification](https://semver.org).
@@ -18,7 +18,7 @@ incremented according to the [Semantic Version Specification](https://semver.org
1818
- [cmd2.colors](./colors.md) - StrEnum of all color names supported by the Rich library
1919
- [cmd2.command_definition](./command_definition.md) - supports the definition of commands in
2020
separate classes to be composed into cmd2.Cmd
21-
- [cmd2.constants](./constants.md) - just like it says on the tin
21+
- [cmd2.constants](./constants.md) - constants used in `cmd2`
2222
- [cmd2.decorators](./decorators.md) - decorators for `cmd2` commands
2323
- [cmd2.exceptions](./exceptions.md) - custom `cmd2` exceptions
2424
- [cmd2.history](./history.md) - classes for storing the history of previously entered commands

docs/doc_conventions.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ In Markdown all indenting is significant. Use 4 spaces per indenting level.
3636

3737
## Wrapping
3838

39-
Hard wrap all text so that line lengths are no greater than 120 characters. It makes everything
39+
Hard wrap all text so that line lengths are no greater than 100 characters. It makes everything
4040
easier when editing documentation, and has no impact on reading documentation because we render to
4141
html.
4242

@@ -75,9 +75,13 @@ When using `mkdocstrings`, it must be preceded by a blank line before and after,
7575

7676
### Links to API Reference
7777

78-
To reference a method or function, do the following:
78+
To reference a class, method, or function, use block quotes around the name of the full namespace
79+
path for it followed by empty block quotes. So to reference `cmd2.Cmd`, you use `[cmd2.Cmd][]`.
7980

80-
TODO: Figure out how to do this
81+
If you want to change the name to use something shorter than the full namespace resolution you can
82+
put the full path in the 2nd set of block quotes instead of leaving it empty and put the shorter
83+
name in the one on the left. So you could also use `[Cmd][cmd2.Cmd]` to link to the API
84+
documentation for `cmd2.Cmd`.
8185

8286
## Referencing cmd2
8387

0 commit comments

Comments
 (0)