]> khamidou — GitHub mirrors - arcanist.git/commit
Add "ArcanistPhutilLibraryLinter" to replace "ArcanistPhutilModuleLinter"
authorepriestley <git@epriestley.com>
Wed, 30 May 2012 14:25:09 +0000 (07:25 -0700)
committerepriestley <git@epriestley.com>
Wed, 30 May 2012 14:25:09 +0000 (07:25 -0700)
commit009e6c4dbff70b7b9cfd8c9483dbb70c9ef123ce
treef9147ab42b165c31280e0a4fcc84efde63f3d480
parent61b0cfac634ca4a779a4d12a9553333e07729f4f
Add "ArcanistPhutilLibraryLinter" to replace "ArcanistPhutilModuleLinter"

Summary:
Adds a linter for v2 libraries which raises the relevant errors.

NOTE: Not hooked up anywhere yet, so this diff has no effect.

Test Plan:
Switched the ModuleLinter to LibraryLinter and ran it with a junk block to trigger errors:

  >>> Lint for src/lint/linter/phutillibrary/ArcanistPhutilLibraryLinter.php:

     Error  (PHL3) One Class Per File
      File 'lint/linter/phutillibrary/ArcanistPhutilLibraryLinter.php' mixes
      function (id) and class/interface (ArcanistPhutilLibraryLinter)
      definitions in the same file. A file which declares a class or an
      interface MUST declare nothing else.

               190 }
               191
               192 if (false) {
               193   function id() { }
               194   new XYZ();
               195 }

     Error  (PHL2) Duplicate Symbol
      Definition of function 'id' in
      'lint/linter/phutillibrary/ArcanistPhutilLibraryLinter.php' in library
      'arcanist' duplicates prior definition in 'utils/utils.php' in library
      'phutil'.

               190 }
               191
               192 if (false) {
               193   function id() { }
               194   new XYZ();
               195 }

     Error  (PHL1) Unknown Symbol
      Use of unknown class 'XYZ'. This symbol is not defined in any loaded
      libphutil library.

               191
               192 if (false) {
               193   function id() { }
               194   new XYZ();
               195 }

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran
Maniphest Tasks: T1103

Differential Revision: https://secure.phabricator.com/D2597
scripts/phutil_rebuild_map.php
src/__phutil_library_map__.php
src/lint/linter/phutillibrary/ArcanistPhutilLibraryLinter.php [new file with mode: 0644]
src/lint/linter/phutillibrary/__init__.php [new file with mode: 0644]