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

cold-vr-15232

10/27/2022, 9:10 AM
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

wide-midnight-78598

10/27/2022, 10:43 AM
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

cold-vr-15232

10/27/2022, 11:24 AM
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

bitter-ability-32190

10/27/2022, 1:34 PM
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

happy-kitchen-89482

10/27/2022, 3:42 PM
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

cold-vr-15232

10/27/2022, 9:52 PM
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

happy-kitchen-89482

10/27/2022, 10:13 PM
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

bitter-ability-32190

10/27/2022, 10:15 PM
Then you can improve it and break everyone else. Earning them chest hair. Great fun!
w

wide-midnight-78598

10/27/2022, 10:16 PM
The circle of dev
2 Views