Skip to content

Commit bab95d0

Browse files
author
Brian Kohan
committed
fix #75
1 parent 4fef214 commit bab95d0

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,13 @@ is accepted the following must be run, and static analysis tools should not prod
5353
warnings. Disabling certain errors or warnings where justified is acceptable:
5454

5555
```bash
56-
poetry run ruff format django_typer
57-
poetry run ruff check --fix --select I django_typer
58-
poetry run ruff check django_typer
59-
poetry run mypy django_typer
60-
pyright
61-
poetry check
62-
poetry run pip check
63-
poetry run python -m readme_renderer ./README.md
56+
./check.sh
57+
```
58+
59+
To run static analysis without automated fixing you can run:
60+
61+
```bash
62+
./check.sh --no-fix
6463
```
6564

6665
## Running Tests

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ Using the class-based interface we could define the command like this:
220220

221221
```
222222

223-
The typer-style interface builds a TyperCommand class for us. This allows you to optionally
224-
accept the self argument in your commands. We could define the above command using the typer
225-
interface like this:
223+
The typer-style interface builds a TyperCommand class for us. **This allows you to optionally accept the self argument in your commands.** We could define the above command using the typer interface like this:
226224

227225
```python
228226

django_typer/management/commands/shellcompletion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def get_completion() -> None:
589589
cmd_str=cmd_str
590590
)
591591
) from err
592-
raise # otherwise nowhere to go
592+
return # otherwise nowhere to go
593593

594594
if isinstance(cmd, TyperCommand): # type: ignore[unreachable]
595595
# this will exit out so no return is needed here

django_typer/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# conftest.py
22
def pytest_collection_modifyitems(items):
3-
"""Modifies test items in place to ensure test modules run in a given order."""
3+
"""Modifies test items in place to ensure plugin tests run in a specific order."""
44
sorted_tests = []
55
interference_tests = []
66
plugin_tests = [] # push these to the back

django_typer/tests/shellcompletion/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def read(fd):
143143
os.write(master_fd, (" ".join(cmds)).encode())
144144
time.sleep(0.5)
145145

146+
print(f'"{(" ".join(cmds))}"')
146147
os.write(master_fd, b"\t\t")
147148

148149
time.sleep(0.5)
@@ -160,7 +161,8 @@ def read(fd):
160161
os.close(master_fd)
161162
process.terminate()
162163
process.wait()
163-
return output
164+
# remove bell character which can show up in some terminals where we hit tab
165+
return output.replace("\x07", "")
164166

165167
def run_app_completion(self):
166168
completions = self.get_completions(self.launch_script, "completion", " ")
@@ -173,7 +175,7 @@ def run_app_completion(self):
173175
self.assertIn("staticfiles", completions)
174176

175177
def run_command_completion(self):
176-
completions = self.get_completions(self.launch_script, "complet", "")
178+
completions = self.get_completions(self.launch_script, "complet")
177179
self.assertIn("completion", completions)
178180
completions = self.get_completions(self.launch_script, " ")
179181
self.assertIn("makemigrations", completions)

doc/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ v2.0.0
88
This major version release, includes an extensive internal refactor, numerous bug fixes and the
99
addition of a plugin-based extension pattern.
1010

11+
* Fixed `Stack trace produced when attempted to tab-complete a non-existent management command. <https://github.com/bckohan/django-typer/issues/75>`_
1112
* Fixed `Overriding handle() in inherited commands results in multiple commands. <https://github.com/bckohan/django-typer/issues/74>`_
1213
* Implemented `Support subgroup name overloads. <https://github.com/bckohan/django-typer/issues/70>`_
1314
* Fixed `Helps from class docstrings and TyperCommand class parameters are not inherited. <https://github.com/bckohan/django-typer/issues/69>`_

0 commit comments

Comments
 (0)