I want to add some custom checking on a project's ...
# general
c
I want to add some custom checking on a project's dependencies (look for illegal and unused ones, for example). I can do it with a script that calls pants repeatedly and processes the results, but it is slow to do that many times. Is a linter plugin the right thing to do instead?
w
Can you give an example more specifically of how that would look? Are you referring to 3rd party deps? Or, similar to this slack chat directly above? https://pantsbuild.slack.com/archives/C046T6T9U/p1666860531191969
c
Yes, that is almost the same thing. Reading the referenced discussions, I think using ValidateDependenciesRequest should be a solution. At this moment, I don't care about a generic solution, just good enough for me. And also trying to get my feet wet with writing a plugin.
👍 1
b
Worth mentioning ValidateDependenciesRequest doesn't have a dedicated goal where it runs. It'll just run whenever dependencies are requested for some reason. Which usually happens at typechecking/test time anyways 😊
h
You can also, at the extreme, run
./pants peek ::
, which dumps a big JSON blob with, among other things, all the deps in the repo, which you can then post-process. Not as good, but means you don’t have to call Pants repeatedly
c
I thought about that, but ideally a plugin is best because I don't need a script to call ./pants lint and my validator together, and pants' nice uniform UI goes away. On the other hand, I didn't get the feeling that plugin development is for the weak of heart 🙂
h
It will put hair on your chest, yeah 🙂
But it’s a good thing to learn because it’s incredibly powerful once you get the hang of it
b
Then you can improve it and break everyone else. Earning them chest hair. Great fun!
w
The circle of dev