summaryrefslogtreecommitdiff
path: root/src/templatespec.rs
AgeCommit message (Collapse)AuthorFilesLines
2022-05-06refactor: replace SubplotError::YamlError with more specific oneLars Wirzenius1-1/+1
SubplotError::YamlError is quite generic. We only parse YAML as part of document metadata, so replace the error with a more specific one. Sponsored-by: author
2022-05-06refactor! split SubplotError::IoError into more specific errorsLars Wirzenius1-1/+2
Replace SubplotError::IoError with ::Spawn, ::WriteToChild, ::WaitForChild, ::ReadFile, ::CreateFile, ::Writefile. IoError was a catchall error and as such, so generic that it didn't help the user to figure out what actually is wrong. For example, there was no indication what operation was attempted or on what file. The new error variants are specific. Sponsored-by: author
2022-05-05refactor: drop the subplot::Result type aliasLars Wirzenius1-3/+2
Replace subplot::Result<T> with Result<T, SubplotError>. I find this now to be clearer, as I don't need to remind myself which Result is being used where. This should not be a breaking change. Sponsored-by: author
2021-09-07chore: Unwind global template nameDaniel Silverstone1-1/+1
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04chore: Fix unnecessary borrow lintsDaniel Silverstone1-1/+1
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-20chore: Fix a bunch of clippy lintsDaniel Silverstone1-8/+2
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-01-09chore: Simplify to use resource::read_as_stringDaniel Silverstone1-4/+1
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-01-09resource: Step one of VFS support, redirect all opensDaniel Silverstone1-2/+2
This redirects all file reading via the new resource module which will be used to control where files come from. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-09-04feat(codegen): allow templates to list helper filesLars Wirzenius1-1/+15
A template's YAML file can now list any additional files, called helpers. An empty list is OK, as is not having the 'helper' key in the YAML file. The helpers are loaded as Tera templates so they can be included in the main template. This will allow us to split out un-templated code out of the main template. The helpers can then be linted and unit tested separately. This commit only adds the mechanism, and fixes up the YAML files. Later commits will actually split the main Python template into helpers, and add unit tests. refactor: use .join
2020-05-01Fix: nits found by cargo clippyLars Wirzenius1-1/+0
2020-04-22Change: get Python template from templates/python/template.{yaml.py}Lars Wirzenius1-0/+88
All the language specific details are now in template.yaml, including the command for how to run the generated test program.