Repository navigation
Add explicit command line option to limit which files are parsed - #4735
Conversation
The option takes one or multiple simple glob-like patterns and then filters out any data file before parsing that does not have a filename which matches one or more of the patterns.
`--files` no longer overrules `--extension` instead it acts as a filter for files matched by `--extension`.
|
Unfortunately I don't have time to review this until the custom parser functionality is done (#1283) and RF 6.1 beta 1 is released. I try to get both of them done this week, but due to some other errands I may not have enough time. Another unfortunate thing is that the parser changes affect the same parts of the code as these changes and are very likely to cause conflicts. There won't be big structural changes, though, so applying your changes on top of them shouldn't be too big a task. Do you have some timeline with your school project? |
|
Thank you for the info! And don't worry about it too much, we do indeed have a timeline for the assignment (deadline on the 24th or April), but while getting the changes merged before the deadline helps a lot with passing, it is not completely mandatory, because we all know that everyone has stuff to do :) |
pekkaklarck
left a comment
There was a problem hiding this comment.
Looks really good! Few things to do before this can be merged:
- Small update to documentation. Especially a note about this being new in RF 6.1.
- Fix conflicts due to changes when the new external parsing API was introduced. I believe conflicts are mostly due to added typing.
- Related to above, typing may need to be added to the new code as well.
Sorry for somewhat late review that also caused the aforementioned conflicts. If you @JonathanArns don't have time or interest to fix the above issues, I can do that myself as well.
| If the :option:`--files (-f)` option matches files with a non-default extension, | ||
| the :option:`--extension (-F)` option must be added in order for those files | ||
| to also be parsed. | ||
| :: |
There was a problem hiding this comment.
Explaining --extension and --files in the same section is a good idea. Documentation of --files should get its own paragraph, though. Possibly there could also be separate subsections.
Another thing that's needed is a note about --files being new in RF 6.1. There can either be an explicit, .. note or the paragraph explaining --files can start with something like "Starting from Robot Framework 6.1 ...". There ought to be examples of both styles here.
|
@pekkaklarck Thanks for the review! @cetceeve and I should have time to fix everything up this week :) |
|
Sounds great! There have been reports that |
|
I resolved conflicts using the web interface. Assuming tests pass, I'll merge this later today. |
This PR implements the
--filesoption as discussed in this issue with one difference:The
--filesoption does not fully override--extension, but instead only acts as an additional filter, after files have been filtered by extension already. We implemented it this way, since fully overriding--extensionwhen--filesis set did not seem like a nice change, because--extensionnot only influences the selection of files, but also the selection of parsers, and possibly other things. It seems more reasonable to us to make these additional changes, once and if--extensioneventually gets deprecated.closes #4687