https://pantsbuild.org/ logo
#development
Title
# development
b

bitter-ability-32190

01/07/2022, 2:29 PM
If I specify an invalid file in a
python_source
target, I get a rather misleading error 🤔
Copy code
pants.engine.target.InvalidFieldException: The 'source' field in target src/to/target:the_target must have 1 file, but it had 0 files.
Stacktrace shows:
"/home/joshuacannon/work/pants/src/python/pants/engine/target.py", line 1616
as the raiser
w

witty-crayon-22786

01/07/2022, 6:11 PM
mm… rather than validating where it does,
SingleSourceField
should probably override
default_glob_match_error_behavior
to fail, which would cause it to fail before the validation with a better message
you get a warning rendered first, yea?
b

bitter-ability-32190

01/07/2022, 6:14 PM
Oh hey check that out 😂 I was too dumb to look above the red error to see the yellow warn 😂
w

witty-crayon-22786

01/07/2022, 6:14 PM
still! this should be fixed
🙌 1