src-d/enry

Add IsGenerated function to the API

bzz opened this issue · 1 comments

bzz commented

Linguist is capable of detecting if a file is generated one using a set of filename/content.

We should include this in Enry and make use of it in CLI for filtering.

This may include the work of parsing .rb file to extract the heuristics and updating the code generator.

It may be worth to explore an opportunity of a patch submission to upstream, reworking this detection logic from a custom Ruby code in generated.rb to a generated.yml templated, similar to what @smola did with heuristics.yml before (see #189 ).

But to be honest, after initial glance at all the Ruby code for those heuristics - it may be easier to just transliterate them to Go once as it has ~ 40 methods, with overall ~12 small, well-localized changes for that file per-year.

bzz commented

Implemented in go-enry/go-enry#22