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
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
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
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
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
Summary: Ref T5112. The `arc inlines` workflow no longer works because the `differential.getrevisioncomments` API method has been deprecated (see T2222). The command is basically useless right now.
Test Plan: N/A
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Maniphest Tasks: T5112
Differential Revision: https://secure.phabricator.com/D9464
Summary: Adds a linter that checks php files for syntax errors using php -l
Test Plan:
Add a section to your .arclint file similar to:
```
"php": {
"type": "php",
"include": "(\\.php$)"
}
```
Then run arc lint on a php file with a syntax error.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, jacobwalker0814, Korvin
Differential Revision: https://secure.phabricator.com/D10370
Summary:
This adds a lint engine for `hlint`, which is the standard and most general Haskell lint tool around these days.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Test Plan: Install `hlint`, and run `arc unit`.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Projects: #arcanist
Differential Revision: https://secure.phabricator.com/D10250
Summary: Rename `ArcanistPHPCSLinterTestCase` to `ArcanistPhpcsLinterTestCase` for consistency with the class being tested.
Test Plan: `arc unit`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D10145
Summary:
Ref T5655. It is superfluous to include "base" in the name of an abstract base class. Furthermore, it is not done consistently within the code base.
In order to retain compatibility with external code, I have kept the `ArcanistBaseWorkflow` class (which trivially extends from `ArcanistWorkflow`), but it is now deprecated and should output a warning message. Similarly for `ArcanistBaseUnitTestEngine`.
Test Plan: Created a workflow which extends from `ArcanistBaseWorkflow`. Executed the workflow and saw a deprecation warning.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin, aurelijus
Maniphest Tasks: T5655
Differential Revision: https://secure.phabricator.com/D9983
Summary: Ref T5640. In D9864, the data this linter pulls out of the map was changed, breaking "use of undeclared function" warnings.
Test Plan:
```
>>> Lint for src/future/FutureProxy.php:
Error (PHL1) Unknown Symbol
Use of unknown function 'qqqqqq'. Common causes are:
- Your libphutil/ is out of date.
This is the most common cause.
Update this copy of libphutil: /INSECURE/devtools/libphutil
- Some other library is out of date.
Update the library this symbol appears in.
- This symbol is misspelled.
Spell the symbol name correctly.
Symbol name spelling is case-sensitive.
- This symbol was added recently.
Run `arc liberate` on the library it was added to.
- This symbol is external. Use `@phutil-external-symbol`.
Use `grep` to find usage examples of this directive.
*** ALTHOUGH USUALLY EASY TO FIX, THIS IS A SERIOUS ERROR.
*** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.
15 $this->setProxiedFuture($proxied);
16 }
17
>>> 18 qqqqqq();
19 }
20
21 public function setProxiedFuture(Future $proxied) {
```
Reviewers: joshuaspence
Reviewed By: joshuaspence
Subscribers: epriestley
Maniphest Tasks: T5640
Differential Revision: https://secure.phabricator.com/D9954
Summary:
Depends on D9906.
This adds `arc start`, `arc stop` and `arc tracking` for tracking tasks, diffs and other objects in Phrequent.
Test Plan: Tested this against a local install.
Reviewers: skyronic, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: maxhodak, hach-que, aran, epriestley, Korvin
Maniphest Tasks: T3569, T3969
Differential Revision: https://secure.phabricator.com/D7327
Summary:
Fixes T5555. Normally, when we `svn diff subdir/`, we use `--depth empty` to get only changes for the directory itself (usually, property changes).
However, this flag has no effect if the directory is newly added.
Adjust the diff parser so that if two sets of hunks are specified for a single file in a raw diff, we let the last one win instead of including both. This approach is a broadly more reasonable interpretation of these diffs.
Test Plan:
- Added a new file in a new subdirectory in Subversion.
- Ran `arc diff --only`.
- No double file content in resulting diff.
- Added unit test.
- There's fairly comprehensive unit test coverage for this stuff.
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: epriestley
Maniphest Tasks: T5555
Differential Revision: https://secure.phabricator.com/D9921
Summary: As discussed in D9097, the `ArcanistScalaSBTLinter` isn't //really// a linter. Eventually we should add support for a proper Scala linter, but I think that supporting the `ArcanistScalaSBTLinter` as-is is more effort than it is worth.
Test Plan: N/A
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9664
Summary:
Ref T5297. Utilize `PhutilJSONParser` to create a native JSON linter (native in that it is pure PHP with no external dependencies).
Since [[https://github.com/Seldaek/jsonlint | JsonLint]] is literally a PHP port of [[https://github.com/zaach/jsonlint | jsonlint]], I figured that we should also deprecate `ArcanistJSONLintLinter`. `ArcanistJSONLinter` //should// behave identically to `ArcanistJSONLintLinter`.
Depends on D9634.
Test Plan: Ran the `ArcanistJSONLintLinter` unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Maniphest Tasks: T5297
Differential Revision: https://secure.phabricator.com/D9628
Summary: Self explanatory. Also fixed the character offset to start at 1 instead of 0 (because the other linters seem to do this).
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9626
Summary: Add a linter which wraps around [[https://github.com/mdevils/node-jscs | JSCS]].
Test Plan: Currently, we can't test this linter with out existing infrastructure. Specifically, `jscs` will only lint `*.js` files. I have done a fair bit of manual testing though.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9565
Summary: See D9557. Add a unit test to ensure that `src/__phutil_library_map__.php` is up-to-date.
Test Plan: Ran `arc unit`.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9558
Summary: This workflow has been deprecated for a long time now. At some stage, it should be removed.
Test Plan: N/A
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9463
Summary: A `version` workflow would be useful, especially for less technical users. Additionally, whenever I am faced with a new command I reasonably expect `$CMD [--help|help]` and `$CMD [--version|version]` to work.
Test Plan: Ran `arc version`.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9265
Summary: Create bindings for `golint` as an external linter.
Test Plan: Wrote and executed unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9246
Summary: Ref T2039. Now that the `ArcanistConfigurationDrivenLintEngine` has gained more widespread use, we do no longer expect users to need to write their own lint engine. The documentation has already been updated to reflect this.
Test Plan: N/A
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Maniphest Tasks: T2039
Differential Revision: https://secure.phabricator.com/D9198
Summary: After D9057 and D9064 this class is no longer used.
Test Plan: N/A
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9197
Summary: Fixes T3922. Add a linter which complains if files are executable when they shoudn't be.
Test Plan: Tested by modifying the `.arclint` file of the rARC repository and running `arc lint --everything`.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Maniphest Tasks: T3922
Differential Revision: https://secure.phabricator.com/D9187
Summary: Ref T2039. Convert the `ArcanistScalaSBTLinter` into an `ArcanistExternalLinter` and make it compatible with `.arclint`.
Test Plan: I can't really test this because I don't have any Scala projects and we don't have any test cases.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: codeblock, epriestley, Korvin
Maniphest Tasks: T2039
Differential Revision: https://secure.phabricator.com/D9097
Summary:
Add a wrapper around [[http://www.coffeelint.org/ | CoffeeLint]] as an `ArcanistExternalLinter`.
Depends on D9041.
Test Plan: Wrote and executed unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9051
Summary:
Found https://secure.phabricator.com/D4519 but it was horribly out of date, so decided to write a new version.
Kinda clobbered together form that diff and the new version of ArcanistJSHintLinter
Test Plan: Tested on personal projects with js files.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9131
Summary: Fixes T4948. Add a lint renderer which supports outputting the lint results in the Checkstyle XML format.
Test Plan: Ran `arc lint --xml` and inspected the output.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Maniphest Tasks: T4948
Differential Revision: https://secure.phabricator.com/D9083
Summary: Ref T2039. Make the `ArcanistCppcheckLinter` compatible with `.arclint`.
Test Plan: Wrote and executed unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Maniphest Tasks: T2039
Differential Revision: https://secure.phabricator.com/D9068
Summary: Ref T2039. We're starting to get kind of a lot of linters; provide `arc linters` to help users review and understand them and construct `.arclint` files.
Test Plan: {F152205}
Reviewers: btrahan, joshuaspence
Reviewed By: btrahan, joshuaspence
Subscribers: epriestley
Maniphest Tasks: T2039
Differential Revision: https://secure.phabricator.com/D9041
Summary: Convert the `cpplint.py` wrapper linter to `ArcanistExternalLinter`. This is in preparation for T2039.
Test Plan: `arc unit`.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Maniphest Tasks: T2039
Differential Revision: https://secure.phabricator.com/D9033
Summary: This class provides an adapter for [[https://github.com/less/less.js/ | lessc]].
Test Plan: Wrote and executed unit tests.
Reviewers: chad, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D8992
Summary: This linter is a wrapper around [[http://puppet-lint.com/ | puppet-lint[]].
Test Plan: Wrote an executed unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D8990
Summary: Add a linter which uses [[http://php.net/simplexml | SimpleXML]] to detect errors and potential problems in XML files.
Test Plan: Wrote and executed unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D8989
Summary: Provide bindings for [[https://github.com/zaach/jsonlint | JSONLint]], which is a useful tool for linting and validating JSON. Theoretically, this could be done with pure PHP, however it would not be trivial (`json_decode`, for example, does not provide any context as to JSON validation errors).
Test Plan: Wrote and executed unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D8988
Summary:
Ref T3186. Ref T2039.
- Convert JSHint to modern format; improve granularity of errors.
- Convert PyFlakes to modern format;
- Remove ApacheLicenseLinter and LicenseLinter (these have been deprecated for a very long time).
This is somewhat disruptive and will break some users by no longer respecting various path/config options. I'll sequence documentation and deprecation warnings in front of these.
Test Plan: Ran unit tests.
Reviewers: btrahan, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin, joshuaspence, aran
Maniphest Tasks: T3186, T2039
Differential Revision: https://secure.phabricator.com/D6810
Summary: Modernize `ArcanistJSHintLinter` by extending from `ArcanistExternalLinter` instead of `ArcanistLinter`.
Test Plan: Wrote and executed unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D8965
Summary:
Ref T4343. Continues the process of reducing the prominence of Arcanist Projects. Primarily:
- Query Phabricator to identify the working copy based on explicit configuration, or guess based on heuristics.
- Enhance `arc which` to explain the process to the user.
- The `project_id` key is no longer required in `.arcconfig`.
Minor/cleanup changes:
- Rename `project_id` to `project.name` (consistency, clarity).
- Rename `conduit_uri` to `phabricator.uri` (consistency, clairty).
- These both need documentation updates.
- Add `repository.callsign` to explicitly bind to a repository.
- Updated `.arcconfig` for the new values.
- Fix a unit test which broke a while ago when we fixed a rare definition of "unstaged".
- Make `getRepositoryUUID()` generic so we can get rid of one `instanceof`.
Test Plan:
- Ran `arc which`.
- Ran `arc diff`.
- This doesn't really change anything, so the only real risk is version compatibility breaks. This //does// introduce such a break, but the window is very narrow: if you upgrade `arc` after this commit, and try to diff against a Phabricator which was updated after yesterday (D8068) but before D8072 lands, the lookup will work so we'll add `repositoryPHID` to the `differential.creatediff` call, but it won't exist in Phabricator yet. This window is so narrow that I'm not going to try to fix it, as I'd guess there is a significant chance that no users will be affected. I don't see a clever way to fix it that doesn't involve a lot of work, either.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T4343
Differential Revision: https://secure.phabricator.com/D8073
Summary:
Create a new class for them, pass instance around as need.
This looks like it's mostly working, but I'd like to replace the various `new ArcanistConfigurationManager()`
calls with something more suitable.
And maybe get a better name for ArcanistConfigurationManager ("Configuration" is already taken).
Test Plan: arc unit --everything, and then some.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley
CC: Korvin, epriestley, aran, chad
Differential Revision: https://secure.phabricator.com/D7271