]> khamidou — GitHub mirrors - arcanist.git/log
arcanist.git
11 years agolosen pep8 version check
cburroughs [Tue, 10 Feb 2015 14:17:25 +0000 (06:17 -0800)]
losen pep8 version check

Summary:
pep8 has used both 2 (`1.2`) and 3 (`1.2.1`) digit versions.  Losen
the version check to allow for both.

NOTE: This is the same regex as flake8.

Test Plan: `arc unit` with a 2 and 3 digit pep8 version on `$PATH`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: joshuaspence, epriestley

Differential Revision: https://secure.phabricator.com/D11728

11 years agoFix `pht` method calls
Joshua Spence [Tue, 10 Feb 2015 07:45:30 +0000 (18:45 +1100)]
Fix `pht` method calls

Summary: Ref T7046. This is mainly a proof-of-concept for D11661.

Test Plan: `arc lint`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7046

Differential Revision: https://secure.phabricator.com/D11683

11 years agoAdd a linter rule to detect mismatched parameters for formatted strings
Joshua Spence [Tue, 10 Feb 2015 07:40:15 +0000 (18:40 +1100)]
Add a linter rule to detect mismatched parameters for formatted strings

Summary: Fixes T7046. Adds a linter rule to detect mismatched parameters for formatted strings. Originally I had considered putting this rule in `ArcanistPhutilXHPASTLinter`, but I later decided to move it to `ArcanistXHPASTLinter` as I think that it is general enough to be more widely useful.

Test Plan: This seems to work but needs some polish.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7046

Differential Revision: https://secure.phabricator.com/D11661

11 years agoRename `ComprehensiveLintEngine` class for consistency
Joshua Spence [Mon, 9 Feb 2015 19:57:17 +0000 (06:57 +1100)]
Rename `ComprehensiveLintEngine` class for consistency

Summary: Ref T5655.

Test Plan: Ran `arc lint` with `lint.engine` set to `ComprehensiveLintEngine` and saw a deprecation notice.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11673

11 years agoRename `ArcanistCompilerLikeLintRenderer`
Joshua Spence [Mon, 9 Feb 2015 19:57:10 +0000 (06:57 +1100)]
Rename `ArcanistCompilerLikeLintRenderer`

Summary: Ref T5655. "Compiler-like" seems a bit odd to me.

Test Plan: `arc lint` + `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11670

11 years agoRemove deprecated support for specifying flags as a string
Joshua Spence [Mon, 9 Feb 2015 19:55:27 +0000 (06:55 +1100)]
Remove deprecated support for specifying flags as a string

Summary: It should be safe to remove this now.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11714

11 years agoRename `ArcanistXHPASTLintTestSwitchHook` class
Joshua Spence [Mon, 9 Feb 2015 19:55:03 +0000 (06:55 +1100)]
Rename `ArcanistXHPASTLintTestSwitchHook` class

Summary: Ref T5655.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11712

11 years agoChange a method name
Joshua Spence [Mon, 9 Feb 2015 19:53:53 +0000 (06:53 +1100)]
Change a method name

Summary: Ref T5655.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11713

11 years ago`pht`ize some strings in `ArcanistPhutilTestCaseTestCase`
Joshua Spence [Wed, 4 Feb 2015 20:22:00 +0000 (07:22 +1100)]
`pht`ize some strings in `ArcanistPhutilTestCaseTestCase`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11671

11 years agoRemove the `ArcanistArcanistLinterTestCase`
Joshua Spence [Wed, 4 Feb 2015 20:21:00 +0000 (07:21 +1100)]
Remove the `ArcanistArcanistLinterTestCase`

Summary: I don't think that this provides too much value. I think that we should rework this to be inferred from the `.arcconfig` file perhaps?

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11662

11 years agoArcanist / Conduit - stop using deprecated diffusion.getcommits
Bob Trahan [Tue, 3 Feb 2015 22:33:06 +0000 (14:33 -0800)]
Arcanist / Conduit - stop using deprecated diffusion.getcommits

Summary: Fixes T7113. This one was a bit trickier than others as the API output changed a bit. In particular, there is no "errors" emitted so much as the result set just doesn't include the answer if things are garbage. Ergo, check the "identifier map" to either check for diff existence or to lookup the phid to grab the actual diff data from the "data" part of the result.

Test Plan: called `arc backout D11665` and got some working output...!

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7113

Differential Revision: https://secure.phabricator.com/D11667

11 years agoArcanist / Conduit - stop using deprecated differential.getdiff API
Bob Trahan [Tue, 3 Feb 2015 22:18:10 +0000 (14:18 -0800)]
Arcanist / Conduit - stop using deprecated differential.getdiff API

Summary: Fixes T7112. Nothing too difficult here.

Test Plan:
meta - submitting this with the new arcanist code
used conduit API to verify the difference between getdiff (just the latest diff) and querydiffs (all diffs that match, with the latest diff first in the set)

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7112

Differential Revision: https://secure.phabricator.com/D11665

11 years agoMake "no working copy" a more explicit "arc" VCS
epriestley [Tue, 3 Feb 2015 20:32:46 +0000 (12:32 -0800)]
Make "no working copy" a more explicit "arc" VCS

Summary:
Some commands (like `get-config`) do not require a working copy at all. Recent changes prevented these commands from running outside a VCS working copy.

Let `null` mean "no working copy".

See also <https://github.com/phacility/phabricator/issues/800>.

Test Plan:
  - Ran `arc get-config` from outside a working copy.
  - Ran `arc list` from outside a working copy, got an error.
  - Ran `arc commit` in a Git working copy, got an error.

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11643

11 years agoOnly allow `arc branch` to be used under `git`
Joshua Spence [Tue, 3 Feb 2015 19:58:53 +0000 (06:58 +1100)]
Only allow `arc branch` to be used under `git`

Summary: Explicitly declare that the `arc branch` command is only supported under `git`.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11552

11 years agoIndicate relevant VCS for `arc feature`
Joshua Spence [Tue, 3 Feb 2015 19:54:07 +0000 (06:54 +1100)]
Indicate relevant VCS for `arc feature`

Summary: This workflow only works on git + mercurial.

Test Plan: I don't even subversion.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11626

11 years agoList supported VCS for `arc backout`
Joshua Spence [Tue, 3 Feb 2015 19:53:58 +0000 (06:53 +1100)]
List supported VCS for `arc backout`

Summary: This workflow does not work on subversion.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11625

11 years agoMark `git-hook-pre-receive` as git only
Joshua Spence [Tue, 3 Feb 2015 19:53:47 +0000 (06:53 +1100)]
Mark `git-hook-pre-receive` as git only

Summary: It doesn't make any sense to run this command on another VCS.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11624

11 years agoMark `arc svn-hook-pre-commit` for subversion only
Joshua Spence [Tue, 3 Feb 2015 19:53:41 +0000 (06:53 +1100)]
Mark `arc svn-hook-pre-commit` for subversion only

Summary: It doesn't make any sense to run this command on any other VCS.

Test Plan: Ran `arc svn-hook-pre-commit` and hit the usage exception.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11623

11 years agoAllow `ArcanistPhutilLibraryLinter` to run with an out-of-date XHPAST binary
Joshua Spence [Mon, 2 Feb 2015 21:01:11 +0000 (08:01 +1100)]
Allow `ArcanistPhutilLibraryLinter` to run with an out-of-date XHPAST binary

Summary: There is no need to check if the XHPAST binary is available here because this linter does not actually parse PHP, it only considers the library map.

Test Plan: Removed the XHPAST binary and ran `arc lint` on a bunch of files.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11528

11 years agoUse `PhutilXHPASTBinary` methods
Joshua Spence [Mon, 2 Feb 2015 19:58:33 +0000 (06:58 +1100)]
Use `PhutilXHPASTBinary` methods

Summary: Use `PhutilXHPASTBinary` methods instead of `xhpast_parse` functions. Depends on D11517.

Test Plan: N/A, this is a direct swap.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11613

11 years agoUse XHPAST version instead of checksum as cache version
Joshua Spence [Mon, 2 Feb 2015 19:56:35 +0000 (06:56 +1100)]
Use XHPAST version instead of checksum as cache version

Summary: Rely on the output of `xhpast --version` when determing the lint cache key.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11611

11 years ago`pht`ize strings in `ArcanistSettings`
Joshua Spence [Mon, 2 Feb 2015 19:54:46 +0000 (06:54 +1100)]
`pht`ize strings in `ArcanistSettings`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11610

11 years agoExplicitly check for supported VCS
Joshua Spence [Mon, 2 Feb 2015 19:54:22 +0000 (06:54 +1100)]
Explicitly check for supported VCS

Summary: Instead of having an `ArcanistWorkflow` subclass explicitly throw an exception when run in an unsupported VCS, consolidate this code and move it to `arcanist.php`. In doing so, we lose some specificity in some of the error messages, but this otherwise feels cleaner. We could consider adding a `getUnsupportedRevisionControlSystemMessage()` method to provide a more tailored error message. Depends on D11604.

Test Plan:
Ran `arc bookmark` in a `git` working copy:

```
Usage Exception: `arc bookmark` is only supported under hg.
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11550

11 years agoModernize `ArcanistPhpcsLinter`
Joshua Spence [Mon, 2 Feb 2015 19:43:54 +0000 (06:43 +1100)]
Modernize `ArcanistPhpcsLinter`

Summary: Allow `--severity` to be specified using `.arclint`.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11511

11 years agoChange "any" to explicitly list revision control systems
Joshua Spence [Mon, 2 Feb 2015 07:18:36 +0000 (18:18 +1100)]
Change "any" to explicitly list revision control systems

Summary: Using `array('any')` to represent `array('git', 'hg', 'svn')` is a bit magical and leads to a lot of special-casing.

Test Plan: Verified that tab completion (ala `ArcanistShellCompleteWorkflow`) still worked.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11604

11 years agoMinor tidying of `ArcanistPasteWorkflow`
Joshua Spence [Sun, 1 Feb 2015 10:57:49 +0000 (21:57 +1100)]
Minor tidying of `ArcanistPasteWorkflow`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11566

11 years agoMinor tidying of `ArcanistRevertWorkflow`
Joshua Spence [Sun, 1 Feb 2015 10:56:28 +0000 (21:56 +1100)]
Minor tidying of `ArcanistRevertWorkflow`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11557

11 years agoMinor tidying of `ArcanistUploadWorkflow`
Joshua Spence [Sun, 1 Feb 2015 10:51:12 +0000 (21:51 +1100)]
Minor tidying of `ArcanistUploadWorkflow`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11556

11 years agoMinor tidying of `ArcanistPhrequentWorkflow` classes
Joshua Spence [Sun, 1 Feb 2015 00:58:18 +0000 (11:58 +1100)]
Minor tidying of `ArcanistPhrequentWorkflow` classes

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11555

11 years agoMinor tidying of `ArcanistCallConduitWorkflow`
Joshua Spence [Sun, 1 Feb 2015 00:05:27 +0000 (11:05 +1100)]
Minor tidying of `ArcanistCallConduitWorkflow`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11567

11 years agoMinor tidying of `ArcanistUpgradeWorkflow`
Joshua Spence [Sun, 1 Feb 2015 00:00:36 +0000 (11:00 +1100)]
Minor tidying of `ArcanistUpgradeWorkflow`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11554

11 years agoMinor tidying of `ArcanistVersionWorkflow`
Joshua Spence [Thu, 29 Jan 2015 20:15:05 +0000 (07:15 +1100)]
Minor tidying of `ArcanistVersionWorkflow`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11553

11 years agoFix `ArcanistJscsLinter` unit tests
Joshua Spence [Tue, 27 Jan 2015 19:49:02 +0000 (06:49 +1100)]
Fix `ArcanistJscsLinter` unit tests

Summary: These tests are failing with the latest version of `jscs` (v1.10.0).

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11520

11 years agoFix failing unit tests for `ArcanistLesscLinter`
Joshua Spence [Tue, 27 Jan 2015 19:48:49 +0000 (06:48 +1100)]
Fix failing unit tests for `ArcanistLesscLinter`

Summary: A bunch of unit tests are failing with the latest version of `lessc` (v2.3.0). I decided to delete a bunch of test cases for this linter as we have far too many at the moment.

Test Plan: `arc unit`

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11521

11 years agoMinor tweak to `.arclint` file
Joshua Spence [Mon, 26 Jan 2015 19:58:36 +0000 (06:58 +1100)]
Minor tweak to `.arclint` file

Summary: Self-explanatory.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11500

11 years ago`pht`ize some strings
Joshua Spence [Mon, 26 Jan 2015 19:58:30 +0000 (06:58 +1100)]
`pht`ize some strings

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11503

11 years ago`pht`ize a bunch of strings
Joshua Spence [Mon, 26 Jan 2015 19:58:18 +0000 (06:58 +1100)]
`pht`ize a bunch of strings

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11501

11 years agoAdd a linter rule to detect call-time pass-by-reference
Joshua Spence [Thu, 22 Jan 2015 20:28:55 +0000 (07:28 +1100)]
Add a linter rule to detect call-time pass-by-reference

Summary: Call-time [[http://php.net/manual/en/language.references.pass.php | pass-by-reference]] is an awful "feature" of PHP that is deprecated and removed in PHP 5.4 (see http://us1.php.net/manual/en/migration54.incompatible.php). Add a linter rule to `ArcanistXHPASTLinter` to detect the use of this feature and raise an error.

Test Plan: Added a test case for `arc unit`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10537

11 years agoAllow `arc unit --everything` to work without a base commit
Joshua Spence [Thu, 22 Jan 2015 20:21:53 +0000 (07:21 +1100)]
Allow `arc unit --everything` to work without a base commit

Summary: Fixes T2461. Similarly to `arc lint --everything`, `arc unit --everything` should work without a base commit.

Test Plan: Removed the `.git/arc/default-relative-commit` file and ran `arc unit --everything`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T2461

Differential Revision: https://secure.phabricator.com/D11459

11 years agoImprove handling of options for `arc` workflows
Joshua Spence [Thu, 22 Jan 2015 20:07:37 +0000 (07:07 +1100)]
Improve handling of options for `arc` workflows

Summary: Allow `--severity=warning` to mean the same as `--severity warning`. Longer term, we should convert this code to use `PhutilArgumentParser`, although it doesn't seem that `PhutilArgumentParser` support British spelling ;)

Test Plan: Ran `arc lint --severity=warning`. Also `var_dump`ed `$args` to make sure it looked reasonable.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11464

11 years agoDon't use newInstanceWithoutConstructor in Arcanist unit test
epriestley [Tue, 20 Jan 2015 23:39:21 +0000 (15:39 -0800)]
Don't use newInstanceWithoutConstructor in Arcanist unit test

Summary: This requires PHP 5.4. Use `newv()` instead. I don't think the "without constructor" part is meaningful (or desirable). Simplify slightly.

Test Plan: `arc unit --everything`

Reviewers: hach-que, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11450

11 years agoFix visibility of the `ArcanistPhpcsLinter::getMandatoryFlags` method
Joshua Spence [Thu, 15 Jan 2015 20:17:46 +0000 (07:17 +1100)]
Fix visibility of the `ArcanistPhpcsLinter::getMandatoryFlags` method

Summary: Ref T6822.

Test Plan: All the cool linters are doing it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6822

Differential Revision: https://secure.phabricator.com/D11414

11 years agoMinor tidying of `ArcanistPhutilLibraryLinter`
Joshua Spence [Thu, 15 Jan 2015 10:51:26 +0000 (21:51 +1100)]
Minor tidying of `ArcanistPhutilLibraryLinter`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11330

11 years agoWrite tests for `ArcanistNoLintLinter`
Joshua Spence [Wed, 14 Jan 2015 20:03:14 +0000 (07:03 +1100)]
Write tests for `ArcanistNoLintLinter`

Summary: With a special guest appearance from `ArcanistGeneratedLinter`.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11345

11 years agoAdd unit tests for `ArcanistChmodLinter`
Joshua Spence [Wed, 14 Jan 2015 19:58:10 +0000 (06:58 +1100)]
Add unit tests for `ArcanistChmodLinter`

Summary: Moar test coverage.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11343

11 years agoLint against undefined magic symbols
Joshua Spence [Wed, 14 Jan 2015 19:55:45 +0000 (06:55 +1100)]
Lint against undefined magic symbols

Summary: Fixes T5639. Allows the detection of undefined magic symbols, such as the use of `__DIR__` in a codebase that targets <  PHP 5.3.0.

Test Plan: Added a test case.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T5639

Differential Revision: https://secure.phabricator.com/D11386

11 years agoFix visibility of `ArcanistMercurialAPI::didReloadCommitRange`
Joshua Spence [Tue, 13 Jan 2015 19:48:25 +0000 (06:48 +1100)]
Fix visibility of `ArcanistMercurialAPI::didReloadCommitRange`

Summary: Ref T6822.

Test Plan: `grep`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T6822

Differential Revision: https://secure.phabricator.com/D11369

11 years agoImprove lint handling of `declare()` special statement blocks
Joshua Spence [Mon, 12 Jan 2015 20:23:01 +0000 (07:23 +1100)]
Improve lint handling of `declare()` special statement blocks

Summary: Fixes T6830. Don't require `n_STATEMENT` nested under `n_DECLARE` to be written using braces.

Test Plan: Added a test case.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6830

Differential Revision: https://secure.phabricator.com/D11350

11 years agoAdd unit tests for `ArcanistFilenameLinter`
Joshua Spence [Mon, 12 Jan 2015 19:42:09 +0000 (06:42 +1100)]
Add unit tests for `ArcanistFilenameLinter`

Summary: Self-explanatory.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11341

11 years agoMinor changes to `ArcanistChmodLinter`
Joshua Spence [Mon, 12 Jan 2015 19:37:25 +0000 (06:37 +1100)]
Minor changes to `ArcanistChmodLinter`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11342

11 years agoMinor tidying of `ArcanistConduitLinter`
Joshua Spence [Mon, 12 Jan 2015 19:36:19 +0000 (06:36 +1100)]
Minor tidying of `ArcanistConduitLinter`

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11344

11 years agoDisable the customization of linter severities for `ArcanistCommitLinter`
Joshua Spence [Sun, 11 Jan 2015 20:24:53 +0000 (07:24 +1100)]
Disable the customization of linter severities for `ArcanistCommitLinter`

Summary: The expectation is that this linter only raises errors.

Test Plan: This is mostly theoretical.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11331

11 years agoUse the `raw` formatter for `coffeelint`
Joshua Spence [Sun, 11 Jan 2015 20:22:42 +0000 (07:22 +1100)]
Use the `raw` formatter for `coffeelint`

Summary: Using `--reporter=raw` exposes raw JSON output rather than a limited XML output. This allows us to pull more context from the `coffeelint` output.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11320

11 years agoChange the default value for `ArcanistExternalLinter::shouldExpectCommandErrors`
Joshua Spence [Sun, 11 Jan 2015 20:21:33 +0000 (07:21 +1100)]
Change the default value for `ArcanistExternalLinter::shouldExpectCommandErrors`

Summary: It is more common for linters to exit with a non-zero status than it is for linters to return with a zero exit status, Really this function serves very little purposes, it simply determines whether or not to throw an exception if a non-zero status is returned by the external linter.

Test Plan: `arc unit`

Reviewers: chad, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11322

11 years agoFix a lint renderering issue
Joshua Spence [Sun, 11 Jan 2015 19:49:14 +0000 (06:49 +1100)]
Fix a lint renderering issue

Summary: Currently there is an issue when renderering linter messages with `ArcanistConsoleLintRenderer` if `$message->getChar()` returns `0` (i.e. the value is unset).

Test Plan:
**Before**
{F265586}

**After**
{F265587}

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11319

11 years agoDon't explicitly pass `--color=never` to `coffeelint`
Joshua Spence [Sun, 11 Jan 2015 19:48:24 +0000 (06:48 +1100)]
Don't explicitly pass `--color=never` to `coffeelint`

Summary: This flag doesn't do anything in combination with `--reporter=checkstyle`.

Test Plan:
```lang=bash
> coffeelint --reporter=checkstyle test.coffee
<?xml version="1.0" encoding="utf-8"?>
<checkstyle version="4.3">
<file name="test.coffee">
<error line="1"
    severity="error"
    message="Class names should be camel cased; context: class name: boaConstrictor"
    source="coffeelint"/>
</file>
</checkstyle>

> coffeelint --reporter=checkstyle --color=never test.coffee
<?xml version="1.0" encoding="utf-8"?>
<checkstyle version="4.3">
<file name="test.coffee">
<error line="1"
    severity="error"
    message="Class names should be camel cased; context: class name: boaConstrictor"
    source="coffeelint"/>
</file>
</checkstyle>
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11318

11 years agoDon't explicitly implement `ArcanistPuppetLintLinter::supportsReadDataFromStdin`
Joshua Spence [Sun, 11 Jan 2015 19:48:01 +0000 (06:48 +1100)]
Don't explicitly implement `ArcanistPuppetLintLinter::supportsReadDataFromStdin`

Summary: `false` is the default return value for this method.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11314

11 years agoImprove parsing of `csslint` output
Joshua Spence [Sun, 11 Jan 2015 19:47:51 +0000 (06:47 +1100)]
Improve parsing of `csslint` output

Summary: `csslint` returns an `evidence` field which contains the line of the "original text" which produced the linter message (see https://github.com/CSSLint/csslint/blob/5dd84b259b90c5ea8adbaf03d31e9df093cc3dcd/src/core/Reporter.js#L64). We can use this data instead of trying to achieve the same result using `$this->getData($path)`.

Test Plan: {F265449}

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11311

11 years agoMinor tidying of `ArcanistCSSLintLinter`
Joshua Spence [Sun, 11 Jan 2015 19:47:16 +0000 (06:47 +1100)]
Minor tidying of `ArcanistCSSLintLinter`

Summary: Minor tidying.

Test Plan: Eyeball it.

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11307

11 years agoDon't pass `--quiet` to `csslint`
Joshua Spence [Sun, 11 Jan 2015 19:46:34 +0000 (06:46 +1100)]
Don't pass `--quiet` to `csslint`

Summary: Similar to D11198. This flag doesn't do anything when combined with `--format=lint-xml`.

Test Plan:
```lang=bash
> csslint *.css
csslint *.css

csslint: There are 1 problems in /home/joshua/workspace/github.com/phacility/arcanist/fail.css.

fail.css
1: error at line 1, col 1
Unexpected token '~' at line 1, col 1.
~

csslint: No errors in /home/joshua/workspace/github.com/phacility/arcanist/pass.css.

> csslint --quiet *.css
csslint --quiet *.css

csslint: There are 1 problems in /home/joshua/workspace/github.com/phacility/arcanist/fail.css.

fail.css
1: error at line 1, col 1
Unexpected token '~' at line 1, col 1.
~

> csslint --format=lint-xml *.css
<?xml version="1.0" encoding="utf-8"?><lint>
<file name="/home/joshua/workspace/github.com/phacility/arcanist/fail.css"><issue line="1" char="1" severity="error" reason="Unexpected token '~' at line 1, col 1." evidence="~"/></file>
</lint>

> csslint --format=lint-xml --quiet *.css
<?xml version="1.0" encoding="utf-8"?><lint>
<file name="/home/joshua/workspace/github.com/phacility/arcanist/fail.css"><issue line="1" char="1" severity="error" reason="Unexpected token '~' at line 1, col 1." evidence="~"/></file>
</lint>
```

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11308

11 years agoMove linter exception classes to `src/lint/linter/exception`
Joshua Spence [Sun, 11 Jan 2015 19:46:23 +0000 (06:46 +1100)]
Move linter exception classes to `src/lint/linter/exception`

Summary: The `src/lint/linter` directory is a bit cluttered at the moment.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11309

11 years agoFix parsing of `puppet-lint --version`
Joshua Spence [Sun, 11 Jan 2015 19:44:08 +0000 (06:44 +1100)]
Fix parsing of `puppet-lint --version`

Summary: This seems to be off, at least for `puppet-lint` versions greater than 1.0.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11312

11 years agoDelete a problematic test case
Joshua Spence [Sun, 11 Jan 2015 19:43:58 +0000 (06:43 +1100)]
Delete a problematic test case

Summary: This test case is currently failing with various different versions of `puppet-lint`. I was considering fixing this test case, but I feel that we have more than enough test cases for `ArcanistPuppetLintLinter` anyway. Since this is an `ArcanistExternalLinter`, we only really need to test that the bindings are working as expected (rather than the linter functionality).

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11313

11 years agoMinor tidying of the `ArcanistPuppetLintLinter` class
Joshua Spence [Sun, 11 Jan 2015 19:42:35 +0000 (06:42 +1100)]
Minor tidying of the `ArcanistPuppetLintLinter` class

Summary: Self-explanatory.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11317

11 years agoPass `--error-level=all` to `puppet-lint`
Joshua Spence [Sun, 11 Jan 2015 19:41:46 +0000 (06:41 +1100)]
Pass `--error-level=all` to `puppet-lint`

Summary: Without explicitly passing `--error-level=all` to `puppet-lint`, the configuration file for `puppet-lint` could contain `--error-level=error`. This would limit the ability of `arc lint` to detect linter issues and therefore we should override this flag from the command line explicitly.

Test Plan: This is mostly theoretical.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11316

11 years agoMinor improvements to `ArcanistJSONLinter`
Joshua Spence [Sun, 11 Jan 2015 19:40:40 +0000 (06:40 +1100)]
Minor improvements to `ArcanistJSONLinter`

Summary: Self-explanatory.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11324

11 years agoMake properties in the `PhutilUnitTestEngineTestCase` class private
Joshua Spence [Thu, 8 Jan 2015 11:43:44 +0000 (22:43 +1100)]
Make properties in the `PhutilUnitTestEngineTestCase` class private

Summary: There's no need for these properties to be (implicitly) public.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11276

11 years agoMinor improvements to `ArcanistPhpLinter`
Joshua Spence [Thu, 8 Jan 2015 08:07:06 +0000 (19:07 +1100)]
Minor improvements to `ArcanistPhpLinter`

Summary: Various minor improvements to `ArcanistPhpLinter`.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11265

11 years agoImprovements to `LINT_IMPLICIT_VISIBILITY`
Joshua Spence [Wed, 7 Jan 2015 20:30:31 +0000 (07:30 +1100)]
Improvements to `LINT_IMPLICIT_VISIBILITY`

Summary: See D10687#104589.

Test Plan: Wrote unit tests.

Reviewers: richardvanvelzen, epriestley, #blessed_reviewers

Reviewed By: richardvanvelzen, epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11267

11 years agoSimplify version parsing for `ArcanistPhpLinter`
Joshua Spence [Wed, 7 Jan 2015 12:55:34 +0000 (23:55 +1100)]
Simplify version parsing for `ArcanistPhpLinter`

Summary: We can use `php --run "echo phpversion();"` to return a nice, compact representation of the PHP version.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11264

11 years agoMinor tidying of the `ArcanistXMLLinter` class
Joshua Spence [Wed, 7 Jan 2015 12:55:08 +0000 (23:55 +1100)]
Minor tidying of the `ArcanistXMLLinter` class

Summary: Self-explanatory

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11263

11 years agoFix unit parser tests
Joshua Spence [Wed, 7 Jan 2015 12:54:49 +0000 (23:54 +1100)]
Fix unit parser tests

Summary: This directory was missed, but should have been moved in D11202.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11262

11 years agoAdd a linter rule to detect implict method visibility
Joshua Spence [Tue, 6 Jan 2015 20:42:41 +0000 (07:42 +1100)]
Add a linter rule to detect implict method visibility

Summary: I'm not sure whether this is in any coding standards, but it seems to be an unspoken rule that methods should have a visiblity modifier (`public`, `protected` or `private`) explicitly specified. According to the [[http://php.net/manual/en/language.oop5.visibility.php#language.oop5.visiblity-methods | PHP documentation]], methods declared without any explicit visibility keyword are defined as public.

Test Plan: Added a test case.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D10687

11 years agoUse `PhutilLibraryTestCase`
Joshua Spence [Tue, 6 Jan 2015 20:37:58 +0000 (07:37 +1100)]
Use `PhutilLibraryTestCase`

Summary: Depends on D11231.

Test Plan: `arc unit`

Reviewers: btrahan, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11232

11 years agoFix visibility of various `ArcanistLinter` methods
Joshua Spence [Tue, 6 Jan 2015 20:36:07 +0000 (07:36 +1100)]
Fix visibility of various `ArcanistLinter` methods

Summary: Ref T6822.

Test Plan: Visual inspection. These methods are only called from within the `ArcanistExternalLinter` and `ArcanistLinter` subclasses.

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6822

Differential Revision: https://secure.phabricator.com/D11237

11 years agoFix visibility of various `ArcanistWorkflow` methods
Joshua Spence [Tue, 6 Jan 2015 20:36:00 +0000 (07:36 +1100)]
Fix visibility of various `ArcanistWorkflow` methods

Summary: Ref T6822.

Test Plan: Visual inspection. These methods are only called from within the `ArcanistShellCompleteWorkflow` class.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T6822

Differential Revision: https://secure.phabricator.com/D11238

11 years agoFix visibility of the `ArcanistLintEngine::buildLinters()` method
Joshua Spence [Tue, 6 Jan 2015 20:35:20 +0000 (07:35 +1100)]
Fix visibility of the `ArcanistLintEngine::buildLinters()` method

Summary: Ref T6822. This method needs to be public so that it can be called from `ArcanistLintersWorkflow`.

Test Plan: Ran `arc linters`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6822

Differential Revision: https://secure.phabricator.com/D11239

11 years agoDon't try to call library functions during arc sanity checking
epriestley [Tue, 6 Jan 2015 17:53:11 +0000 (09:53 -0800)]
Don't try to call library functions during arc sanity checking

Summary: These functions won't exist yet. See https://github.com/phacility/arcanist/commit/7e2df9a5bfc635b77c6412ef5a6569edd0e4e138#commitcomment-9172274

Test Plan: Faked a fatal, ran `arc`, got message.

Reviewers: joshuaspence, chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11254

11 years agoRemove the noconfig flag
jjoos [Tue, 6 Jan 2015 14:59:36 +0000 (06:59 -0800)]
Remove the noconfig flag

Summary:
D11196 introduced a regression that made it impossible for coffeelint to read any configuration. I'm reverting the change in that diff.

Created a pull request changing the documentation of coffeelint to make sure I'm interpreting this flag correctly: https://github.com/clutchski/coffeelint/pull/364

Test Plan:
- patch
- npm install -g coffeelint

- create a `test.coffee` file with:
```
# 1234567890
```
- `arc lint test.coffee`
```
 OKAY  No lint warnings.
```
- create a `coffeelint.json` with
```
{
  "max_line_length": {
    "value": 10
  }
}
```
- `arc lint test.coffee`, expected output:
```
>>> Lint for test.coffee:

   Error  (COFFEE)
    Line exceeds maximum allowed length.

    >>>        1 # 1234567890
```
- create a `.arclint` with
```
{
  "linters": {
    "coffeelint": {
      "type": "coffeelint",
      "coffeelint.config": "coffee_lint_config_with_different_name.json"
    }
  }
}
```
- rename `coffeelint.json` to `coffee_lint_config_with_different_name.json`
- `arc lint test.coffee`, expected output:
```
>>> Lint for test.coffee:

   Error  (COFFEE)
    Line exceeds maximum allowed length.

    >>>        1 # 1234567890
```

Reviewers: Korvin, joshuaspence, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11250

11 years ago`pht`ize some strings
Joshua Spence [Tue, 6 Jan 2015 12:14:04 +0000 (23:14 +1100)]
`pht`ize some strings

Summary: Self-explanatory.

Test Plan: Eye-balled it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10596

11 years agoCreate a custom exception class for missing linter dependencies
Joshua Spence [Tue, 6 Jan 2015 11:45:44 +0000 (22:45 +1100)]
Create a custom exception class for missing linter dependencies

Summary: I feel that we are abusing `ArcanistUsageException`. Throw a more tailed exception instead. Depends on D11197.

Test Plan: `arc lint`, I guess.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: avivey, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11205

11 years ago`pht`ize some strings
Joshua Spence [Tue, 6 Jan 2015 11:43:52 +0000 (22:43 +1100)]
`pht`ize some strings

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11206

11 years agoAdd a linter rule to detect the use of blacklisted functions
Joshua Spence [Sun, 4 Jan 2015 23:51:33 +0000 (10:51 +1100)]
Add a linter rule to detect the use of blacklisted functions

Summary:
As mentioned in the [[https://secure.phabricator.com/book/phabcontrib/article/php_coding_standards/ | Phabricator PHP coding standards]], the `eval` function should be avoided. There is some good discussion on [[http://stackoverflow.com/questions/951373/when-is-eval-evil-in-php | StackOverflow]] as well.

Having said that, instead of hardcoding `eval()`, I have generalised this enough to allow a set of "blacklisted" functions to be defined with `xhpast.blacklisted.function` in the `.arclint` file.

Test Plan: Added a test case.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D10686

11 years agoVarious improvements for `ArcanistClosureLinter`
Joshua Spence [Sun, 4 Jan 2015 20:43:55 +0000 (07:43 +1100)]
Various improvements for `ArcanistClosureLinter`

Summary: WIP

Test Plan: WIP

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11207

11 years agoExport namespace in `ArcanistUnitTestResult` dictionary
Joshua Spence [Sun, 4 Jan 2015 19:48:32 +0000 (06:48 +1100)]
Export namespace in `ArcanistUnitTestResult` dictionary

Summary: D7952 added namespaces to `ArcanistUnitTestResult` but these are not exported and thus don't get sent from client to server.

Test Plan: Uploaded a diff and inspected the contents of the `phabricator_differential.differential_diffproperty` table.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11208

11 years agoUse `PhutilMethodNotImplementedException` in `ArcanistExternalLinter`
Joshua Spence [Sun, 4 Jan 2015 19:47:12 +0000 (06:47 +1100)]
Use `PhutilMethodNotImplementedException` in `ArcanistExternalLinter`

Summary: Self-explanatory.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11204

11 years agoRename `PHPUnitTestEngineTestCase` for consistency
Joshua Spence [Sun, 4 Jan 2015 19:46:24 +0000 (06:46 +1100)]
Rename `PHPUnitTestEngineTestCase` for consistency

Summary: Ref T5655. `PHPUnitTestEngineTestCase` is the test case for `PhpunitTestEngine`.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: aurelijus, Korvin, epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11203

11 years agoMove `ArcanistTestResultParser` subclasses
Joshua Spence [Sun, 4 Jan 2015 19:46:13 +0000 (06:46 +1100)]
Move `ArcanistTestResultParser` subclasses

Summary: Move `ArcanistTestResultParser` subclasses from `src/unit/engine` to `src/unit/parser`. Depends on D11201.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: aurelijus, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11202

11 years agoRename `ArcanistTestResultParser` subclasses for consistency
Joshua Spence [Sun, 4 Jan 2015 19:45:14 +0000 (06:45 +1100)]
Rename `ArcanistTestResultParser` subclasses for consistency

Summary: Ref T5655.

Test Plan: `grep`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: aurelijus, Korvin, epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11201

11 years agoRename `UnitTestableArcanistLintEngine` for consistency
Joshua Spence [Sun, 4 Jan 2015 19:44:49 +0000 (06:44 +1100)]
Rename `UnitTestableArcanistLintEngine` for consistency

Summary: Ref T5655.

Test Plan: `grep`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11200

11 years agoMinor tidying of `ArcanistCoffeeLintLinter`
Joshua Spence [Sun, 4 Jan 2015 19:44:33 +0000 (06:44 +1100)]
Minor tidying of `ArcanistCoffeeLintLinter`

Summary: Self-explanatory.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11199

11 years agoDon't pass `--quiet` to `coffeelint`
Joshua Spence [Sun, 4 Jan 2015 19:43:44 +0000 (06:43 +1100)]
Don't pass `--quiet` to `coffeelint`

Summary: This flag doesn't do anything when combined with `--reporter=checkstyle`.

Test Plan:
```
> coffeelint *.coffee
  ✗ fail.coffee
     ✗ #1: Class names should be camel cased. class name: boaConstrictor.
  ✓ pass.coffee

✗ Lint! » 1 error and 0 warnings in 2 files

> coffeelint --quiet *.coffee
  ✗ fail.coffee
     ✗ #1: Class names should be camel cased. class name: boaConstrictor.

✗ Lint! » 1 error and 0 warnings in 2 files

> coffeelint --reporter=checkstyle *.coffee
<?xml version="1.0" encoding="utf-8"?>
<checkstyle version="4.3">
<file name="fail.coffee">
<error line="1"
    severity="error"
    message="Class names should be camel cased; context: class name: boaConstrictor"
    source="coffeelint"/>
</file>
</checkstyle>

> coffeelint --reporter=checkstyle --quiet *.coffee
<?xml version="1.0" encoding="utf-8"?>
<checkstyle version="4.3">
<file name="fail.coffee">
<error line="1"
    severity="error"
    message="Class names should be camel cased; context: class name: boaConstrictor"
    source="coffeelint"/>
</file>
</checkstyle>
```

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11198

11 years agoCreate an `ArcanistExternalLinterTestCase` class
Joshua Spence [Sun, 4 Jan 2015 19:41:59 +0000 (06:41 +1100)]
Create an `ArcanistExternalLinterTestCase` class

Summary: Creates a new base class for unit testing `ArcanistExternalLinter` subclasses. Specifically, add a test case for verifying that we are correctly parsing the output of `$external_linter --version`.

Test Plan: `arc unit`

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11197

11 years agoIgnore environment variables for `coffeelint`
Joshua Spence [Sun, 4 Jan 2015 19:40:07 +0000 (06:40 +1100)]
Ignore environment variables for `coffeelint`

Summary: According to `coffeelint --help`, `--noconfig` ignores the environment variable `COFFEELINT_CONFIG`. This means that `arc lint` will behave more consistently across developer workstations by forcing configuration to be specified with `coffeelint.config` instead of with environment variables.

Test Plan: This is mostly theoretical.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11196

11 years agoUpdate flags for `coffeelint`
Joshua Spence [Sun, 4 Jan 2015 19:39:50 +0000 (06:39 +1100)]
Update flags for `coffeelint`

Summary: According to `coffeelint --help` (with an up-to-date version of `coffeelint`, version 1.8.1) , `--nocolor` is deprecated in favor of `--color=never`. According to the [[http://www.coffeelint.org/#changelog | changelog]], `--nocolor` was deprecated in v1.6.0.

Test Plan: `arc lint`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11195

11 years agoReduce boilerplate code in `ArcanistLinterTestCase` subclasses
Joshua Spence [Sun, 4 Jan 2015 07:38:32 +0000 (18:38 +1100)]
Reduce boilerplate code in `ArcanistLinterTestCase` subclasses

Summary: This is a bit magical and is maybe a terrible idea, but it seems okayish.

Test Plan: `arc unit`

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11172

11 years agoRaise a linter error when removed symbols are used
Joshua Spence [Sun, 4 Jan 2015 07:38:07 +0000 (18:38 +1100)]
Raise a linter error when removed symbols are used

Summary: Ref T5141. Utilize the `'max'` key from the `php_compat_info.json` compatibility map to lint for the use of classes/functions/symbols which have been removed from the target PHP version.

Test Plan: Added a test case for `arc unit`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5141

Differential Revision: https://secure.phabricator.com/D10538

11 years agoAdd a linter rule to detect duplicate `case` statements
Joshua Spence [Sun, 4 Jan 2015 05:49:57 +0000 (16:49 +1100)]
Add a linter rule to detect duplicate `case` statements

Summary: Fixes T6843. Adds a linter rule to `ArcanistXHPASTLinter` to detect duplicate `case` statements within a `switch` statement.

Test Plan: Added test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T6843

Differential Revision: https://secure.phabricator.com/D11171

11 years agoMove `LINT_NO_COMMIT` from `ArcanistTextLinter` to a new linter
Joshua Spence [Sun, 4 Jan 2015 05:20:31 +0000 (16:20 +1100)]
Move `LINT_NO_COMMIT` from `ArcanistTextLinter` to a new linter

Summary: I don't feel that this linter rule belongs in the `ArcanistTextLinter`. In fact, this linter rule is quite similar to the rules provided by `ArcanistGeneratedLinter` and `ArcanistNoLintLinter` and these classes could possibly be consolidated. I have moved this linter rule to a standalone `ArcanistCommitLinter` class (which could possibly do additional lints in the future).

Test Plan: Moved existing test cases.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10473

11 years ago`pht`ize some strings
Joshua Spence [Sat, 3 Jan 2015 12:53:07 +0000 (23:53 +1100)]
`pht`ize some strings

Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11175