]>
khamidou — GitHub mirrors - arcanist.git/log
Joshua Spence [Sun, 12 Apr 2015 21:21:39 +0000 (07:21 +1000)]
Add a linter rule for uppercase constant definitions
Summary: Ref T7409. Adds a linter rule to ensure that constant are defined as being uppercase. Based on [[https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php | Generic_Sniffs_NamingConventions_UpperCaseConstantNameSniff]].
Test Plan: Added test cases.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7409
Differential Revision: https://secure.phabricator.com/D12366
Joshua Spence [Sun, 12 Apr 2015 21:21:07 +0000 (07:21 +1000)]
Trim trailing whitespace from diff hints
Summary: Although these don't do any harm, they show up in my editor which is configured to highlight trailing whitespace.
Test Plan: Submitted this diff... saw no trailing whitespace.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12369
Joshua Spence [Sun, 12 Apr 2015 08:46:55 +0000 (18:46 +1000)]
Fix a failing unit test
Summary: D11640 incorrectly changed the line endings in this file.
Test Plan: `arc unit`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12322
Joshua Spence [Tue, 7 Apr 2015 08:09:26 +0000 (18:09 +1000)]
Fix text lint issues
Summary: Ref T5105. This is a proof-of-concept for D11458.
Test Plan: `arc lint --everything`
Reviewers: chad, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T5105
Differential Revision: https://secure.phabricator.com/D11640
Joshua Spence [Mon, 6 Apr 2015 21:51:52 +0000 (07:51 +1000)]
Improve array comma rule
Summary: Improve `ArcanistXHPASTLinter::LINT_ARRAY_SEPARATOR` in handling multi-line arrays, see D12280 and D12281 for example. Depends on D12295.
Test Plan: Updated unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12296
Joshua Spence [Mon, 6 Apr 2015 21:26:09 +0000 (07:26 +1000)]
Don't pass data to `jshint` via STDIN
Summary: Fixes T7464. JSHint is unable to exclude files from linting (via the `jshintignore` file) if the data is piped through `STDIN`. An alternative would be to pass `$options[] = '--filename='.$this->getActivePath()`, but `$this->getActivePath()` is not set when the command arguments are constructed.
Test Plan: Created a file and linted it with `ArcanistJSHintLinter`. Was able to exclude the file from linting with a `jshintignore` file.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T7464
Differential Revision: https://secure.phabricator.com/D12298
Joshua Spence [Mon, 6 Apr 2015 21:25:58 +0000 (07:25 +1000)]
Fix parsing of PHP compatibility info
Summary: The format of this file has changed. Depends on D12278.
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12279
Joshua Spence [Mon, 6 Apr 2015 21:24:20 +0000 (07:24 +1000)]
Add a linter rule to detect unnecessary semicolons
Summary:
Ref T7409. Adds a rule to detect unnecessary semicolons. The most common scenario I've seen in the wild is the use of semicolons after a class definition:
```lang=php
class MyClass {
// ...
};
```
Test Plan: Added unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7409
Differential Revision: https://secure.phabricator.com/D12139
Joshua Spence [Mon, 6 Apr 2015 21:22:59 +0000 (07:22 +1000)]
Remove deprecated `ComprehensiveLintEngine` class
Summary: Ref T5655. This class was deprecated in D11673.
Test Plan: Wait a few months.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T5655
Differential Revision: https://secure.phabricator.com/D11740
cburroughs [Mon, 6 Apr 2015 16:11:06 +0000 (09:11 -0700)]
Added RuboCop linter
Test Plan:
Add the following JSON to your `.arclint`:
```lang=json
"rubocop": {
"type": "rubocop",
"include": "(\\.rb$)"
}
```
Then, add a ruby file with errors, for instance:
```lang=ruby
def hello()
puts 'world'
end
```
Run `arc lint`. It should come up with something along the line of: "Omit the parentheses in defs when the method doesn't accept any arguments."
Reviewers: joshuaspence, remon, #blessed_reviewers, epriestley
Reviewed By: joshuaspence, #blessed_reviewers, epriestley
Subscribers: reu, calfzhou, jjooss, cburroughs, chad, Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D10738
Joshua Spence [Sun, 5 Apr 2015 12:27:52 +0000 (22:27 +1000)]
Fix an odd looking array
Summary: This array looks a little odd, most likely due to the autofix applied by `ArcanistXHPASTLinter::LINT_ARRAY_SEPARATOR`. See D12296 in which I attempt to improve the autocorrection from this linter rule.
Test Plan: N/A
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D12280
epriestley [Thu, 2 Apr 2015 20:40:14 +0000 (13:40 -0700)]
Prompt users to ignore or abort on untracked files
Summary:
Fixes T7521. This separates things into two prompts and doesn't try to automatically add untracked files.
This also fixes T7512, or at least I can't reproduce it after this change.
Test Plan:
- Ran `arc diff` in a `git` directory with untracked files.
- Ran `arc diff` in a `svn` directory with untracked files.
- Ran `arc diff` in a `hg` directory with untracked files.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7512, T7521
Differential Revision: https://secure.phabricator.com/D12258
Joshua Spence [Mon, 23 Mar 2015 13:11:19 +0000 (00:11 +1100)]
Add a linter rule for unnecessary use of the `final` modifier
Summary: Ref T7409. This was based on rhttps://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php.
Test Plan: Added unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T7409
Differential Revision: https://secure.phabricator.com/D12135
Joshua Spence [Mon, 23 Mar 2015 12:21:18 +0000 (23:21 +1100)]
Fix a few edge cases for call-time pass-by-reference linting
Summary: Fix a few false positives.
Test Plan: Added test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12134
epriestley [Thu, 19 Mar 2015 02:06:27 +0000 (19:06 -0700)]
Fix chunk upload fallback behavior
Summary:
Ref T7594. Currently, if a chunk upload fails, we incorrectly swallow the failure and fall back to single-file upload, which will often fail by hitting size limits. This also silences the original error.
Instead, do chunk uploads outside the block so that any exceptions escape, and we don't try to fall back to single-file upload.
Mostly just trying to get more info about what's going wrong on @joshuaspence's install.
Test Plan: Faked an exception in chunk upload, ran `arc upload` on a big file, saw the exception displayed on the console.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley, joshuaspence
Maniphest Tasks: T7594
Differential Revision: https://secure.phabricator.com/D12111
epriestley [Sun, 15 Mar 2015 18:31:56 +0000 (11:31 -0700)]
Explicitly draw progress bar when resuming file uploads in `arc upload`
Summary: Ref T7149. Make sure we sit at "Resuming: 60%" or whatever while uploading the first chunk.
Test Plan: Ran `arc upload` on a large file, cancelled it, resumed it, got sensible progress bar.
Reviewers: chad, btrahan
Reviewed By: chad, btrahan
Subscribers: epriestley
Maniphest Tasks: T7149
Differential Revision: https://secure.phabricator.com/D12082
epriestley [Sun, 15 Mar 2015 18:31:41 +0000 (11:31 -0700)]
Remove "force chunking" code from Arcanist
Summary: Ref T7149. This was just for testing and is no longer required.
Test Plan: `grep`
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7149
Differential Revision: https://secure.phabricator.com/D12077
epriestley [Fri, 13 Mar 2015 18:30:50 +0000 (11:30 -0700)]
Make "arc upload" chunk-aware
Summary: Ref T7149. This makes the client try to use the new `file.allocate` API before falling back to the old stuff.
Test Plan: Used `arc upload` to upload files. With chunking forced, uploaded chunked files.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: joshuaspence, epriestley
Maniphest Tasks: T7149
Differential Revision: https://secure.phabricator.com/D12061
Yomi [Thu, 12 Mar 2015 22:23:37 +0000 (15:23 -0700)]
Add a space in the translation when a error message is printed.
Summary: Change 'themto' to 'them to'.
Test Plan: Check message printed...
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12057
nevogd [Fri, 6 Mar 2015 12:41:00 +0000 (04:41 -0800)]
Add untracked files to commit using prompt
Summary:
Refs D11990. When using `arc diff` with untracked files in the working
copy, add the untracked file(s) to the commit (as they weren't stashed or
ignored). Add the untracked paths to the list of changes in the editor
template, indicating that the files were added to the commit.
This doesn't add a separate prompt to add untracked files as per the
behaviour prior to D11843.
Test Plan:
Ran `arc diff` with only untracked files, answered yes to the 'create
new commit' prompt. Saw the commit-message with the updated changes
including untracked files. Completed the arc template, and got commit
containing uncommitted, unstaged and untracked files.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11995
epriestley [Thu, 5 Mar 2015 22:44:59 +0000 (14:44 -0800)]
Check for untracked files in order to fire untracked file prompt
Summary: Fixes T7465. I think I just missed this when untangling the old logic.
Test Plan: Ran `arc diff` with //only// untrakced files, saw warning.
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: epriestley
Maniphest Tasks: T7465
Differential Revision: https://secure.phabricator.com/D11990
epriestley [Mon, 2 Mar 2015 16:34:46 +0000 (08:34 -0800)]
Fix a newline issue in "arc" workflows
Summary:
We end up with one too few newline here in some workflows, like `arc land` with unstaged changes.
Root issue here is that `phutil_console_prompt|confirm` lead with too much whitespace but that's a harder fix.
Test Plan: Saw reasonable whitespace.
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D11927
epriestley [Wed, 25 Feb 2015 21:09:00 +0000 (13:09 -0800)]
Make "arc which --show-base" work as expected
Summary: This is supposed to just print out the base revision, but actually prints out the repository section first.
Test Plan: Ran `arc which`, `arc which --show-base`.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D11888
epriestley [Sat, 21 Feb 2015 10:37:58 +0000 (02:37 -0800)]
Use $EDITOR to prompt users when creating a new commit out of dirty working copy changes
Summary:
Fixes T7344.
Currently, we use `phutil_console_prompt()`, which isn't a very good editor. Use the real $EDITOR instead.
100% of the logic here was also a gigantic mess. Clean it up.
Test Plan: Will update in a second with console output from this run.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7344
Differential Revision: https://secure.phabricator.com/D11843
epriestley [Wed, 11 Feb 2015 21:02:11 +0000 (13:02 -0800)]
Update arcanist to work with more modular translations
Summary:
Ref T7152. Ref T1139.
- Tweak API.
- Move translations out of __init__ file.
Test Plan:
- Ran `arc`.
- Added a goofy translation and made sure it was working.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7152, T1139
Differential Revision: https://secure.phabricator.com/D11746
Joshua Spence [Wed, 11 Feb 2015 07:29:12 +0000 (18:29 +1100)]
Fix `xsprintf` callback
Summary: After all that, I forgot to change this back.
Test Plan: Eyeball it.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11735
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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