Repository navigation
Fix list of paths files not relative to their location and nested sub_configs in add_argument - #1023
Conversation
…_configs in add_argument
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1023 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 9926 9950 +24
=========================================
+ Hits 9926 9950 +24 ☔ View full report in Codecov by Harness. |
[Medium impact] The changes affect path-list and nested-class configuration workflows in the library. The PR appears safe to merge, with two non-blocking edge cases in optional path lists. FindingsSummaryThis PR fixes relative paths in plain-text path lists and enables sub-config files for nested classes added with
Reviews (1) · Last reviewed commit: "Fix list of paths files not relative to ..." · Reviewed by Greptile |
|



What does this PR do?
Fixes plain text files with a list of paths, i.e.
list[<path_type>]withsub_configs=True. When the file was not in the working directory, parsing failed with an unclearExpected type ... Got valueerror that showed the whole file content. A missing path in the list gave the same error. A file listing a single existing file was replaced by the lines of that file. Now relative paths in the list are resolved with respect to the location of the list file, consistent with relative paths inside config files.Errors for an item of a list now say where it came from, in the same way as errors for values in config files. For a plain text list file, the error includes the line of the path, e.g.
Source: list of paths file subdir/files.lst:2followed by that line. For a list given as a yaml sub-config file, it includes the line of the item.Optional[list[<path_type>]]now also accepts a file with a list of paths, both inadd_argumentand in signatures.Also fixes
add_argumentwithsub_configs=Trueand a class type, which did not accept sub-config files for the parameters of nested classes and failed withUnexpected import path format.Before submitting