Menu

Post image 1
Post image 2
1 / 2
0

grep Said 1,202. The Real Answer Was 10. — Introducing colref

DEV Community·Kazu·20 days ago
#D4raV6In
#go#django#rails#html#colref#field
Reading 0:00
15s threshold

When deleting a database column, I ran grep "\.html\b" across a Django codebase to check for references. It returned 1,202 hits. The column had 10 actual attribute-access references. The other 1,192 were template paths, HTML file extensions in strings, comments, and import fragments — none of which mattered. Filtering 1,200+ grep hits by hand every time you drop a column isn't a workflow, it's a chore I kept putting off. So I built colref — a CLI tool that uses AST parsing to find only the attribute-access references to a model field, filtering out everything grep can't. The Haystack: One Field Name, Ten Thousand Strings grep treats your codebase as a flat stream of characters. .html matches everything containing those five characters — in code, in strings, in comments, in template paths. grep -rn " \.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More