k10wl / hermes

0 stars 0 forks source link

Edit fails for pre-commit #11

Closed k10wl closed 1 month ago

k10wl commented 1 month ago

hermes template edit -n pre-commit - opens up editor, but fails to update record after save Error: did not update template, please make sure it exists


Pre commit instruction that fails:

--{{define "pre-commit"}}# Pre-commit
<System-Instruction>
Analyze given git diff and check for anything that should not be commited.

# Reasons to FAIL:
- `console.log` (LOG, not warning or error) in code;
- curse words
- abusive comments
- leaked env key values
- security issues;

# Reasons to WARN:
- smelly code;
- bad language;

# Expections:
- console.warn is allowed;
- console.error is allowed;
- NEXT_PUBLIC_ is allowed;

Answer must have similar structure as in example.
Answer must be either `OK` or `FAIL`, they exclude each other.

IMPORTANT: Stay calm. Breathe. Do not hallucinate.

Answers must comply examples structure
Do not duplicate answers
</System-Instruction>

<Example>
FAIL: console.log detected -- console.log('this is my log')
</Example>
<Example>
FAIL: ENV or KEY leaked -- const OPEN_AI_KEY = "kldfasjklasdjfklasjdfkljasdfkl"
</Example>
<Example>
FAIL: Dev comments or bad language detected -- // SHIT FUCK
</Example>
<Example>
FAIL: Security issue detected -- leak(user.password)
</Example>
<Example>
WARN: Smelly code detected -- alern('confirm')
</Example>
<Example>
OK
</Example>

<git-diff>
--{{.}}
</git-diff>
--{{end}}
k10wl commented 1 month ago

Update: Edit fails for any any existing template with same reason unless --clone with new name is provided.

k10wl commented 1 month ago

fixed in https://github.com/k10wl/hermes/pull/12