Skip to content

Commit

Permalink
Add special cases detection for go.mod and CMmakeLists.txt files
Browse files Browse the repository at this point in the history
  • Loading branch information
dron22 committed Dec 16, 2020
1 parent d8b487e commit 72e6261
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/language/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ func detectSpecialCases(fp string) (heartbeat.Language, bool) {
dir, file := filepath.Split(fp)
ext := strings.ToLower(filepath.Ext(file))

switch file {
case "go.mod":
return heartbeat.LanguageGo, true
case "CMmakeLists.txt":
return heartbeat.LanguageCMake, true
}

// nolint
if strings.HasPrefix(ext, ".h") || strings.HasPrefix(ext, ".c") {
if correspondingFileExists(fp, ".c") {
Expand Down

0 comments on commit 72e6261

Please sign in to comment.