Page MenuHomePhabricator

Minor fixes to arcanist cpplint
ClosedPublic

Authored by michaeloa on Jan 14 2016, 2:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 4:05 PM
Unknown Object (File)
Wed, Apr 17, 3:15 PM
Unknown Object (File)
Thu, Apr 11, 7:23 AM
Unknown Object (File)
Fri, Apr 5, 2:49 AM
Unknown Object (File)
Tue, Apr 2, 1:36 AM
Unknown Object (File)
Mon, Apr 1, 11:33 PM
Unknown Object (File)
Feb 3 2024, 8:16 AM
Unknown Object (File)
Jan 22 2024, 8:27 AM
Subscribers

Details

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

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

michaeloa retitled this revision from to Minor fixes to arcanist cpplint.
michaeloa updated this object.
michaeloa edited the test plan for this revision. (Show Details)
michaeloa added a reviewer: epriestley.

Not sure how to test the .arclint syntax with the existing test framework, and didn't find any good examples of doing this among the other linters that I browsed. If you have any tips or good examples to look at, I'd be happy to add some additional tests.

The issue is that parsing fails, right? It's sufficient to just make sure parsing succeeds without actually verifying that the severity map works.

So I'd expect the test case to look something like this:

something_that_generates_a_build/c++11() messsage
~~~~~
advice:1

Before your patch, that should fail; after your patch it should pass.

epriestley edited edge metadata.

Oh, nevermind. I thought it was the other regex. This is fine as is, there's no convenient way to test it right now.

src/lint/linter/ArcanistCpplintLinter.php
39

Oh! I thought this was the regexp that was wrong.

This revision is now accepted and ready to land.Jan 14 2016, 2:58 PM
This revision was automatically updated to reflect the committed changes.