
On Thu, Jun 2, 2016 at 11:09 PM, Tim Stumbaugh <stum@hudson-trading.com> wrote:
We run pylint two ways:
Interactively, in the same location as the .pylintrc file. We don't explicitly pass it to pylint, and the normal routines for finding a .pylintrc file work well here. There won't be an environment variable set here (since it's just running within a user's shell session), but config.PYLINTRC is correct. Via arcanist's "arc lint" command, which changes the working directory to the incorrect directory (i.e. pylint can't find an rc file it without help), but with --rcfile. Arcanist has a specific configuration setting just for pylint's rc file which we use.
So while it's certainly possible to use environment variables to solve this problem, I think that would be more complicated (given the two different cases) and somewhat difficult to express as an init-hook.
Here's another proposal: would it be amenable to move the function that executes the init-hook to be a method on the linter class, instead of just a pure function in the module? That way, the init-hook could have closer access to the linter (via the "self" name, presumably) and therefore the pylintrc file?
Of course, if you'd prefer not to support this workflow, I completely understand, and our workaround is workable (even if it's a bit brittle). tjs
Sure, that sounds like a solution that could work, feel free to send a pull request with it. Claudiu