Allow passing multiple file names to graph, to get multiple lines in HTML #206
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses a TODO comment in graph.py: "Add multiple lines for multiple files". It turns
path
from a single argument into a variadic argument and plots lines for each file passed (and for those files in any directories passed too). If--aggregate
is used, it aggregates the data for any directories passed, but also displays individual lines for any files passed (we can't easily aggregate those, as the aggregated data is recorded on build).To achieve this, an incompatible change is needed:
metrics
, which previously was a variadic argument, now is a required option instead (which means it's always necessary to pass-m metric_name
). To pass two metrics, users need to provide them as comma-separated values (same as indiff
). Another way to go about this would be to add an explicitz_axis
option, so when users want a metric in Z axis they provide it as this option.Listing multiple file names in the graphs title simply doesn't work after a handful of files. So this PR avoids printing file names altogether when more than one path is supplied.
I like the comma-separated option because it matches
diff
and also because I'd like to introduce a new command using the same solution (it takes arbitrary number of paths and metrics, so it'll need a way to pass multiple metrics as non-variadic argument or option).