I've read over the documentation I could find on `...
# general
j
I've read over the documentation I could find on
./pants validate '**'
but I am not sure what it does. When I run it on my v2.2.3 repo I get a
KeyError: 'path_patterns'
error. I found it in
${GH:pantsbuild/pants}/build-support/pre-commit
script. What is it supposed to validate?
e
Yeah, the docs don't say much: https://www.pantsbuild.org/v2.2/docs/reference-validate If you guess well though and click the
sourcefile-validation
entry in the subsystems table you get more hints: https://www.pantsbuild.org/v2.2/docs/reference-sourcefile-validation Probably best is to look at Pants dogfooding of this goal: + https://github.com/pantsbuild/pants/blob/0429258b181986eed856ae45af93b776727774a0/pants.toml#L171-L172 + https://github.com/pantsbuild/pants/blob/main/build-support/regexes/config.yaml And ... with that last yaml you can see we use it to validate copyright headers. So, in short, you have to configure the validate goal to use it and it looks like it fails in an ugly way if not configured first. Once configured it'll scan for files matching patterns and then, scan those files contents for patterns that eithe must exist in them or must not exist in them.
🚀 1