Skip to content

Commit ca5d65b

Browse files
Respond to review
1 parent f26f530 commit ca5d65b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,17 @@ to process the exported graph. For instance, you could:
161161
```bash
162162
$ pants dependencies --filter-target-type=python_test --format=json :: \
163163
| jq -r 'to_entries[] | "\(.key)\t\(.value | length)"' \
164-
| sort -k2
164+
| sort -k2 -n
165165
```
166166

167-
* find build targets that no one depends on
167+
* find resources that only a few other targets depend on
168168

169169
```bash
170170
$ pants dependents --filter-target-type=resource --format=json :: \
171-
jq -r 'to_entries[] | select(.value | length == 0)'
171+
| jq -r 'to_entries[] | select(.value | length < 2)'
172172
```
173173

174-
* find project source files that transitively lead to most tests
174+
* find files within the `src/` directory that transitively lead to the most tests
175175

176176
```python
177177
# depgraph.py
@@ -185,8 +185,8 @@ for source, dependents in data.items():
185185
```
186186

187187
```bash
188-
$ pants dependents --transitive --format=json cheeseshop:: > data.json
189-
$ python3 depgraph.py | sort -k2
188+
$ pants dependents --transitive --format=json src:: > data.json
189+
$ python3 depgraph.py | sort -k2 -n
190190
```
191191

192192
For more sophisticated graph querying, you may want to look into graph libraries such as [`networkx`](https://networkx.org/).

0 commit comments

Comments
 (0)