oh I see — there’s now `lint` goal? is there any w...
# general
f
oh I see — there’s now
lint
goal? is there any way to get it to run automatically with
test
,
binary
, or
run
? or do we just need to remember to call it explicitly now?
h
You can re-register the relevant tasks in, say, the
compile
goal, that should give you the effect you want.
Let me dig up an example
Basically you need your own pants plugin, say in
src/python/foo/pants
in your repo.
In that directory you have a
register.py
that does the re-registration (more on that in a bit).
In your
pants.ini
, under
[GLOBAL]
, you set:
backend_packages: +['foo.pants']
And
Copy code
pythonpath: [
    '%(buildroot)s/src/python',
  ]
That takes care of Pants finding and loading the plugin.
Now in
register.py
you implement
def register_goals():
Copy code
from pants.contrib.python.checks.tasks.checkstyle.checker import PythonCheckStyleTask
from pants.goal.task_registrar import TaskRegistrar as task

def register_goals():
  task(name='python-eval', action=PythonEval).install('compile')
And in
pants.ini
you’ll need this if you don’t already have it:
Copy code
plugins: [
    'pantsbuild.pants.contrib.python.checks==%(pants_version)s',
  ]
I think that should take care of it
f
just saw this, thanks!
jw, on this line
task(name='python-eval', action=PythonEval).install('compile')
what’s
PythonEval
? Is that meant to be
PythonCheckStyleTask
?