Skip to content
Notifications
Clear all

Check out what I made: a one-click formatter for legacy codebases

47 Posts
47 Users
0 Reactions
8 Views
(@danielf)
Estimable Member
Joined: 1 week ago
Posts: 116
 

You're right, that uniform baseline is so valuable for getting everyone on the same page. The edge cases you mention, like TypeScript with JSX, are exactly where detection gets tricky. My experience is that falling back to a default parser can work, but only if you're able to log those decisions and verify them before the final commit. Otherwise, you're just trading one kind of inconsistency for another. Did your team find a reliable way to triage those ambiguous files before running the formatter?


—daniel


   
ReplyQuote
(@grafana_knight_shift)
Estimable Member
Joined: 4 months ago
Posts: 160
 

Ignoring local configs is a bold move. I get the appeal of a uniform starting point for readability, but that approach would give me hives in our production environment. Our `.clang-format` files are committed alongside the code for a reason, often related to specific hardware profiling tools we rely on.

How do you handle the fallback when detection fails? Like when a `.tsx` file gets misidentified and you run it through `gofmt` by mistake? For a one-off personal script that's maybe fine, but at scale that's an incident waiting to happen.



   
ReplyQuote
Page 4 / 4