1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-14 19:02:40 +01:00

(stable) Promote 2015 Week 37

This commit is contained in:
epriestley 2015-09-13 06:44:52 -07:00
commit 3168583159
14 changed files with 71 additions and 53 deletions

View file

@ -5,7 +5,7 @@ final class ArcanistComposerLinter extends ArcanistLinter {
const LINT_OUT_OF_DATE = 1;
public function getInfoName() {
return pht('Composer');
return pht('Composer Dependency Manager');
}
public function getInfoDescription() {

View file

@ -6,7 +6,7 @@
final class ArcanistCppcheckLinter extends ArcanistExternalLinter {
public function getInfoName() {
return 'Cppcheck';
return 'C++ linter';
}
public function getInfoURI() {

View file

@ -6,7 +6,7 @@
final class ArcanistCpplintLinter extends ArcanistExternalLinter {
public function getLinterName() {
return 'CPPLINT';
return 'C++ Google\'s Styleguide';
}
public function getLinterConfigurationName() {

View file

@ -7,7 +7,7 @@
final class ArcanistFlake8Linter extends ArcanistExternalLinter {
public function getInfoName() {
return 'Flake8';
return 'Python Flake8 multi-linter';
}
public function getInfoURI() {

View file

@ -6,7 +6,7 @@
final class ArcanistHLintLinter extends ArcanistExternalLinter {
public function getInfoName() {
return 'HLint';
return 'Haskell Linter';
}
public function getInfoURI() {

View file

@ -9,7 +9,7 @@ final class ArcanistJSHintLinter extends ArcanistExternalLinter {
private $jshintrc;
public function getInfoName() {
return 'JSHint';
return 'JavaScript error checking';
}
public function getInfoURI() {

View file

@ -6,7 +6,7 @@ final class ArcanistJscsLinter extends ArcanistExternalLinter {
private $preset;
public function getInfoName() {
return 'JSCS';
return 'JavaScript Code Style';
}
public function getInfoURI() {

View file

@ -10,7 +10,7 @@ final class ArcanistPyFlakesLinter extends ArcanistExternalLinter {
}
public function getInfoName() {
return pht('PyFlakes');
return pht('Python PyFlakes');
}
public function getInfoDescription() {

View file

@ -5,7 +5,7 @@ final class ArcanistRuboCopLinter extends ArcanistExternalLinter {
private $config;
public function getInfoName() {
return 'RuboCop';
return 'Ruby static code analyzer';
}
public function getInfoURI() {

View file

@ -27,6 +27,8 @@ final class ArcanistFileDataRef extends Phobject {
private $errors = array();
private $phid;
private $fileHandle;
private $deleteAfterEpoch;
private $viewPolicy;
/* -( Configuring File References )---------------------------------------- */
@ -107,6 +109,48 @@ final class ArcanistFileDataRef extends Phobject {
}
/**
* @task config
*/
public function setViewPolicy($view_policy) {
$this->viewPolicy = $view_policy;
return $this;
}
/**
* @task config
*/
public function getViewPolicy() {
return $this->viewPolicy;
}
/**
* Configure a file to be temporary instead of permanent.
*
* By default, files are retained indefinitely until explicitly deleted. If
* you want to upload a temporary file instead, you can specify an epoch
* timestamp. The file will be deleted after this time.
*
* @param int Epoch timestamp to retain the file until.
* @return this
* @task config
*/
public function setDeleteAfterEpoch($epoch) {
$this->deleteAfterEpoch = $epoch;
return $this;
}
/**
* @task config
*/
public function getDeleteAfterEpoch() {
return $this->deleteAfterEpoch;
}
/* -( Handling Upload Results )-------------------------------------------- */

View file

@ -27,7 +27,6 @@ final class ArcanistFileUploader extends Phobject {
private $conduit;
private $files;
private $config = array();
/* -( Configuring the Uploader )------------------------------------------- */
@ -79,33 +78,6 @@ final class ArcanistFileUploader extends Phobject {
}
/**
* Configure a file to be temporary instead of permanent.
*
* By default, files are retained indefinitely until explicitly deleted. If
* you want to upload a temporary file instead, you can specify an epoch
* timestamp. The file will be deleted after this time.
*
* @param string Key identifying the file you want to make temporary, as
* passed to @{method:addFile}.
* @param int Epoch timestamp to retain the file until.
* @return this
* @task add
*/
public function setDeleteFileAfterEpoch($file_key, $epoch) {
if (empty($this->files[$file_key])) {
throw new Exception(
pht(
'No file with given key ("%s") has been added to this uploader.',
$file_key));
}
$this->config[$file_key]['deleteAfterEpoch'] = $epoch;
return $this;
}
/* -( Uploading Files )---------------------------------------------------- */
@ -144,19 +116,22 @@ final class ArcanistFileUploader extends Phobject {
$conduit = $this->conduit;
$futures = array();
foreach ($files as $key => $file) {
$config = idx($this->config, $key, array());
$params = array(
'name' => $file->getName(),
'contentLength' => $file->getByteSize(),
'contentHash' => $file->getContentHash(),
);
$delete_after = idx($config, 'deleteAfterEpoch');
$delete_after = $file->getDeleteAfterEpoch();
if ($delete_after !== null) {
$params['deleteAfterEpoch'] = $delete_after;
}
$view_policy = $file->getViewPolicy();
if ($view_policy !== null) {
$params['viewPolicy'] = $view_policy;
}
$futures[$key] = $conduit->callMethod('file.allocate', $params);
}

View file

@ -104,8 +104,8 @@ EOTEXT
$console->writeOut(
"<bg:".$color.">** %s **</bg> **%s** (%s)\n",
$text,
nonempty($linter['short'], '-'),
$linter['name']);
nonempty($linter['name'], '-'),
$linter['short']);
if ($linter['exception']) {
$console->writeOut(
@ -241,11 +241,11 @@ EOTEXT
}
$linter_info[$key] = array(
'short' => $linter->getLinterConfigurationName(),
'name' => $linter->getLinterConfigurationName(),
'class' => get_class($linter),
'status' => $status,
'version' => $version,
'name' => $linter->getInfoName(),
'short' => $linter->getInfoName(),
'uri' => $linter->getInfoURI(),
'description' => $linter->getInfoDescription(),
'exception' => $exception,

View file

@ -53,18 +53,18 @@ EOTEXT
$this->setRepositoryAPI($repository);
// Require no local changes.
$this->requireCleanWorkingCopy();
// Require the library be on master.
$branch_name = $repository->getBranchName();
if ($branch_name != 'master') {
if ($branch_name != 'master' && $branch_name != 'stable') {
throw new ArcanistUsageException(
pht(
"%s must be on branch '%s' to be automatically upgraded. ".
"%s must be on either branch '%s' or '%s' to be automatically ".
"upgraded. ".
"This copy of %s (in '%s') is on branch '%s'.",
$lib,
'master',
'stable',
$lib,
$root,
$branch_name));

View file

@ -69,13 +69,12 @@ EOTEXT
->setName(basename($path))
->setPath($path);
$uploader->addFile($file, $key);
if ($is_temporary) {
$uploader->setDeleteFileAfterEpoch(
$key,
time() + phutil_units('24 hours in seconds'));
$expires_at = time() + phutil_units('24 hours in seconds');
$file->setDeleteAfterEpoch($expires_at);
}
$uploader->addFile($file);
}
$files = $uploader->uploadFiles();