Help analyzers with path filtering |
|
Issue descriptionCurrently if a single file matches an analyzer's path_filters then the analyzer will be run on all files in the input. While it is possible for the analyzer to do its own filtering, this duplicates logic and is a potential source of confusion. A couple of ideas for improvement: - Add a new e.g. $TRICIUM_FILTERED_FILES value to the function's env. This seems relatively straightforward to implement by extending tricium.Cmd. - Push a new per-worker file with this kind of metadata. Related: crbug.com/837024#c2
,
Jul 12
I'm fine with always isolating the whole thing and expect the analyzer to process the relevant subset. I think it's less work overall than trying to isolate for every analyzer.
,
Jul 12
Another approach would be to include in the input a map of metadata for every function keyed on function name and then pass the function name in the env.
,
Jul 14
The following revision refers to this bug: https://chromium.googlesource.com/infra/infra/+/17a5a6a7d8cff1912c0163a781e77dcdeaeb36e7 commit 17a5a6a7d8cff1912c0163a781e77dcdeaeb36e7 Author: Quinten Yearsley <qyearsley@chromium.org> Date: Sat Jul 14 01:35:29 2018 [tricium] Extract helper function to filter files and use it in Pylint analyzer This isn't quite as ideal as Tricium providing the filtered files for the analyzer, but at least it makes it so it's less code duplicated between different analyzers, since most analyzers will want to do some filtering of the input file list. Bug: 863600 , 863106 Change-Id: Iba82eb176535c6aa7e5465b9955f012bf2fdeee0 Reviewed-on: https://chromium-review.googlesource.com/1137212 Reviewed-by: Lann Martin <lannm@chromium.org> Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org> Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org> [modify] https://crrev.com/17a5a6a7d8cff1912c0163a781e77dcdeaeb36e7/go/src/infra/tricium/api/v1/data_helpers.go [modify] https://crrev.com/17a5a6a7d8cff1912c0163a781e77dcdeaeb36e7/go/src/infra/tricium/functions/pylint/pylint_parser.go [modify] https://crrev.com/17a5a6a7d8cff1912c0163a781e77dcdeaeb36e7/go/src/infra/tricium/api/v1/data_helpers_test.go [modify] https://crrev.com/17a5a6a7d8cff1912c0163a781e77dcdeaeb36e7/go/src/infra/tricium/functions/shellcheck/main.go
,
Aug 20
Possibly related to bug 873202 (organize common helper code for analyzers). |
|
►
Sign in to add a comment |
|
Comment 1 by qyearsley@google.com
, Jul 12Status: Available (was: Untriaged)