Skip to content

Commit 29d3910

Browse files
committed
feat: initial release of tmpltool v0.1.0
A fast and simple command-line template rendering tool using MiniJinja templates with environment variables. Features: - Environment variable access with get_env() and filter_env() - Hash & crypto functions (MD5, SHA1, SHA256, SHA512, UUID, random strings) - Filesystem operations (read, exists, list, glob, size, modified) - Data parsing for JSON, YAML, and TOML - Validation functions (email, URL, IP, UUID, regex) - Template include functionality with security controls - Trust mode for advanced filesystem access - Full Jinja2 syntax support - Comprehensive test suite (267 tests)
0 parents  commit 29d3910

113 files changed

Lines changed: 22960 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.commitlintrc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"],
3+
"rules": {
4+
"type-enum": [
5+
2,
6+
"always",
7+
[
8+
"feat",
9+
"fix",
10+
"docs",
11+
"style",
12+
"refactor",
13+
"perf",
14+
"test",
15+
"build",
16+
"ci",
17+
"chore",
18+
"revert"
19+
]
20+
],
21+
"type-case": [2, "always", "lower-case"],
22+
"type-empty": [2, "never"],
23+
"subject-empty": [2, "never"],
24+
"subject-case": [0],
25+
"header-max-length": [2, "always", 100]
26+
}
27+
}

.dockerignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Git
2+
.git
3+
.gitignore
4+
.gitattributes
5+
6+
# CI/CD
7+
.github
8+
9+
# Build artifacts
10+
target/
11+
*.tar.gz
12+
*.zip
13+
14+
# IDE
15+
.vscode/
16+
.idea/
17+
*.swp
18+
*.swo
19+
*.swn
20+
.DS_Store
21+
22+
# Documentation
23+
README.md
24+
CHANGELOG.md
25+
CONTRIBUTING.md
26+
LICENSE
27+
*.md
28+
29+
# Release config
30+
.releaserc.json
31+
32+
# Editor config
33+
.editorconfig
34+
35+
# Note: Cargo.lock is NOT ignored for binary applications
36+
# It's required for reproducible Docker builds
37+
38+
# Makefile
39+
Makefile.toml
40+
41+
# Node.js (not needed in Docker)
42+
node_modules/
43+
package.json
44+
package-lock.json
45+
.commitlintrc.json
46+
.husky/

.editorconfig

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# EditorConfig helps maintain consistent coding styles across different editors and IDEs
2+
# See https://editorconfig.org for more information
3+
4+
# Top-most EditorConfig file
5+
root = true
6+
7+
# Default settings for all files
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
# Rust source files
15+
[*.rs]
16+
indent_style = space
17+
indent_size = 4
18+
max_line_length = 100
19+
20+
# TOML files (Cargo.toml, Cargo.lock, etc.)
21+
[*.toml]
22+
indent_style = space
23+
indent_size = 2
24+
25+
# Markdown files
26+
[*.md]
27+
indent_style = space
28+
indent_size = 2
29+
trim_trailing_whitespace = false
30+
max_line_length = off
31+
32+
# YAML files
33+
[*.{yml,yaml}]
34+
indent_style = space
35+
indent_size = 2
36+
37+
# JSON files
38+
[*.json]
39+
indent_style = space
40+
indent_size = 2
41+
42+
# Shell scripts
43+
[*.sh]
44+
indent_style = space
45+
indent_size = 2
46+
end_of_line = lf
47+
48+
# Makefiles
49+
[Makefile]
50+
indent_style = tab
51+
indent_size = 4
52+
53+
# Git config
54+
[.gitconfig]
55+
indent_style = tab
56+
57+
# Ignore files
58+
[.gitignore]
59+
indent_style = space
60+
indent_size = 2
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug or unexpected behavior
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
15+
1. Create a template with '...'
16+
2. Run command '....'
17+
3. See error
18+
19+
## Expected Behavior
20+
21+
A clear and concise description of what you expected to happen.
22+
23+
## Actual Behavior
24+
25+
A clear and concise description of what actually happened.
26+
27+
## Minimal Reproducible Example
28+
29+
**Template** (`example.tmpl`):
30+
```
31+
# Paste your template here
32+
```
33+
34+
**Command:**
35+
```bash
36+
# Paste the exact command you ran
37+
tmpltool example.tmpl
38+
```
39+
40+
**Environment Variables (if applicable):**
41+
```bash
42+
# List any environment variables you set
43+
export VAR_NAME="value"
44+
```
45+
46+
**Output/Error:**
47+
```
48+
# Paste the actual output or error message
49+
```
50+
51+
## Environment
52+
53+
- **tmpltool version:** [e.g., 1.2.0] (run `tmpltool --version`)
54+
- **OS:** [e.g., Ubuntu 22.04, macOS 14.0, Windows 11]
55+
- **Installation method:** [e.g., GitHub releases, Docker, built from source]
56+
- **Docker version (if applicable):** [e.g., 24.0.5]
57+
58+
## Additional Context
59+
60+
Add any other context about the problem here. For example:
61+
- Does it work with `--trust` flag?
62+
- Does it happen only with specific file types?
63+
- Screenshots, if applicable
64+
- Related issues or discussions
65+
66+
## Possible Solution (Optional)
67+
68+
If you have an idea of how to fix this, please describe it here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Question or Discussion
4+
url: https://github.com/bordeux/tmpltool/discussions
5+
about: Ask questions or discuss ideas in GitHub Discussions
6+
- name: Tera Template Engine Docs
7+
url: https://keats.github.io/tera/docs/
8+
about: Official Tera template engine documentation
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Documentation Issue
3+
about: Report missing, unclear, or incorrect documentation
4+
title: '[DOCS] '
5+
labels: documentation
6+
assignees: ''
7+
---
8+
9+
## Documentation Issue
10+
11+
**What part of the documentation is affected?**
12+
- [ ] README.md
13+
- [ ] Function reference
14+
- [ ] Examples
15+
- [ ] Code comments
16+
- [ ] Contributing guide
17+
- [ ] Other: _____________
18+
19+
**Link or section:**
20+
Provide a link or describe which section of the documentation is affected.
21+
22+
## Problem
23+
24+
Describe what's missing, unclear, or incorrect in the documentation.
25+
26+
**Current documentation:**
27+
```
28+
# Quote or describe the current documentation
29+
```
30+
31+
**What's wrong with it:**
32+
- [ ] Missing information
33+
- [ ] Incorrect information
34+
- [ ] Unclear/confusing
35+
- [ ] Out of date
36+
- [ ] Broken link
37+
- [ ] Typo/grammar
38+
- [ ] Other: _____________
39+
40+
## Suggested Improvement
41+
42+
**What should be added/changed:**
43+
```
44+
# Describe or provide the corrected documentation
45+
```
46+
47+
**Why this is important:**
48+
Explain why this documentation improvement matters (e.g., helps new users, clarifies confusion, etc.)
49+
50+
## Additional Context
51+
52+
Add any other context, screenshots, or examples here.
53+
54+
## Willingness to Contribute
55+
56+
- [ ] I'm willing to submit a PR to fix this documentation
57+
- [ ] I'm just reporting the issue
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or enhancement
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
11+
A clear and concise description of the feature you'd like to see.
12+
13+
## Problem or Use Case
14+
15+
**Is your feature request related to a problem?**
16+
Describe the problem or limitation you're facing. For example:
17+
- "I'm always frustrated when..."
18+
- "It's difficult to..."
19+
- "I need to manually..."
20+
21+
**What are you trying to accomplish?**
22+
Describe your use case and why this feature would be valuable.
23+
24+
## Proposed Solution
25+
26+
Describe the solution you'd like. How should this feature work?
27+
28+
**Example usage:**
29+
```bash
30+
# Show how you'd like to use this feature
31+
tmpltool --new-flag template.tmpl
32+
```
33+
34+
**Example template:**
35+
```
36+
{# Show template syntax if applicable #}
37+
{{ new_function(arg="value") }}
38+
```
39+
40+
**Expected output:**
41+
```
42+
# What output do you expect?
43+
```
44+
45+
## Alternatives Considered
46+
47+
Describe any alternative solutions or features you've considered.
48+
49+
## Additional Context
50+
51+
Add any other context, screenshots, or examples about the feature request here.
52+
53+
**Related to:**
54+
- [ ] New custom function
55+
- [ ] New command-line option
56+
- [ ] Improvement to existing feature
57+
- [ ] Documentation enhancement
58+
- [ ] Performance improvement
59+
- [ ] Other (please describe)
60+
61+
## Priority
62+
63+
How important is this feature to you?
64+
- [ ] Critical - Blocking my workflow
65+
- [ ] High - Would significantly improve my workflow
66+
- [ ] Medium - Nice to have
67+
- [ ] Low - Small improvement
68+
69+
## Willingness to Contribute
70+
71+
- [ ] I'm willing to submit a PR for this feature
72+
- [ ] I can help with testing
73+
- [ ] I can help with documentation
74+
- [ ] I'm just suggesting the idea

0 commit comments

Comments
 (0)