beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 140 forks source link

Broaden shebang detection #306

Closed hoelzro closed 7 years ago

hoelzro commented 11 years ago

We only detect shebangs for a select few languages; we should broaden this.

petdance commented 11 years ago

Are there any performance hits for expanding our shebang detection?

hoelzro commented 11 years ago

There should'nt be, but we should probably run the time regression thing after we add more languages. The first line of each resource should be cached. Running a bunch of regexes one after the other might hurt a bit, but we might be able to combine them into a super regex. How we extract which sub-regex matched could get interesting...

petdance commented 11 years ago

Let's do the performance test before we start thinking how we could optimize it.

mmcclimon commented 11 years ago

Isn't there already shebang detection for a lot of filetypes? ConfigDefault gives firstlinematch patterns for Perl, PHP, Python, Ruby, shell (of several varieties), and XML. This seems like most of the languages (that I can think of offhand, anyway) that use shebang lines anyway.

petdance commented 11 years ago

Yes, there is already shebang detection for many file types. I still am concerned about performance hits if that number explodes.