Arcanist Technical Documentation

Updated
Thu, Apr 24, 5:36 PM

Technical documentation for developing Arcanist.

workflow

ArcanistAliasWorkflowClassManages aliases for commands with options.ArcanistAnoidWorkflowClassArcanistBackoutWorkflowClassRuns git revert and assigns hi pri task to original authorArcanistBookmarkWorkflowClassAlias for arc featureArcanistBranchWorkflowClassAlias for arc featureArcanistCallConduitWorkflowClassProvides command-line access to the Conduit API.ArcanistChooseInvalidRevisionExceptionClassThrown when the user chooses an invalid revision when prompted by a workflow.ArcanistChooseNoRevisionsExceptionClassThrown when there are no valid revisions to choose from, in a workflow which prompts the user to choose a revision.ArcanistCloseRevisionWorkflowClassExplicitly closes Differential revisions.ArcanistCloseWorkflowClassClose a taskArcanistCommitWorkflowClassExecutes "svn commit" once a revision has been "Accepted".ArcanistCoverWorkflowClassCovers your professional reputation by blaming changes to locate reviewers.ArcanistDiffWorkflowClassSends changes from your working copy to Differential for code review.ArcanistDownloadWorkflowClassDownload a file from Phabricator.ArcanistExportWorkflowClassExports changes from Differential or the working copy to a file.ArcanistFeatureWorkflowClassDisplays user's Git branches or Mercurial bookmarksArcanistFlagWorkflowClassArcanistGetConfigWorkflowClassRead configuration settings.ArcanistGitHookPreReceiveWorkflowClassInstallable as a git pre-receive hook.ArcanistHelpWorkflowClassSeduces the reader with majestic prose.ArcanistInlinesWorkflowClassArcanistInstallCertificateWorkflowClassInstalls arcanist certificates.ArcanistLandWorkflowClassLands a branch by rebasing, merging and amending it.ArcanistLiberateWorkflowClassCreate and update libphutil libraries.ArcanistLintWorkflowClassRuns lint rules on changes.ArcanistListWorkflowClassLists open revisions in Differential.ArcanistMarkCommittedWorkflowClassArcanistNoEffectExceptionClassThrown when lint or unit tests have no effect, i.e. no paths are affected by any linter or no unit tests provide coverage.ArcanistNoEngineExceptionClassThrown when no engine is configured for linting or running unit tests.ArcanistPasteWorkflowClassUpload a chunk of text to the Paste application, or download one.ArcanistPatchWorkflowClassApplies changes from Differential or a file to the working copy.ArcanistRevertWorkflowClassRedirects to arc backout workflowArcanistSetConfigWorkflowClassWrite configuration settings.ArcanistShellCompleteWorkflowClassPowers shell-completion scripts.ArcanistSvnHookPreCommitWorkflowClassInstallable as an SVN "pre-commit" hook.ArcanistTasksWorkflowClassDisplays User TasksArcanistTodoWorkflowClassQuickly create a taskArcanistUnitWorkflowClassRuns unit tests which cover your changes.ArcanistUpgradeWorkflowClassUpgrade arcanist itself.ArcanistUploadWorkflowClassUpload a file to Phabricator.ArcanistUsageExceptionClassThrown when there is a problem with how a user is invoking a command, rather than a technical problem.ArcanistUserAbortExceptionClassThrown when the user chooses not to continue when warned that they're about to do something dangerous.ArcanistWhichWorkflowClassShow which revision or revisions are in the working copy.

linter

ArcanistBaseXHPASTLinterClassArcanistCppcheckLinterClassUses cppcheck to do basic checks in a cpp fileArcanistCpplintLinterClassUses google's cpplint.py to check code.ArcanistCSharpLinterClassC# linter for Arcanist.ArcanistCSSLintLinterClassUses "CSS lint" to detect checkstyle errors in css code. To use this linter, you must install CSS lint. ##npm install csslint -g## (don't forget the -g flag or NPM will install the package locally).ArcanistFilenameLinterClassStifles creativity in choosing imaginative file names.ArcanistFlake8LinterClassUses "flake8" to detect various errors in Python code. Requires version 1.7.0 or newer of flake8.ArcanistGeneratedLinterClassStops other linters from running on generated code.ArcanistJSHintLinterClassUses "JSHint" to detect errors and potential problems in JavaScript code. To use this linter, you must install jshint through NPM (Node Package Manager). You can configure different JSHint options on a per-file basis.ArcanistLinterClassImplements lint rules, like syntax checks for a specific language.ArcanistMergeConflictLinterClassChecks files for unresolved merge conflicts.ArcanistNoLintLinterClassStops other linters from running on code marked with a nolint annotation.ArcanistPEP8LinterClassUses "pep8.py" to enforce PEP8 rules for Python.ArcanistPhpcsLinterClassUses "PHP_CodeSniffer" to detect checkstyle errors in php code. To use this linter, you must install PHP_CodeSniffer. http://pear.php.net/package/PHP_CodeSniffer.ArcanistPhutilLibraryLinterClassApplies lint rules for Phutil libraries. We enforce three rules:ArcanistPhutilXHPASTLinterClassArcanistPyFlakesLinterClassUses "PyFlakes" to detect various errors in Python code.ArcanistPyLintLinterClassUses "PyLint" to detect various errors in Python code. To use this linter, you must install pylint and configure which codes you want to be reported as errors, warnings and advice.ArcanistRubyLinterClassUses `ruby` to detect various errors in Ruby code.ArcanistScalaSBTLinterClassUses `sbt compile` to detect various warnings/errors in Scala code.ArcanistScriptAndRegexLinterClassSimple glue linter which runs some script on each path, and then uses a regex to parse lint messages from the script's output. (This linter uses a script and a regex to interpret the results of some real linter, it does not itself lint both scripts and regexes).ArcanistSingleLintEngineClassRun a single linter on every path unconditionally. This is a glue engine for linters like @{class:ArcanistScriptAndRegexLinter}, if you are averse to writing a phutil library. Your linter will receive every path, including paths which have been moved or deleted.ArcanistSpellingDefaultDataClassContains default spelling correction rules for ArcanistSpellingLinter. Inside its own file to keep logic of ArcanistSpellingLinter cleanArcanistSpellingLinterClassEnforces basic spelling. Spelling inside code is actually pretty hard to get right without false positives. I take a conservative approach and just use a blacklisted set of words that are commonly spelled incorrectly.ArcanistTextLinterClassEnforces basic text file rules.ArcanistXHPASTLinterClassUses XHPAST to apply lint rules to PHP.ComprehensiveLintEngineClassBasic lint engine which just applies several linters based on the file typesExampleLintEngineClassThis a simple example lint engine which just applies the @{class:ArcanistPyLintLinter} to any Python files. For a more complex example, see @{class:PhutilLintEngine}.PhutilLintEngineClassLint engine which enforces libphutil rules.

Free Radicals

ArcanistAmendWorkflowClassSynchronizes commit messages from Differential.ArcanistBaseCommitParserClassArcanistBaseCommitParserTestCaseClassArcanistBaseTestResultParserClassAbstract Base class for test result parsersArcanistBaseWorkflowClassImplements a runnable command, like "arc diff" or "arc help".ArcanistBritishTestCaseClassArcanistBrowseWorkflowClassBrowse files in the Diffusion web interface.ArcanistBundleTestCaseClassArcanistCapabilityNotSupportedExceptionClassArcanistCommentRemoverClassArcanistCommentRemoverTestCaseClassArcanistConduitLinterClassImplements linting via Conduit RPC call. Slow by definition, but allows sophisticated linting that relies on stuff like big indexes of a codebase. Recommended usage is to gate these to the advice lint level.ArcanistConfigurationDrivenLintEngineClassArcanistCSSLintLinterTestCaseClassArcanistDifferentialDependencyGraphClassArcanistDifferentialRevisionHashClassArcanistDifferentialRevisionStatusClassArcanistEventTypeClassArcanistExternalLinterClassBase class for linters which operate by invoking an external program and parsing results.ArcanistFutureLinterClassArcanistHgClientChannelClassChannel to a Mercurial "cmdserver" client. For a detailed description of the "cmdserver" protocol, see @{class:ArcanistHgServerChannel}. This channel implements the other half of the protocol: it decodes messages from the client and encodes messages from the server.ArcanistHgProxyClientClassClient for an @{class:ArcanistHgProxyServer}. This client talks to a PHP process which serves as a proxy in front of a Mercurial server process. The PHP proxy allows multiple clients to use the same Mercurial server.ArcanistHgProxyServerClassServer which @{class:ArcanistHgProxyClient} clients connect to. This server binds to a Mercurial working copy and creates a Mercurial process and a unix domain socket in that working copy. It listens for connections on the socket, reads commands from them, and forwards their requests to the Mercurial process. It then returns responses to the original clients.ArcanistHgServerChannelClassChannel to a Mercurial "cmdserver" server. Messages sent to the server look like this:ArcanistHookAPIClassAPI while running in the context of a commit hookArcanistMercurialParserTestCaseClassArcanistPEP8LinterTestCaseClassArcanistPHPCSLinterTestCaseClassArcanistPhutilTestCaseClassBase test case for the very simple libphutil test framework.ArcanistRepositoryAPIMiscTestCaseClassArcanistRepositoryAPIStateTestCaseClassArcanistSubversionHookAPIClassInterfaces with Subversion while running as a commit hook.ArcanistTestCaseClassArcanistUncommittedChangesExceptionClassArcanistXHPASTLintTestSwitchHookClassGoTestResultParserClassGo Test Result Parsing utilityPhpunitResultParserClassPHPUnit Result Parsing utility