claude-code
claude-code copied to clipboard
How to avoid 'no newline at end of file' efficiently?
Our code style prohibits no new line at end of file, OTOH, prohibits no leading \n at the end of text files.
I have tried several prompts in CLAUDE.md but it appears to be ignored. When I remind that the prompt has been ignored, Claude Code tries to echo >> ... for every changed file, which is inefficient.
Are there any chance to ensure \n at the end when writing files on tools' end?
didn't find any similar issue but the workflow gives me no pointer to it :/
Possible duplicate of https://github.com/anthropics/claude-code/issues/2707 which has more discussion and some alleged workarounds.