1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Make sure no one ever misunderstand the "unkonwn symbol" lint message ever again

Summary: A lot of new contributors don't resolve this. Make it easier to resolve, more comprehensive, and more explicit about not being ignorable.

Test Plan:
  >>> orbital ~/devtools/arcanist $ arc lint
  >>> Lint for src/lint/linter/ArcanistPhutilLibraryLinter.php:

     Error  (PHL1) Unknown Symbol
      Use of unknown class 'BlerpBarp'. Common causes are:

        - Your libphutil/ is out of date.
          This is the most common cause.
          Update this copy of libphutil: /INSECURE/devtools/libphutil

        - Some other library is out of date.
          Update the library this symbol appears in.

        - This symbol is misspelled.
          Spell the symbol name correctly.
          Symbol name spelling is case-sensitive.

        - This symbol was added recently.
          Run `arc liberate` on the library it was added to.

        - This symbol is external. Use `@phutil-external-symbol`.
          Use `grep` to find usage examples of this directive.

      *** ALTHOUGH USUALLY EASY TO FIX, THIS IS A SERIOUS ERROR.
      *** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.

               181               "*** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.");
               182
               183             if (false) {
      >>>      184               new BlerpBarp();
               185             }
               186           }
               187         }
  >>> orbital ~/devtools/arcanist $

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D7752
This commit is contained in:
epriestley 2013-12-10 08:33:35 -08:00
parent 4fdb87761b
commit e0b4eef9de

View file

@ -152,15 +152,33 @@ final class ArcanistPhutilLibraryLinter extends ArcanistLinter {
continue;
}
$libphutil_root = dirname(phutil_get_library_root('phutil'));
$this->raiseLintInLibrary(
$library,
$file,
$offset,
self::LINT_UNKNOWN_SYMBOL,
"Use of unknown {$type} '{$symbol}'. This symbol is not defined ".
"in any loaded phutil library. It might be misspelled, or it ".
"may have been added recently. Make sure libphutil and other ".
"libraries are up to date.");
"Use of unknown {$type} '{$symbol}'. Common causes are:\n\n".
" - Your libphutil/ is out of date.\n".
" This is the most common cause.\n".
" Update this copy of libphutil: {$libphutil_root}\n".
"\n".
" - Some other library is out of date.\n".
" Update the library this symbol appears in.\n".
"\n".
" - This symbol is misspelled.\n".
" Spell the symbol name correctly.\n".
" Symbol name spelling is case-sensitive.\n".
"\n".
" - This symbol was added recently.\n".
" Run `arc liberate` on the library it was added to.\n".
"\n".
" - This symbol is external. Use `@phutil-external-symbol`.\n".
" Use `grep` to find usage examples of this directive.\n".
"\n".
"*** ALTHOUGH USUALLY EASY TO FIX, THIS IS A SERIOUS ERROR.\n".
"*** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.");
}
}
}