Skip to content

Commit f1eaa76

Browse files
Make --typecheck default to false for usethis init (#1538)
* Initial plan * Make --typecheck default to false for usethis init Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/8d22ff93-1402-4a87-827e-ef25c89fa78a * Fix indentation in test_hook_included closing paren Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/8d22ff93-1402-4a87-827e-ef25c89fa78a * Update docs to reflect --typecheck defaulting to false Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/d3fd89e4-016d-4137-b9cd-b260d4f41c4b --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
1 parent cac3015 commit f1eaa76

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

docs/cli/reference.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
Initialize a new Python project with recommended defaults, including:
66

77
- a `pyproject.toml` file and relevant configuration,
8-
- recommended linters, formatters, spellcheckers, type checkers, and test frameworks (all opt-out),
8+
- recommended linters, formatters, spellcheckers, and test frameworks (all opt-out),
9+
- a recommended type checker (opt-in),
910
- docstring style enforcement (opt-in),
1011
- a recommended git hook framework (opt-in),
1112
- CI services (opt-in),
@@ -20,7 +21,7 @@ Supported options:
2021
- `--lint` to add recommended linters (default; or `--no-lint` to opt-out)
2122
- `--spellcheck` to add a recommended spellchecker (default; or `--no-spellcheck` to opt-out)
2223
- `--test` to add a recommended testing framework (default; or `--no-test` to opt-out)
23-
- `--typecheck` to add a recommended type checker (default; or `--no-typecheck` to opt-out)
24+
- `--typecheck` to add a recommended type checker (but the default is `--no-typecheck`)
2425
- `--hook` to add a recommended git hook framework (but the default is `--no-hook`)
2526
- `--docstyle` to set a docstring style convention for the project.
2627

src/usethis/_ui/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
help="Add a recommended testing framework.",
7070
)
7171
init_typecheck_opt = typer.Option(
72-
True,
72+
False,
7373
"--typecheck/--no-typecheck",
7474
help="Add a recommended type checker.",
7575
)

tests/usethis/_ui/interface/test_init.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ def test_hook_included(self, tmp_path: Path):
4747
"☐ Add test functions with the format 'test_*()'.\n"
4848
"☐ Run 'uv run pytest' to run the tests.\n"
4949
"☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
50-
"✔ Adding recommended type checkers.\n"
51-
"☐ Run 'uv run ty check' to run the ty type checker.\n"
5250
)
5351

5452
# Check the pre-commit hooks are added in the correct order
@@ -59,7 +57,6 @@ def test_hook_included(self, tmp_path: Path):
5957
"pyproject-fmt",
6058
"ruff-check",
6159
"ruff-format",
62-
"ty",
6360
"deptry",
6461
"codespell",
6562
]
@@ -118,8 +115,6 @@ def test_arch_included(self, tmp_path: Path):
118115
"☐ Add test functions with the format 'test_*()'.\n"
119116
"☐ Run 'uv run pytest' to run the tests.\n"
120117
"☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
121-
"✔ Adding recommended type checkers.\n"
122-
"☐ Run 'uv run ty check' to run the ty type checker.\n"
123118
"✔ Adding recommended architecture analysis tools.\n"
124119
"☐ Run 'uv run lint-imports' to run Import Linter.\n"
125120
)
@@ -169,9 +164,6 @@ def test_none_backend(self, tmp_path: Path):
169164
"☐ Add test functions with the format 'test_*()'.\n"
170165
"☐ Run 'pytest' to run the tests.\n"
171166
"☐ Run 'pytest --cov' to run your tests with Coverage.py.\n"
172-
"✔ Adding recommended type checkers.\n"
173-
"☐ Add the dev dependency 'ty'.\n"
174-
"☐ Run 'ty check' to run the ty type checker.\n"
175167
)
176168

177169
def test_build_backend_uv(self, tmp_path: Path):

0 commit comments

Comments
 (0)