In our project we have a need to be able to run “arc lint” without some of the linters mentioned in .arclint. So, sometimes we do need to run all of the linters, and sometimes not. We expected the arc lint to have an optional argument, something like “arc lint --donotrunlinter myspecificlinter”. But, unfortunately, we did not find something like this supported. However, this seems like something really needed and natural to ask for. So we wanted to ask if it is possible to support this?
To temporary workaround the problem we have considered several options. We ended up creating a custom lint engine. We wanted this custom lint engine to be almost completely identical to ArcanistConfigurationDrivenLintEngine, with the only difference of pointing to another file with linters list, .arclint2. This suggested the following:
a. Currently ArcanistConfigurationDrivenLintEngine class is declared as final, so we could not inherit from it, but only from ArcanistLintEngine.
b. Secondly, if you agree with the bullet a. and make the ArcanistConfigurationDrivenLintEngine not final, it would be beneficial to have some short functions, for example get_dotarclint_file(), to allow the user to specify another .arclint file, while overwriting the function.
c. Continuing b., it might also be beneficial to have such an optional argument for the arc lint command. Something like “arc lint --dotarclint mydotarclintfile.
Currently, what we ended up doing is just copying ArcanistConfigurationDrivenLintEngine code to another file, renaming the class name and then making a couple of changes to replace ‘.arclint’ with our specific ‘.arclint2’. Which works, but it is not a proper software solution.
We would appreciate your response.
- Bug reports MUST include reproduction instructions which allow someone who does not have access to your environment to reproduce the issue you’re encountering.
- Bug reports MUST be against a recent version of Phabricator, and include version information. You can find version information in “Config > Version Information” in the web UI, or
arc versionfrom the CLI.
Complete steps which allow someone else who does not have access to your environment to reproduce the bug.
Output from Config > Version Information or
$ arc version
arcanist cc850163f30c4697e925df0d6212469679600a2c (19 Nov 2019)
libphutil 39ed96cd818aae761ec92613a9ba0800824d0ab0 (30 Sep 2019)