https://pantsbuild.org/ logo
#general
Title
# general
l

loud-laptop-17949

10/21/2021, 11:49 PM
newbie question - I am trying to get started with pants in our repo and am running into this error but can't seem to find any pointers on how to configure the validate goal
my error output–
Copy code
pants --print-stacktrace validate
16:42:28.78 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 236, in _run_inner
    return self._perform_run(goals)
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 175, in _perform_run
    return self._perform_run_body(goals, poll=False)
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 192, in _perform_run_body
    return self.graph_session.run_goal_rules(
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/init/engine_initializer.py", line 135, in run_goal_rules
    exit_code = self.scheduler_session.run_goal_rule(
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/engine/internals/scheduler.py", line 538, in run_goal_rule
    self._raise_on_error([t for _, t in throws])
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/engine/internals/scheduler.py", line 497, in _raise_on_error
    raise ExecutionError(

Exception message: 1 Exception encountered:

Engine traceback:
  in select
  in pants.backend.project_info.source_file_validator.validate
Traceback (most recent call last):
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 695, in native_engine_generator_send
    res = func.send(arg)
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/backend/project_info/source_file_validator.py", line 287, in validate
    multi_matcher = source_file_validation.get_multi_matcher()
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/util/memo.py", line 123, in memoize
    result = func(*args, **kwargs)
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/backend/project_info/source_file_validator.py", line 137, in get_multi_matcher
    return MultiMatcher(ValidationConfig.from_dict(self.options.config))
  File "/Users/ryan.king/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/backend/project_info/source_file_validator.py", line 87, in from_dict
    path_patterns=tuple(PathPattern(**kwargs) for kwargs in d["path_patterns"]),
KeyError: 'path_patterns'



(Use --print-stacktrace for more error details and/or --no-process-execution-local-cleanup to inspect chroots and/or -ldebug for more logs. See <https://www.pantsbuild.org/v2.7/docs/troubleshooting> for common issues. Consider reaching out for help: <https://www.pantsbuild.org/v2.7/docs/getting-help.>)
h

hundreds-father-404

10/21/2021, 11:51 PM
Hey Ryan, sorry for that broken window! The
validate
goal is weird and we want to merge it into
lint
, only have to make some big internal changes to be able to do that
validate
is only really useful to check that files match a pattern, e.g. that they have a copyright notice. Are you trying to use that functionality? Generally, people want
lint
to run linters like Flake8 and Shellcheck
l

loud-laptop-17949

10/22/2021, 2:47 AM
I don't even know what validate does! I am just trying to run the commands to see what's going on.
đź‘Ť 1
4 Views