1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-24 21:48:20 +01:00
phorge-arcanist/src/lint/linter
epriestley f4aadb9604 Split large path lists into blocks when linting
Summary:
Fixes T5097. When linting a large list of paths (e.g., with `--everything`), do this internally:

  $chunks = array_chunk($paths, 32);
  foreach ($chunks as $chunk) {
    $this->lintChunk($chunk);
  }

This keeps the advantages of parallelism and artifact sharing for future-based linters, without having memory usage grow in an unbounded way.

These callbacks changed:

  - `willLintPath()`: Useless, no meaningful implementations. Internalized the required side effect and broke the hook.
  - `didRunLinters()`: Now useless, with no meaningful implementations. Broke the hook.
  - `didLintPaths()`: New hook which executes opposite `willLintPaths()`.
  - `lintPath()`: Linters no longer need to implement this method.

XHPAST now has an explicit way to release shared futures.

These minor changes also happened:

  - Formalized the "linter ID", which is a semi-durable identifier for the cache.
  - Removed linter -> exception explicit mapping, which was unused. We now just collect exceptions.
  - We do the `canRun()` checks first (and separately) now.
  - Share more service call profiling code.
  - Fix an issue where the test harness would use the path on disk, even if configuration set a different path.

Test Plan:
  - Ran `arc lint --everything` in `arcanist/`.
    - With no chunking, saw **unstable** memory usage with a peak at 941 MB.
    - With chunk size 32, saw **stable** memory usage with a peak at 269 MB.
    - With chunk size 8, saw **stable** memory usage with a peak at 180 MB.
  - Ran with `--trace` and saw profiling information.
  - Created this diff.

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T5097

Differential Revision: https://secure.phabricator.com/D12501
2015-04-22 05:15:57 -07:00
..
__tests__ Split large path lists into blocks when linting 2015-04-22 05:15:57 -07:00
exception Move linter exception classes to src/lint/linter/exception 2015-01-12 06:46:23 +11:00
xhpast Explicitly enumerate PHP magic methods 2014-09-23 08:02:19 +10:00
ArcanistBaseXHPASTLinter.php Split large path lists into blocks when linting 2015-04-22 05:15:57 -07:00
ArcanistChmodLinter.php Add unit tests for ArcanistChmodLinter 2015-01-15 06:58:11 +11:00
ArcanistClosureLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistCoffeeLintLinter.php Use the raw formatter for coffeelint 2015-01-12 07:23:42 +11:00
ArcanistCommitLinter.php Disable the customization of linter severities for ArcanistCommitLinter 2015-01-12 07:24:53 +11:00
ArcanistConduitLinter.php Minor tidying of ArcanistConduitLinter 2015-01-13 06:36:19 +11:00
ArcanistCppcheckLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistCpplintLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistCSharpLinter.php Split large path lists into blocks when linting 2015-04-22 05:15:57 -07:00
ArcanistCSSLintLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistExternalLinter.php Remove deprecated support for specifying flags as a string 2015-02-10 06:55:49 +11:00
ArcanistFilenameLinter.php Fix visibility of various ArcanistLinter methods 2015-01-07 07:36:07 +11:00
ArcanistFlake8Linter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistFutureLinter.php Split large path lists into blocks when linting 2015-04-22 05:15:57 -07:00
ArcanistGeneratedLinter.php Remove severity options from some linters. 2014-05-11 19:28:27 -07:00
ArcanistGoLintLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistHLintLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistJscsLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistJSHintLinter.php Don't pass data to jshint via STDIN 2015-04-07 07:26:10 +10:00
ArcanistJSONLinter.php Minor improvements to ArcanistJSONLinter 2015-01-12 06:40:40 +11:00
ArcanistJSONLintLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistLesscLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistLinter.php Split large path lists into blocks when linting 2015-04-22 05:15:57 -07:00
ArcanistMergeConflictLinter.php Minor reordering of functions 2014-09-22 18:42:41 +10:00
ArcanistNoLintLinter.php Remove severity options from some linters. 2014-05-11 19:28:27 -07:00
ArcanistPEP8Linter.php losen pep8 version check 2015-02-10 06:17:25 -08:00
ArcanistPhpcsLinter.php Modernize ArcanistPhpcsLinter 2015-02-03 06:43:55 +11:00
ArcanistPhpLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistPhutilLibraryLinter.php Allow ArcanistPhutilLibraryLinter to run with an out-of-date XHPAST binary 2015-02-03 08:01:11 +11:00
ArcanistPhutilXHPASTLinter.php Add some missing function parameter typehints 2014-09-09 08:27:09 +10:00
ArcanistPuppetLintLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistPyFlakesLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistPyLintLinter.php Create a custom exception class for missing linter dependencies 2015-01-06 22:51:17 +11:00
ArcanistRuboCopLinter.php Added RuboCop linter 2015-04-06 09:11:15 -07:00
ArcanistRubyLinter.php Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors 2015-01-12 07:21:33 +11:00
ArcanistScriptAndRegexLinter.php Use new FutureIterator instead of Futures 2014-12-30 23:16:25 +11:00
ArcanistSpellingLinter.php Move ArcanistSpellingDefaultData into a configurable JSON file 2014-07-04 08:18:33 +10:00
ArcanistTextLinter.php Move LINT_NO_COMMIT from ArcanistTextLinter to a new linter 2015-01-04 16:20:32 +11:00
ArcanistXHPASTLinter.php Add a linter rule for lowercase function names 2015-04-22 22:06:49 +10:00
ArcanistXMLLinter.php Minor tidying of the ArcanistXMLLinter class 2015-01-07 23:55:08 +11:00
reporter.js Don't use error context from JSHint in linter messages 2014-06-23 10:33:01 +10:00