@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Render warning instead of error for postponed lint

Test Plan: {F27152, size=full}

Reviewers: epriestley

Reviewed By: epriestley

CC: ypisetsky, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4195

vrana 79b241b3 94d42b63

+33 -23
+33 -23
src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
··· 218 218 } 219 219 220 220 public function renderWarningBoxForRevisionAccept() { 221 - $diff = $this->getDiff(); 222 - $lint_warning = null; 223 - if ($diff->getLintStatus() >= DifferentialLintStatus::LINT_WARN) { 224 - $titles = 225 - array( 226 - DifferentialLintStatus::LINT_WARN => 'Lint Warning', 227 - DifferentialLintStatus::LINT_FAIL => 'Lint Failure', 228 - DifferentialLintStatus::LINT_SKIP => 'Lint Skipped' 229 - ); 230 - if ($diff->getLintStatus() == DifferentialLintStatus::LINT_SKIP) { 231 - $content = 232 - "<p>This diff was created without running lint. Make sure you are ". 233 - "OK with that before you accept this diff.</p>"; 234 - } else { 235 - $content = 236 - "<p>This diff has Lint Problems. Make sure you are OK with them ". 237 - "before you accept this diff.</p>"; 238 - } 239 - $lint_warning = id(new AphrontErrorView()) 240 - ->setSeverity(AphrontErrorView::SEVERITY_ERROR) 241 - ->appendChild($content) 242 - ->setTitle(idx($titles, $diff->getLintStatus(), 'Warning')); 221 + $status = $this->getDiff()->getLintStatus(); 222 + if ($status < DifferentialLintStatus::LINT_WARN) { 223 + return null; 243 224 } 244 - return $lint_warning; 225 + 226 + $severity = AphrontErrorView::SEVERITY_ERROR; 227 + $titles = array( 228 + DifferentialLintStatus::LINT_WARN => 'Lint Warning', 229 + DifferentialLintStatus::LINT_FAIL => 'Lint Failure', 230 + DifferentialLintStatus::LINT_SKIP => 'Lint Skipped', 231 + DifferentialLintStatus::LINT_POSTPONED => 'Lint Postponed', 232 + ); 233 + 234 + if ($status == DifferentialLintStatus::LINT_SKIP) { 235 + $content = 236 + "<p>This diff was created without running lint. Make sure you are ". 237 + "OK with that before you accept this diff.</p>"; 238 + 239 + } else if ($status == DifferentialLintStatus::LINT_POSTPONED) { 240 + $severity = AphrontErrorView::SEVERITY_WARNING; 241 + $content = 242 + "<p>Postponed linters didn't finish yet. Make sure you are OK with ". 243 + "that before you accept this diff.</p>"; 244 + 245 + } else { 246 + $content = 247 + "<p>This diff has Lint Problems. Make sure you are OK with them ". 248 + "before you accept this diff.</p>"; 249 + } 250 + 251 + return id(new AphrontErrorView()) 252 + ->setSeverity($severity) 253 + ->appendChild($content) 254 + ->setTitle(idx($titles, $status, 'Warning')); 245 255 } 246 256 247 257 }