Page MenuHomePhabricator

Enforce Minimum Required Lint Version
Open, Needs TriagePublic

Description

For linters right now you can set a minimum version "required" in your .arclint or .arcconfig file as shown in T4954. However if I have a version requirement for a linter I create such as in the case of D12198 needing v1.0.0 in order to have the proper output format I can't set it in a clean way. The current way to implement this would be setting it in the lint constructor however since setLinterConfigurationValue() is called after constructor the user could say that a lower version is allowed and break the linter. The other way would be to check in setLinterConfigurationValue() that the version value passed in is greater than or equal to the version you require and throw an error if they try to set it lower. Using both you could get the desired outcome of enforcing a min version.

I think this is a little messy however and could be much more cleanly handled by creating a minVersionRequired function. I am curious if this is overkill though as for this case it would be a very low percentage of users who would be using a version older than v1.0.0. It also may not be very common for other linters to need this as none of the other linters try to set a version.