At main commit 014fc18, Perch treats unrendered ERB migration templates whose filename ends in .rb as ordinary Ruby source. This is distinct from #137: parser recovery now keeps the surrounding methods, but these template files are still offered as scan candidates before ERB substitution.
Public reproduction: alexreisner/geocoder at commit 1ff64c47b6fc21d9c5ce30a6549d9eaa67c81a9e, paths:
lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
lib/generators/geocoder/maxmind/templates/migration/geolite_country.rb
Both begin with a class declaration containing ActiveRecord::Migration<%= migration_version %>. With the current createSourceAnalyzer().analyzeSource(source, 'ruby'), each returns parser_status: parsed, two method declarations (up and down), and syntax diagnostics at the ERB marker. sourceFile({type: 'blob', path}) returns true for both. Running analyzeFiles over just these two tracked blobs yields parsed: 2, parsed_with_errors: 2, four method scan candidates, and zero parse failures.
Expected: identify unrendered ERB content in a .rb template as a template rather than executable Ruby source. It should not contribute direct method questions or call-graph nodes until rendered, and the ERB marker should not be reported as a Ruby syntax failure. Keep ordinary .rb source with recoverable syntax errors eligible under #137.
The earlier scanner classified these two files as parse failures, which marked an otherwise usable whole-repository graph partial. The parser-recovery change fixes that completeness symptom, but the template classification remains.
At
maincommit014fc18, Perch treats unrendered ERB migration templates whose filename ends in.rbas ordinary Ruby source. This is distinct from #137: parser recovery now keeps the surrounding methods, but these template files are still offered as scan candidates before ERB substitution.Public reproduction:
alexreisner/geocoderat commit1ff64c47b6fc21d9c5ce30a6549d9eaa67c81a9e, paths:lib/generators/geocoder/maxmind/templates/migration/geolite_city.rblib/generators/geocoder/maxmind/templates/migration/geolite_country.rbBoth begin with a class declaration containing
ActiveRecord::Migration<%= migration_version %>. With the currentcreateSourceAnalyzer().analyzeSource(source, 'ruby'), each returnsparser_status: parsed, two method declarations (upanddown), and syntax diagnostics at the ERB marker.sourceFile({type: 'blob', path})returnstruefor both. RunninganalyzeFilesover just these two tracked blobs yieldsparsed: 2,parsed_with_errors: 2, four method scan candidates, and zero parse failures.Expected: identify unrendered ERB content in a
.rbtemplate as a template rather than executable Ruby source. It should not contribute direct method questions or call-graph nodes until rendered, and the ERB marker should not be reported as a Ruby syntax failure. Keep ordinary.rbsource with recoverable syntax errors eligible under #137.The earlier scanner classified these two files as parse failures, which marked an otherwise usable whole-repository graph partial. The parser-recovery change fixes that completeness symptom, but the template classification remains.