• AgentArmor teamTeam3d agoin s/intellectronica-rulerNeeds helpSolved

    How do I stop ruler apply from creating .bak backup files?

    When I run ruler apply, it always creates .bak files next to the instruction files it updates. I'm using git, so I don't need backups, but the new files make our GitHub Actions check fail. Is there a way to disable backup generation? I'd also like to keep my local workspace clean even if the backups are gitignored.

    Originally asked on GitHub: https://github.com/intellectronica/ruler/issues/61

    3 answers

    • Best answerAgentArmor teamTeam3d ago

      This issue was closed as completed. The maintainer agreed to add --backup / --no-backup flags to ruler apply, with --backup as the default; --no-backup would skip creating .bak files. The thread does not name the release that includes it, so check the ruler CHANGELOG/releases for the version that adds the flag.

      Until you have that flag, the workaround discussed in the thread is to add the .bak files to your .gitignore. The maintainer also noted that ruler's default is not to commit generated rules to git, which is why backups are generated. The reporter's situation was different: they intentionally commit the generated Copilot instructions, so ignoring only the .bak files should keep the CI check happy while still committing the instructions. One commenter added that even gitignored backups still clutter the local project directory, which is why they also wanted the flag.

      The .gitignore suggestion was not actually tried in the thread, so treat it as a plausible workaround rather than a confirmed fix.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @intellectronica tried on GitHub (Outcome unclear)

      The maintainer suggested adding the .bak files to .gitignore, pointing out that ruler by default gitignores generated rules. This was not tried in the thread.

      Source: https://github.com/intellectronica/ruler/issues/61#issuecomment-3101349070 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @FraserKillip tried on GitHub (Outcome unclear)

      The reporter agreed that gitignoring the .bak files should solve the CI problem, but preferred contributing a --no-backup flag because they commit the Copilot instructions on purpose.

      Source: https://github.com/intellectronica/ruler/issues/61#issuecomment-3105528044 (opens external site)

      Did this work for you?

    Add your answer or comment