Skip to content

Add explicit command line option to limit which files are parsed - #4735

Merged
pekkaklarck merged 6 commits into
robotframework:masterfrom
JonathanArns:files-cli-option
May 22, 2023
Merged

pekkaklarck merged 6 commits into
robotframework:masterfrom
JonathanArns:files-cli-option

Conversation

@JonathanArns

Copy link
Copy Markdown
Contributor

This PR implements the --files option as discussed in this issue with one difference:
The --files option 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 --extension when --files is set did not seem like a nice change, because --extension not 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 --extension eventually gets deprecated.

closes #4687

JonathanArns and others added 5 commits April 12, 2023 14:59
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`.
@pekkaklarck

Copy link
Copy Markdown
Member

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?

@JonathanArns

Copy link
Copy Markdown
Contributor Author

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 pekkaklarck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
::

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@JonathanArns

Copy link
Copy Markdown
Contributor Author

@pekkaklarck Thanks for the review! @cetceeve and I should have time to fix everything up this week :)

@pekkaklarck

Copy link
Copy Markdown
Member

Sounds great! There have been reports that --suite not working properly with the new Name setting causes problem. Probably need to remove the include_suites functionality, but I want to get this merged before that to avoid more conflicts.

@pekkaklarck

Copy link
Copy Markdown
Member

I resolved conflicts using the web interface. Assuming tests pass, I'll merge this later today.

@pekkaklarck
pekkaklarck merged commit 50d6db6 into robotframework:master May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add explicit command line option to limit which files are parsed

3 participants