mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-22 02:11:12 +00:00
Exclude generated files from language statistics (#11653)
* Update go-enry to v2.5.2
This commit is contained in:
parent
e8955173a9
commit
bd2335671f
28 changed files with 1402 additions and 1260 deletions
12
vendor/github.com/go-enry/go-enry/v2/common.go
generated
vendored
12
vendor/github.com/go-enry/go-enry/v2/common.go
generated
vendored
|
@ -328,15 +328,13 @@ func getInterpreter(data []byte) (interpreter string) {
|
|||
return
|
||||
}
|
||||
|
||||
func getFirstLine(data []byte) []byte {
|
||||
buf := bufio.NewScanner(bytes.NewReader(data))
|
||||
buf.Scan()
|
||||
line := buf.Bytes()
|
||||
if err := buf.Err(); err != nil {
|
||||
return nil
|
||||
func getFirstLine(content []byte) []byte {
|
||||
nlpos := bytes.IndexByte(content, '\n')
|
||||
if nlpos < 0 {
|
||||
return content
|
||||
}
|
||||
|
||||
return line
|
||||
return content[:nlpos]
|
||||
}
|
||||
|
||||
func hasShebang(line []byte) bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue