1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 08:42:40 +01:00

Minor fixes to arcanist cpplint

Summary:
This fixes the regex in "getLintCode..." so that it accepts lint
codes such as `build/c++11` which have become valid lint codes
in later versions of cpplint.

It also corrects the install instructions for the linter (Google's
style guide is no longer available on SVN and has been migrated to
Github).

Test Plan:
For the Regex:
- Create an .arclint in a project such as:
```
{
  "linters": {
    "cpplint": {
      "type": "cpplint",
      "severity": {
        "build/c++11": "advice"
      }
    }
  }
}
```
- Run `arc lint` with the existing linter. This should fail. Patch the linter, and this should now be accepted.

For the Instructions
- Verify the download location `wget https://raw.github.com/google/styleguide/gh-pages/cpplint/cpplint.py`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T10118

Differential Revision: https://secure.phabricator.com/D15019
This commit is contained in:
Michael Akinde 2016-01-14 06:59:10 -08:00 committed by epriestley
parent 05c12eb9d9
commit 22af67c1c0

View file

@ -19,9 +19,10 @@ final class ArcanistCpplintLinter extends ArcanistExternalLinter {
public function getInstallInstructions() { public function getInstallInstructions() {
return pht( return pht(
'Install cpplint.py using `%s`.', 'Install cpplint.py using `%s`, and place it in your path with the'.
'wget http://google-styleguide.googlecode.com'. 'appropriate permissions set.',
'/svn/trunk/cpplint/cpplint.py'); 'wget https://raw.github.com'.
'/google/styleguide/gh-pages/cpplint/cpplint.py');
} }
protected function getDefaultMessageSeverity($code) { protected function getDefaultMessageSeverity($code) {
@ -60,7 +61,7 @@ final class ArcanistCpplintLinter extends ArcanistExternalLinter {
} }
protected function getLintCodeFromLinterConfigurationKey($code) { protected function getLintCodeFromLinterConfigurationKey($code) {
if (!preg_match('@^[a-z_]+/[a-z_]+$@', $code)) { if (!preg_match('@^[a-z_]+/[a-z0-9_+]+$@', $code)) {
throw new Exception( throw new Exception(
pht( pht(
'Unrecognized lint message code "%s". Expected a valid cpplint '. 'Unrecognized lint message code "%s". Expected a valid cpplint '.