‹ BackHN Continuity

Thread

Show HN: Treepeat – Code similarity detection using Tree-sitter

73 points · 8 comments · 91awebsi

  1. bradleyy · · focus · HN ↗
    Thanks for posting this; I'm very interested in finding similar chunks of code in an AST-ish fashion, and using tree-sitter seems perfect.
    1. 91awebsi · · focus · HN ↗
      I keep meaning to write a post for how this has worked for my projects, I think its been helpful.

      For active projects I setup a weekly-ish 'code audit' agent: it runs treepeat to find opportunities to refactor and bumps up enforced coverage numbers. Over time for some projects I lower the '--similarity' threshold to more broadly find similar structured code (potentially more ambitious refactoring)

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.