pinterest / arcanist-linters

A collection of custom Arcanist linters
Apache License 2.0
62 stars 45 forks source link

Check additional linter dependencies only if run #92

Closed steverice closed 2 years ago

steverice commented 2 years ago

A couple of our linters, Flake8 and GraphQLSchema, have additional version checks for the linter's dependencies. These are currently executed when checking the version of the linter binary.

This commit defers checking of these additional dependencies until the time where the linter is to actually be run, via a new checkAdditionalVersions() method.

In a larger codebase, it may be common to have many linters configured that only operate on a subset of it (different languages, subdirectories in a monorepo, etc). arcanist currently accounts for this in part by allowing a linter not to be installed, and only complaining about that if it finds paths that require that linter. In a similar manner, this commit takes the approach that if a developer has a linter installed for one part of the codebase, she should not be forced to install all the dependencies required by that linter in another part of the codebase she'll never use.