humanmade / linter-bot

Automatically run the HM Coding Standards on any repository.
https://github.com/apps/hm-linter
16 stars 3 forks source link

Re-consider PHPCS `installed_paths` argument #97

Open mikeselander opened 5 years ago

mikeselander commented 5 years ago

As identified in #96, our coding standards <= v0.5.0 cannot handle missing paths gracefully. In v0.6.0 we get improved handling for missing sniffs but we projects are still defaulted to 0.5.0 and we have projects set to run even older versions of the standards.

We need a good way of using newer coding standard sets that we add, such as the VIPCS or the PHPCompatibility standards.

My initial inclination is to parse the standardPath to determine what version is being used and only load in newer standards for 0.6.0 and above. The downside is that this is hacky and we'll have to account for latest being on 0.5.0 for the next month.

Any thoughts @rmccue @kevinlangleyjr?

rmccue commented 5 years ago

File exists check and only add it if the standard included it?

mikeselander commented 5 years ago

Update on this, as discussed in Slack we should attempt to use the DealerDirect installed_paths where available (per @rmccue)

We can probably drop that bit altogether for newer versions which have dealerdirect right?

Something like if not exists 'vendor/dealerdirect/...' args.push( 'installed_paths', paths )