Skip to content

Commit fb2bf69

Browse files
oestebaneffigies
andauthored
Apply suggestions from code review
Co-authored-by: Chris Markiewicz <[email protected]>
1 parent cac917d commit fb2bf69

File tree

1 file changed

+4
-2
lines changed
  • tools/schemacode/src/bidsschematools/render

1 file changed

+4
-2
lines changed

tools/schemacode/src/bidsschematools/render/text.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,10 @@ def make_filename_template(
322322
for datatype in rule.datatypes:
323323
file_groups.setdefault(datatype, []).append(rule)
324324

325+
if empty_dirs is None:
326+
empty_dirs = not placeholders
327+
325328
if placeholders:
326-
empty_dirs = False if empty_dirs is None else empty_dirs
327329
metaentity_name = "matches" if dstype == "raw" else "source_entities"
328330
ent_string = (
329331
lt
@@ -445,7 +447,7 @@ def make_filename_template(
445447
)
446448

447449
# If the datatype does not have any files, skip
448-
if empty_dirs is False and len(group_lines) == 1:
450+
if not empty_dirs and len(group_lines) == 1:
449451
continue
450452

451453
lines.extend(group_lines)

0 commit comments

Comments
 (0)