Skip to content

[FR] create module fct/utils without a trailing underscore: mod_FixHumanity_fct_.R #1219

@kwbyron-lilly

Description

@kwbyron-lilly

Is your feature request related to a problem? Please describe.
Most modules do not require multiple fct or utils, so often I am not adding additional descriptors to the file name:
add_module("FixHumanity", fct = "")
but this generates a file with a trailing underscore: mod_FixHumanity_fct_.R

I would like to be able to just create the file: mod_FixHumanity_fct.R

Describe the solution you'd like
test for empty string passed to fct or util and drop trailing underscore.

Describe alternatives you've considered
I tried passing TRUE to the variables, but the name validation returns them as a string, bypassing isTRUE() in ifelse statements. Using NA would be unintuitive.

Additional context
how the elements are pasted is generating the extra underscore:
https://github.com/ThinkR-open/golem/blob/ba7f50030369ac62967fe6c38204a469de051dc0/R/add_r_files.R#L104C2-L112C2

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions