Need more documentation about linter configuration

I’ve a working clang-format linter, which is most important to me.
“generated” and “spelling” sounds interesting to me too.

I have this .arclint file:

{
  "linters" : {
    "clang-format": {
        "type": "clang-format",
        "include": "(\\.(c|h|cpp)$)",
        "exclude" : "(^src/third-party/)"
    },
    "generated" : {
      "type" : "generated",
      "include" : "(.*)"
    },
    "spelling" : {
      "type" : "spelling",
      "include" : "(.*)"
    }
  }
}

But actually except clang-format nothing seems to do anything.
E.g. when trying arc lint test.txt which has spelling mistakes.

  • Do these linters require external tools like ispell, aspell, etc.?
    or are they written in plain PHP?
  • How to configure them?

Steps to reproduce:

  • enable ‘generated’ and ‘spelling’ linter as shown above
  • create the file test.txt with the following content:
Hello Woerld.

this file is generated
  • call arc lint test.txt

Actual results:

 OKAY  No lint warnings.

Expected results:

  • The spelling error should be detected
  • The generated keyword should be detected

The configuration was done according to https://secure.phabricator.com/book/phabricator/article/arcanist_lint/
I could not find a more detailed doc anywhere, unfortunately.

This is probably not a bug, just a misconfiguration.
Any hints on how to configure this would be nice.

You can see some more documentation by running arc linters --verbose spelling generated, but I agree it’s not very discoverable.

Thanks, I found this --verbose option already myself. But still this is not enough information for me to make it working.

Do I place these options into .arcconfig, or .arclint?

What I want to know is more

  • what does this linter actual do? what can I expect from it?
  • how can I configured it? an example would be nice.
  • how does it work? does it use external tools like aspel? requirements?

Somebody must use this stuff, otherwise it would not exist.
Are there some unit tests available which show the usage?
Maybe git blame reveals who has implemented this and can answer these questions.

src/lint/linter/ArcanistSpellingLinter.php
src/lint/linter/__tests__/ArcanistSpellingLinterTestCase.php
src/lint/linter/ArcanistGeneratedLinter.php
src/lint/linter/__tests__/ArcanistGeneratedLinterTestCase.php

Unit tests will not actually show you the usage (they skip configuration), but will show you what the linter does and does not cover.

1 Like