1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-10-24 01:28:51 +02:00
Commit graph

1815 commits

Author SHA1 Message Date
epriestley
26b71baf09 Allow "arc browse <symbol>" to resolve symbolic commits
Summary: Ref T5781. This makes things like `arc browse master` work (but they open the commit, not a revision).

Test Plan: Ran `arc browse master`.

Reviewers: csilvers, btrahan

Reviewed By: btrahan

Subscribers: epriestley, spicyj

Maniphest Tasks: T5781

Differential Revision: https://secure.phabricator.com/D10143
2014-08-04 12:03:22 -07:00
epriestley
6849e1f98a Add a --browse flag to arc todo
Summary: Ref T5781. Like D10141, but for `arc todo`. Fixes T5787.

Test Plan: See T5787.

Reviewers: btrahan, csilvers

Reviewed By: csilvers

Subscribers: epriestley, spicyj

Maniphest Tasks: T5781, T5787

Differential Revision: https://secure.phabricator.com/D10142
2014-08-04 12:03:12 -07:00
epriestley
72447f649f Add a --browse flag to arc diff, to open objects in a browser after creating them
Summary: Ref T5781. Add a flag to optionally open a web browser after creating a diff or revision.

Test Plan: Created //this revision// with `arc diff --browse` // !!! //

Reviewers: csilvers, btrahan

Reviewed By: btrahan

Subscribers: epriestley, spicyj

Maniphest Tasks: T5781

Differential Revision: https://secure.phabricator.com/D10141
2014-08-04 12:03:03 -07:00
epriestley
2e6d11c18a Allow "arc browse" to browse objects
Summary: Ref T5781. This implements `arc browse T234`, for any monogrammed object.

Test Plan:
  - Ran `arc browse T234` outside of a working copy (does not require repository API).
  - Ran `arc browse T234` in a working copy, got task.
  - Ran `arc browse PATH` in a working copy.
  - Ran `arc browse nonpath` with and without `--force`.

Reviewers: csilvers, btrahan

Reviewed By: btrahan

Subscribers: epriestley, spicyj

Maniphest Tasks: T5781

Differential Revision: https://secure.phabricator.com/D10140
2014-08-04 12:02:54 -07:00
Joseph Battelle
bb6d11b732 Use GIT tracked branches for arc land targets when reasonable
Summary:
See T5690.
-arc land now respects tracked branch when choosing 'onto'; '--onto' option remains as an override.
-arc land now respects tracked branch when choosing a remote; the remote is taken from 'onto's upstream unless the '--remote' option is present; when 'onto' branch has no upstream the '--remote' option must be provided as before.

Since 'arc feature' branches are (already) created as tracking branches, 'arc.land.onto.default' if present, is only used as the default when a non-tracking branch created by some other means is landed with out explicit '--onto'.  This may be surprising but is probably the correct go-forward behavior and is inline with the description in T5690.

Test Plan:
-checked having no arc.land.onto.default still assumes 'master'
-checked 'arc.land.onto.default' still overrides 'master'
-checked upstream branch (of feature branch) overrides 'master' and 'arc.land.onto.default'
-checked '--onto' overrides all
-checked origin is default for non-tracking branches
-checked the land onto branch's upstream remote is used instead of 'origin'
-checked '--remote' overrides 'origin' and the tracked upstream
-tested several crazy branch names including 'something/like/this' for both the upstream and tracking branches
-tested on linux and OS X
-rinse and repeat on Windows

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5690

Differential Revision: https://secure.phabricator.com/D10058
2014-07-28 16:22:09 -07:00
Joshua Spence
76d80faddf Rename ArcanistLintRenderer subclasses
Summary: Ref T5655.

Test Plan: `arc lint` and `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D10011
2014-07-25 08:16:29 +10:00
epriestley
9e357d3fd0 Restore the old "history.immutable" default behavior
Summary: See rARC104219dd. Per the explanatory text, this should default to `true` in Mercurial and `false` in Git.

Test Plan: Ran `arc get-config` in Mercurial repo.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10021
2014-07-23 06:46:42 -07:00
Joshua Spence
ef18ae08eb Don't explicitly name abstract base classes
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
2014-07-22 07:49:15 +10:00
epriestley
c6e6227ef9 Use have/need data in ArcanistPhutilLibraryLinter
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
2014-07-17 14:34:59 -07:00
James Rhodes
a953544657 Remove "Stopped" logic from Phrequent workflows
Summary: We can remove this "Stopped" code as per feedback on D7327.  I think having the full text of "In Progress" and "Suspended" is much clearer than just a '*' though, so I've only removed the ongoing check.

Test Plan: Ran a combination of `arc start`, `arc stop` and `arc time` and it all worked.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9955
2014-07-17 13:26:00 +10:00
James Rhodes
f658f17080 Add Phrequent workflows to Arcanist
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
2014-07-17 11:58:22 +10:00
Joshua Spence
76cba9d46b Remove duplicate newline
Summary: Remove a duplicate newline from end-of-file.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9951
2014-07-17 08:25:22 +10:00
Joshua Spence
040ffdbe9d Add a newline to externals/includes/README
Summary: For consistency, add a trailing newline to `externals/includes/README`. See D9940.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9950
2014-07-16 22:11:52 +10:00
Joshua Spence
dc2e05d81a Reformat README as Remarkup
Summary: We have Remarkup, so why not use it?

Test Plan: See D9946.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9949
2014-07-16 22:11:10 +10:00
Evan Priestley
97501da164 Fix double file content in files in new subdirectories in Subversion
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
2014-07-15 09:43:04 -07:00
Joshua Spence
9016207307 Fix various spelling mistakes
Summary: Minor change, self-explanatory.

Test Plan: Eye-ball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9910
2014-07-13 00:45:38 +10:00
epriestley
f9f2092246 Use git diff a b for ranges, not git diff a..b
Summary:
These are documented as being identical, but `git diff a b` works if `a` is a tree (for example, `4b825d...`, the empty tree hash), but `git diff a..b` does not.

Particularly, with the `a..b` form, `arc diff --base arc:empty` does not work. With the `a b` form, it does.

Test Plan: Ran `arc diff --base arc:empty` in a repository and got a diff.

Reviewers: btrahan, talshiri

Reviewed By: talshiri

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9898
2014-07-11 10:45:11 -07:00
Joshua Spence
09cf64bec3 Remove Phabricator reference from the linter description of ArcanistXHPASTLinter
Summary: The `ArcanistXHPASTLinter` is no longer //too// specific to Phabricator (Phabricator-specific XHPAST lints generally live in `ArcanistPhutilXHPASTLinter`) and //should// be better suited for general purpose usage.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9892
2014-07-12 01:25:51 +10:00
Joshua Spence
806f21315a Minor change to ArcanistXHPASTLinter
Summary: Change `==` to `===`. This is a little bit cleaner because we shouldn't need type coercion here.

Test Plan: Ran `arc unit`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9893
2014-07-12 01:21:21 +10:00
epriestley
0be983a7a3 Parameterize @{upstream} in arc to fix Windows
Summary: We manually quote this in a couple of places. That works fine on Lunix, but does not work on Windows. Instead, explicitly parameterize the command so the correct quoting rules are applied for the OS.

Test Plan: See IRC; windows user had issues fixed by this. `arc:upstream` still works locally.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9868
2014-07-10 07:56:35 -07:00
Joshua Spence
f4615cd86b Allow the todo workflow to add project tags.
Summary: Fixes T4418. Allows Maniphests created through the `arc todo` workflow to have projects assigned.

Test Plan:
```
> ./bin/arc --trace --conduit-uri='http://phabricator.joshuaspence.com' todo "Test project" --project foo --project bar
libphutil loaded from '/home/joshua/workspace/github.com/phacility/libphutil/src'.
arcanist loaded from '/home/joshua/workspace/github.com/phacility/arcanist/src'.
Config: Reading user configuration file "/home/joshua/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/home/joshua/workspace/github.com/phacility/arcanist/.arcconfig".
Working Copy: Path "/home/joshua/workspace/github.com/phacility/arcanist" is part of `git` working copy "/home/joshua/workspace/github.com/phacility/arcanist".
Working Copy: Project root is at "/home/joshua/workspace/github.com/phacility/arcanist".
Config: Did not find local configuration at "/home/joshua/workspace/github.com/phacility/arcanist/.git/arc/config".
Loading phutil library from '/home/joshua/workspace/github.com/phacility/arcanist/src'...
>>> [0] <conduit> conduit.connect() <bytes = 618>
>>> [1] <http> http://phabricator.joshuaspence.com/api/conduit.connect
<<< [1] <http> 1,050,487 us
<<< [0] <conduit> 1,051,585 us
>>> [2] <conduit> project.query() <bytes = 199>
>>> [3] <http> http://phabricator.joshuaspence.com/api/project.query
<<< [3] <http> 294,584 us
<<< [2] <conduit> 294,986 us
>>> [4] <conduit> maniphest.createtask() <bytes = 313>
>>> [5] <http> http://phabricator.joshuaspence.com/api/maniphest.createtask
<<< [5] <http> 637,693 us
<<< [4] <conduit> 638,098 us
Created task T6: 'Test project' at http://phabricator.joshuaspence.com/T6
```

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T4418

Differential Revision: https://secure.phabricator.com/D9457
2014-07-10 21:48:49 +10:00
Joshua Spence
3de9e4aaea Allow the ArcanistPhutilLibraryLinter to recover from PHP syntax errors
Summary: Fixes T5577. If the `ArcanistPhutilLibraryLinter` lints a PHP file that contains a syntax error, it will die horribly. Instead, force it to continue as if nothing was wrong.

Test Plan: Introduced a PHP syntax error. Ran `arc lint` and made sure the output looked reasonable.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5577

Differential Revision: https://secure.phabricator.com/D9865
2014-07-10 11:48:45 +10:00
Aviv Eyal
dfdaed0b27 Don't build unused linters for the ArcanistConfigurationDrivenLintEngine
Summary: Fixes T5124.

Test Plan: `arc lint` on a Phabricator diff that doesn't have JS files doesn't complain on missing JSHint.

Reviewers: #blessed_reviewers, joshuaspence, epriestley

Reviewed By: joshuaspence

Subscribers: epriestley, Korvin

Maniphest Tasks: T5124

Differential Revision: https://secure.phabricator.com/D9843
2014-07-09 15:33:58 -07:00
Joshua Spence
8975e3a424 Decrease the priority of the ArcanistPhutilLibraryLinter
Summary: Ref T5577. Decrease the priority of the `ArcanistPhutilLibraryLinter` such that it is lower than that of the `ArcanistXHPASTLinter`. There isn't any specific reason that we should do this, although it seems to generally be a reasonable idea.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5577

Differential Revision: https://secure.phabricator.com/D9866
2014-07-10 08:06:37 +10:00
Joshua Spence
e37a76896a Minor change to ArcanistPhutilLibraryLinter
Summary: Ref T5577. Modify `ArcanistPhutilLibraryLinter` to use `PhutilLibraryMapBuilder` instead of using an `ExecFuture` to run `phutil_rebuild_map.php`.

Test Plan: Ran `arc lint`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5577

Differential Revision: https://secure.phabricator.com/D9864
2014-07-10 07:38:40 +10:00
Joshua Spence
b45142e608 Minor change to ArcanistInfrastructureTestCase
Summary: Update `ArcanistInfrastructureTestCase` after D9860 and D9861.

Test Plan: `arc unit` should do the trick.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9863
2014-07-10 07:34:35 +10:00
Joshua Spence
d09beeb75c Remove @group annotations
Summary: I'm pretty sure that `@group` annotations are useless now... I believe that they were originally used by Diviner?

Test Plan: Eye-balled it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin, aurelijus

Differential Revision: https://secure.phabricator.com/D9855
2014-07-09 09:12:13 +10:00
Joshua Spence
b09d21d878 Remove deprecated lints from ArcanistXHPASTLinter
Summary: After D9576, `LINT_PHP_53_FEATURES` and `LINT_PHP_54_FEATURES` are deprecated. They have been replaced by `LINT_PHP_COMPATIBILITY`.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9657
2014-07-08 10:54:40 +10:00
Joshua Spence
32623f84c7 Minor change to ArcanistInfrastructureTestCase::testLibraryMap
Summary: Modify `ArcanistInfrastructureTestCase::testLibraryMap` to use `phutil_get_current_library_name()` instead of hard-coding the library name.

Test Plan: See D9844.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9846
2014-07-06 23:50:30 +10:00
epriestley
ac73fb8cbd In Arcanist, ignore extensions when unit testing the library map
Summary: See D9834. Arcanist version.

Test Plan: See D9834.

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9835
2014-07-06 06:21:55 -07:00
Joshua Spence
9bac06cf60 Improve the ArcanistInfrastructureTestCase unit tests
Summary:
Improve the `ArcanistInfrastructureTestCase` unit tests such that they will fail if any of the following conditions are satisfied:

- A symbol referenced in the `__phutil_library_map__.php` file no longer exists.
- A symbol exists in the library but is not referenced within the `__phutil_library_map__.php` file.
- A symbol extends from a different parent symbol than that declared in the `__phutil_library_map.php` file.

Test Plan: See D9824

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9826
2014-07-06 01:50:53 +10:00
Joshua Spence
ae680d9114 Regenerate library map
Summary: Ran `arc liberate` after D9805.

Test Plan: `arc liberate`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9825
2014-07-06 01:14:29 +10:00
Joshua Spence
7de6549338 Move PhutilLibraryMapBuilder to libphutil
Summary: See D9813 for a detailed explanation.

Test Plan:
```
> ./bin/arc liberate
Finding source files...
Found 194 files.
Loading symbol cache...
Found 194 files in cache.
Building library map...
Writing map...
Done.
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9815
2014-07-05 17:01:36 +10:00
Joshua Spence
494d974005 Move ArcanistSpellingDefaultData into a configurable JSON file
Summary: Currently, the `ArcanistSpellingLinter` loads data from `ArcanistSpellingDefaultData`, with no way to configure the linter from an `.arclint` file. Instead we should define a format for a "dictionary" file, of which the `ArvcanistSpellingLinter` can load and of which the paths are easily configured through `.arclint`.

Test Plan:
Updated the test case and ran `arc unit`.

NOTE: I have removed the `LINT_SPELLING_PICKY` and `LINT_SPELLING_IMPORTANT` constants and replaced them with `LINT_SPELLING_FULL` and `LINT_SPELLING_PARTIAL`. This was done because it simplifies the implementation considerably and makes customization of the `ArcanistSpellingLinter` simpler, but also because these constants were not widely used in the existing implementation.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9805
2014-07-04 08:18:33 +10:00
Joshua Spence
df1491c449 Alphabetize .arclint linters
Summary: I'm a bit OCD with this, but I find the `.arclint` file easier to read if the keys are in alphabetical order.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9804
2014-07-03 11:56:29 +10:00
Richard van Velzen
792204db95 Refactor author handling in the Mercurial API
Summary: There were two callsites which needed some information from the username. Only one worked "correctly", causing `arc diff` to not amend commits anymore because the author could not be parser.

Test Plan: run `arc diff` with changes

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9797
2014-07-02 13:59:25 -07:00
Joshua Spence
ca5f05e62b Enable unit tests for ArcanistJscsLinterTestCase
Summary:
https://github.com/mdevils/node-jscs/issues/444 has been resolved in commit [[0de667bac2 | 0de667bac2491ba04d930ff94e990965213ba36b]], which means that `jscs` can be easily run on files with any extension.

NOTE: JSCS version 1.5.7 is required.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9789
2014-07-03 05:15:09 +10:00
Joshua Spence
aaf626fc39 Update spelling data
Summary: Update `ArcanistSpellingDefaultData` with data from the [[http://anonscm.debian.org/gitweb/?p=lintian/lintian.git;a=blob_plain;f=data/spelling/corrections;hb=4b3fc40babff01874b54718406b77b7f3052d26a | original source]].

Test Plan: Visual inspection.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9790
2014-07-01 22:21:49 +10:00
epriestley
0971c728fe Update arcanist NOTICE file
Summary: See D9730.

Test Plan: reading

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9731
2014-06-25 13:43:07 -07:00
Joshua Spence
5ab288b30c ArcanistChmodLinter should not allow certain MIME types to be executable
Summary: Fixes T5466. An image is an example of a binary which should //not// be executable. Modify the `ArcanistChmodLinter` to disallow certain blacklisted MIME types from being executable.

Test Plan: Created an executable image file and ran `arc lint` over this file.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: richardvanvelzen, epriestley, Korvin

Maniphest Tasks: T5466

Differential Revision: https://secure.phabricator.com/D9723
2014-06-26 05:30:23 +10:00
Joshua Spence
439dff5e09 Fix a spelling mistake and tidy up whitespace
Summary: Self-explanatory.

Test Plan: Eye-ball it.

Reviewers: epriestley, chad, #blessed_reviewers

Reviewed By: chad, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9705
2014-06-24 15:09:53 +10:00
Joshua Spence
108a4dc9e6 Pass the file contents instead of the file path to phutil_json_decode.
Summary: See D9681#22.

Test Plan: Created an empty `.git/arc/config` file... no exception was thrown.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9704
2014-06-24 12:02:19 +10:00
Joshua Spence
750a94e89f Better handling of .arcconfig files.
Summary:
Throw a useful error message when an `.arcconfig` file is not valid JSON.

Depends on D9697.

Test Plan:
Modified an `.arcconfig` file to be invalid JSON.

```
> arc lint
Usage Exception: Your '~/.arcrc' file is not a valid JSON file.

Parse error on line 18 at column 4: Expected: 'STRING' - It appears you have an extra trailing comma
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9681
2014-06-24 09:24:41 +10:00
Joshua Spence
30df78f64c Improve the handling of .arclint files.
Summary: Throw a useful error message when an `.arclint` file is not valid JSON.

Test Plan:
Modified an `.arclint` file to be invalid JSON.

```
> arc lint
Exception
Parse error on line 24 at column 5: Expected one of: 'EOF', '}', ',', ']'
(Run with --trace for a full exception trace.)
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9679
2014-06-24 09:24:30 +10:00
Joshua Spence
69cd86fa4f If a PhutilProxyException is thrown by Arcanist, print all error messages.
Summary: `PhutilProxyException` provides the capability to nest exceptions. However, if we throw a `PhutilProxyException` then we currently only display the error message from the top-most exception. Instead, we should print all of the nested exception messages.

Test Plan: Faked an error, saw multiple lines of exception messages.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9697
2014-06-24 09:24:00 +10:00
Joshua Spence
c727a98f73 Add a URL to support a TODO comment.
Summary: Provide a link to a "resolved" [[http://bugs.xdebug.org/view.php?id=1041 | Xdebug issue]] to support a TODO comment. Further information can be found at http://derickrethans.nl/dead-code.html.

Test Plan: Read the article.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9696
2014-06-24 04:56:52 +10:00
Joshua Spence
213628ff34 Skip the "Too Many Errors" error that is raised by JSHint.
Summary: If JSHint encounters //too many// errors (by default, more than 50) errors, then it quits prematurely and raises an additional (rather unhelpful) "Too Many Errors" error. We should just ignore this additional error.

Test Plan: Added a test case.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9693
2014-06-24 04:16:15 +10:00
Joshua Spence
48d62ed444 Don't use error context from JSHint in linter messages
Summary:
The error context (a.k.a. "original text") as provided by `jshint` is not very useful and actually causes `arc lint` to display the lint message incorrectly.

{F169277}

The underlying problem here is that the error context from `jshint` contains the entire line from the input file rather than just the offending source code.

Test Plan: Ran `arc lint -- webroot/rsrc/js/core/behavior-hovercard.js` (in rP) and verified that the output looked reasonable.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9675
2014-06-23 10:33:01 +10:00
Joshua Spence
4fd6c99a93 Only lint files in the working copy with arc lint --everything.
Summary: Fixes T5442. `arc lint --everything` currently uses a `FileFinder` to discover paths for linting. A consequence of this is that files that are ignored or otherwise excluded from version control are linted.

Test Plan: Ran `arc lint --everything` in rPHU and noticed that I wasn't prompted to add a trailing newline to `src/.phutil_module_cache`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5442

Differential Revision: https://secure.phabricator.com/D9674
2014-06-23 10:30:57 +10:00
epriestley
b2aeca1963 Remove SBTLinter from ComprehensiveEngine
Summary: D9664 removed this, clean up this remaining callsite.

Test Plan: `grep`

Reviewers: chad, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9668
2014-06-22 12:40:36 -07:00