• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 19256696112

11 Nov 2025 06:07AM UTC coverage: 80.279% (-0.005%) from 80.284%
19256696112

push

github

web-flow
flag non-runnable targets used with `code_quality_tool` (Cherry-pick of #22875) (#22876)

Raise an exception when a non-runnable target is set as the `runnable`
for `code_quality_tool` (and other similar uses). Otherise, the user
sees an obtuse `IndexError`.

Before:

```
IndexError: tuple index out of range
```

After:

```
pants.engine.target.InvalidFieldException: The `runnable` field in target `pants-macros:gofmt_tool` must be set to the address of a target which can be run by the `run` goal. Instead, the `runnable` field is set to `:gofmt` which refers to the `adhoc_tool` target at `pants-macros:gofmt` that cannot be run by the `run` goal.
```

This particular error arose while I was trying to run `gofmt` as a
`code_quality_tool`.

Co-authored-by: Tom Dyas <tom@shoalsoftware.com>

2 of 5 new or added lines in 2 files covered. (40.0%)

4 existing lines in 3 files now uncovered.

77969 of 97122 relevant lines covered (80.28%)

3.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.69
/src/python/pants/pantsd/lock_test.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc