regolith icon indicating copy to clipboard operation
regolith copied to clipboard

Add `regolith run [profile] --selcted-filters <pattern>` (we need better name for the flag)

Open Nusiq opened this issue 3 years ago • 3 comments

The --selected-filters flag would let you provide a pattern used for selecting which filters should be executed from the profile.

Examples:

  • 1 - first filter
  • ..3 - first 3 filters
  • 2..4 - filters 2,3,4
  • 2,4,1 - filters 2,4,1 (in that order (?))

Nusiq avatar Aug 29 '22 07:08 Nusiq

Looks like this one adds quite a bit of complexity. This would mostly be used for debugging I presume?

SirLich avatar Aug 29 '22 08:08 SirLich

Yes. The most important feature is to implement ..n (run first n filters). This enables tracking what happens in regolith internally while it runs the filters. I think coma separated values are also important. SOmeone could have some kind of beautify filter which would format outputed files at the end. In this case someone might want to debug using command with ..<n>,<las_index> to have the code nicely formatted.

Nusiq avatar Sep 04 '22 11:09 Nusiq

Debugging which filter breaks something can be done with either commenting out a portion of used filters or adding a "disabled": true to the filter in a profile. In case someone has some kind of beautify filter or minify filter, they can have a separate profile for development without those filters.

A possible solution could be to have a way to pass some data to when expression maybe like this:

regolith run --data "disableMinify=true,disableBeauitfy=true"

And then you would add a when field to the filter like this

{
  "when": "!disableMinify"
}

I think this feature is not worth the effort.

stirante avatar Apr 27 '23 11:04 stirante