mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-12-06 15:42:43 +00:00
scripts: csv.py: Reverted define filtering to before expr eval
It's just too unintuitive to filter after exprs. Note this is consistent with how exprs/mods are evaluated. Exprs/mods can't reference other exprs/mods because csv.py is only single-pass, so allowing defines to reference exprs/mods is surprising. And the solution to needing these sort of post-expr/mod references is the same for defines: You can always chain multiple csv.py calls. The reason defines were change to evaluate after expr eval was because this seemed inconsistent with other result scripts, but this is not actually the case. Other result scripts simply don't have exprs/mods, so filtering in fold is the same as filtering during collection. Note that even in fold, filtering is done _before_ the actual fold/sum operation. --- Also fixed a recursive-define regression when folding. Counter- intuitively, we _don't_ want to recursively apply define filters. If we do the results will just end up too confusing to be useful.
This commit is contained in:
@@ -603,7 +603,7 @@ def fold(Result, results, *,
|
||||
Result._children: fold(
|
||||
Result, getattr(r, Result._children),
|
||||
by=by,
|
||||
defines=defines,
|
||||
# only filter defines at the top level!
|
||||
sort=sort,
|
||||
depth=depth-1)})
|
||||
for r in folded]
|
||||
|
||||
Reference in New Issue
Block a user