Skip to content

Commit

Permalink
Merge pull request #323 from wakatime/feature/custom-languages
Browse files Browse the repository at this point in the history
Add support for custom languages
  • Loading branch information
dron22 authored May 2, 2021
2 parents 8a8112f + 65ac19b commit 5bd0a50
Show file tree
Hide file tree
Showing 25 changed files with 441 additions and 1,130 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ build-binary-windows:
-ldflags "${LD_FLAGS} -X ${REPO}/pkg/version.OS=$(GOOS) -X ${REPO}/pkg/version.Arch=$(GOARCH)" \
-o ./build/$(BINARY_NAME)-$(GOOS)-$(GOARCH).exe

# generate plugin language mapping code
.PHONY: generate
generate:
go run ./cmd/generate/main.go

# install linter
.PHONY: install-linter
install-linter:
Expand All @@ -129,5 +124,5 @@ lint: install-linter
golangci-lint run ./...

.PHONY: test
test: generate
test:
go test -cover -race ./...
167 changes: 0 additions & 167 deletions cmd/generate/main.go

This file was deleted.

2 changes: 2 additions & 0 deletions cmd/legacy/heartbeat/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func SendHeartbeats(v *viper.Viper, queueFilepath string) error {
params.EntityType,
params.IsWrite,
params.Language,
params.LanguageAlternate,
params.LineNumber,
params.LocalFile,
params.Project.Alternate,
Expand All @@ -160,6 +161,7 @@ func SendHeartbeats(v *viper.Viper, queueFilepath string) error {
h.EntityType,
h.IsWrite,
h.Language,
"",
h.LineNumber,
h.LocalFile,
h.ProjectAlternate,
Expand Down
2 changes: 2 additions & 0 deletions cmd/legacy/heartbeat/heartbeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func TestSendHeartbeats(t *testing.T) {
v.Set("entity-type", "file")
v.Set("key", "00000000-0000-4000-8000-000000000000")
v.Set("language", "Go")
v.Set("alternate-language", "Golang")
v.Set("hide-branch-names", "true")
v.Set("project", "wakatime-cli")
v.Set("lineno", 13)
Expand Down Expand Up @@ -223,6 +224,7 @@ func TestSendHeartbeats_ExtraHeartbeats(t *testing.T) {
v.Set("hide-branch-names", "true")
v.Set("project", "wakatime-cli")
v.Set("language", "Go")
v.Set("alternate-language", "Golang")
v.Set("lineno", 13)
v.Set("plugin", plugin)
v.Set("time", 1585598059.1)
Expand Down
Loading

0 comments on commit 5bd0a50

Please sign in to comment.