Skip to content

πŸ› fix(env): report unknown factors passed to -f - #4537

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
Harp404:fix-unknown-factor
Dec 1, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
Harp404:fix-unknown-factor

Conversation

@Harp404

@Harp404 Harp404 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

-f with a factor that appears in no environment name selected nothing and said nothing: tox list printed an empty list and tox run only evaluation failed :(. tox now reports each unknown factor with its closest match, as #4478 does for -m labels. A value with a stray dash (py39-, py39--django20) is reported as given and suggested without the dash. As with -m, one unknown factor fails the command even when another -f group selects environments. The check is skipped when tox will provision, like the label check.

$ cat > tox.ini <<'EOF'
[tox]
env_list = py3{10,9}-{django20,django21}
[testenv]
package = skip
EOF
$ tox l -f djano20 -f py39-

Output before (-) and after (+) this change:

+ROOT: HandledError| provided factors not found in any environment name:
+djano20 - did you mean django20?
+py39- - did you mean py39?

Harp404 and others added 2 commits December 1, 2026 09:03
A stray dash (-f py39-) left an empty factor that printed as a blank
line. Show the value as given, suggest it without the dash only when
every remaining factor exists, and list a repeated value once. Document
the check and note that one unknown factor fails every -f group.
@gaborbernat gaborbernat changed the title Report unknown factors passed to -f πŸ› fix(env): report unknown factors passed to -f Dec 1, 2026
@Harp404
Harp404 marked this pull request as ready for review December 1, 2026 18:34
@Harp404
Harp404 requested a review from rahuldevikar as a code owner December 1, 2026 18:34
Copilot AI balanced review requested due to automatic review settings December 1, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@gaborbernat
gaborbernat merged commit 9cb06c5 into tox-dev:main Dec 1, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants