Skip to content

Commit 046a220

Browse files
WorkerPantstdyas
andauthored
update pants peek docs with latest outputs (Cherry-pick of #22051) (#22053)
Fix #20885 by updating the documentation for `pants peek` to reflect the current structure of the JSON output. Closes #20885 Co-authored-by: Tom Dyas <[email protected]>
1 parent 7b4f841 commit 046a220

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

docs/docs/using-pants/project-introspection.mdx

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -230,29 +230,29 @@ helloworld/greet/translations.json
230230
`peek` outputs JSON for each target specified.
231231

232232
```bash
233-
$ pants peek helloworld/util:tests
233+
$ pants peek helloworld/greet:tests
234234
[
235235
{
236-
"address": "helloworld/util:tests",
236+
"address": "helloworld/greet:tests",
237237
"target_type": "python_tests",
238-
"dependencies": null,
238+
"dependencies": [
239+
"helloworld/greet/greeting_test.py:tests"
240+
],
239241
"description": null,
240-
"interpreter_constraints": null,
242+
"overrides": null,
241243
"skip_black": false,
242244
"skip_docformatter": false,
243-
"skip_flake8": true,
245+
"skip_flake8": false,
244246
"skip_isort": false,
245247
"skip_mypy": false,
246248
"sources": [
247-
"*.py",
248-
"*.pyi",
249-
"!test_*.py",
250-
"!*_test.py",
251-
"!tests.py",
252-
"!conftest.py",
253-
"!test_*.pyi",
254-
"!*_test.pyi",
255-
"!tests.pyi"
249+
"helloworld/greet/greeting_test.py"
250+
],
251+
"sources_fingerprint": "2158e096d5ab63e537d88067b50a0274b83f6373143faf854d4a9adf5d01cf78",
252+
"sources_raw": [
253+
"test_*.py",
254+
"*_test.py",
255+
"tests.py"
256256
],
257257
"tags": null
258258
}
@@ -262,12 +262,18 @@ $ pants peek helloworld/util:tests
262262
You can use `--exclude-defaults` for less verbose output:
263263

264264
```bash
265-
$ pants peek --exclude-defaults helloworld/util:tests
265+
$ pants peek --exclude-defaults helloworld/greet:tests
266266
[
267267
{
268-
"address": "helloworld/util:tests",
268+
"address": "helloworld/greet:tests",
269269
"target_type": "python_tests",
270-
"skip_flake8": true,
270+
"dependencies": [
271+
"helloworld/greet/greeting_test.py:tests"
272+
],
273+
"sources": [
274+
"helloworld/greet/greeting_test.py"
275+
],
276+
"sources_fingerprint": "2158e096d5ab63e537d88067b50a0274b83f6373143faf854d4a9adf5d01cf78"
271277
}
272278
]
273279
```
@@ -288,7 +294,7 @@ helloworld/util:lib
288294
Some introspection goals, such as `filter`, `dependencies` and `dependents` emit a flat list of target addresses. It's often useful to expand each of those into a full JSON structure with detailed properties of each target, by piping to `pants peek`:
289295

290296
```bash
291-
pants dependents helloworld/main.py:lib | xargs pants peek --exclude-defaults
297+
$ pants dependents helloworld/main.py:lib | xargs pants peek --exclude-defaults
292298
[
293299
{
294300
"address": "helloworld:lib",
@@ -300,7 +306,8 @@ pants dependents helloworld/main.py:lib | xargs pants peek --exclude-defaults
300306
"sources": [
301307
"helloworld/__init__.py",
302308
"helloworld/main.py"
303-
]
309+
],
310+
"sources_fingerprint": "74841d8cb2060cf9a4c2aa20f77c2a1a44af4799188a5820e513776fd3fe973c"
304311
},
305312
{
306313
"address": "helloworld:pex_binary",
@@ -311,7 +318,11 @@ pants dependents helloworld/main.py:lib | xargs pants peek --exclude-defaults
311318
"entry_point": {
312319
"module": "main.py",
313320
"function": null
314-
}
321+
},
322+
"goals": [
323+
"package",
324+
"run"
325+
]
315326
}
316327
]
317328
```

0 commit comments

Comments
 (0)