You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cli/reference.md
+28-2Lines changed: 28 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Initialize a new Python project with recommended defaults, including:
7
7
- a `pyproject.toml` file and relevant configuration,
8
8
- recommended linters, formatters, spellcheckers, type checkers, and test frameworks (all opt-out),
9
9
- docstring style enforcement (opt-in),
10
-
-the pre-commit framework (opt-in),
10
+
-a recommended git hook framework (opt-in),
11
11
- CI services (opt-in),
12
12
- declared & installed dependencies via `uv add`, and
13
13
- any other relevant directories or tool-bespoke configuration files.
@@ -21,7 +21,7 @@ Supported options:
21
21
-`--spellcheck` to add a recommended spellchecker (default; or `--no-spellcheck` to opt-out)
22
22
-`--test` to add a recommended testing framework (default; or `--no-test` to opt-out)
23
23
-`--typecheck` to add a recommended type checker (default; or `--no-typecheck` to opt-out)
24
-
-`--pre-commit` to add the pre-commit framework for git hooks (but the default is `--no-pre-commit`)
24
+
-`--hook` to add a recommended git hook framework (but the default is `--no-hook`)
25
25
-`--ci` to add a CI service configuration
26
26
27
27
Possible values:
@@ -124,6 +124,32 @@ Supported options:
124
124
125
125
See [`usethis tool`](#usethis-tool) for more information.
126
126
127
+
## `usethis hook`
128
+
129
+
Add a recommended git hook framework to the project (namely, [pre-commit](https://github.com/pre-commit/pre-commit)), including:
130
+
131
+
- declared & installed dependencies via `uv add`,
132
+
- relevant configuration, and
133
+
- any other relevant directories or tool-bespoke configuration files.
134
+
135
+
Note if `pyproject.toml` is not present, it will be created, since this is required for declaring dependencies via `uv add`.
136
+
137
+
Supported options:
138
+
139
+
-`--remove` to remove the tool instead of adding it
140
+
-`--how` to only print how to use the tool, with no other side effects
141
+
-`--offline` to disable network access and rely on caches
142
+
-`--frozen` to leave the virtual environment and lockfile unchanged
143
+
-`--quiet` to suppress output
144
+
-`--backend` to specify a package manager backend to use. The default is to auto-detect.
145
+
146
+
Possible values:
147
+
-`auto` to auto-detect the backend (default)
148
+
-`uv` to use the [uv](https://docs.astral.sh/uv) package manager
149
+
-`none` to not use a package manager backend and display messages for some operations.
150
+
151
+
See [`usethis tool`](#usethis-tool) for more information.
152
+
127
153
## `usethis lint`
128
154
129
155
Add recommended linters to the project (namely, [Ruff](https://docs.astral.sh/ruff/linter) and [deptry](https://github.com/fpgmaas/deptry)), including:
0 commit comments