view makeitso.txt @ 201:65684aae6bfe

make unittest template smarter
author Jeff Hammel <k0scist@gmail.com>
date Wed, 09 Jul 2014 15:48:41 -0700
parents 8f5bfd2e5a35
children
line wrap: on
line source

Make it so!
===========

*A new file templating system*

Requirements:

 - ability to specify delimeters (both for file interpolation and
   filename interpolation);  normally, i'd want '${' + '}', but this
   works poor with, say, bash scripts, and not having this makes it
   difficult to write templates that make other templates

 - ability to find the variables used in templates;  I find this
   absolutely critical.  In PasteScript, this isn't there (unless you
   use cheetah) and it is problematic if you want to deal with
   templates programmatically.  If you do allow things, like
   single-file templates, then this becomes mandatory.
   This is to say, amongst other things, there should be a
   command-line option that will list the template variables.

 - ability to make existing directory structures or files into templates

 - ability to interpolate single files (or strings), especially via an API

 - ability to use defaults (--use-defaults) when they are specified

 - ability to save variables used in a run into a file:
    makeitso --save-variables=myvars.txt mytemplate)

 - ability to have executing script files (for packaged tests or via a shebang)

 - a dotfile for metadata (e.g. ~/.makeitso)

 - hooks for things to do after creation (licensing, uploading
   somewhere, creating a repository, etc)

 - not having to name template files 'foo_tmpl';  it is better not to
   munge the file extension at all and have other mechanisms for
   denoting files to be interpolated

 - single file usability

Nice-to-haves:

 - ability to use python in interpolation [HARD?]

 - backwards compatability with pastescript templates

 - ability to inherit from templates [HARD]

 - ability to munge files (e.g. combining setup.py from several
   packages) [HARD]

 - a web interface (or a few)

 - ability to push changes from a downstream instance to a template [HARD]