Skip to content

Commit 3654ee1

Browse files
committed
fix(lint): address multiple linting issues
- Add package comments to fix revive warnings - Fix goconst issue by extracting string constants - Replace unused cmd parameters with _ - Fix ASCII variable naming (Ascii -> ASCII) - Fix LRUCache comment formatting - Add comments to exported Push/Pop methods
1 parent 08a6e64 commit 3654ee1

File tree

18 files changed

+35
-17
lines changed

18 files changed

+35
-17
lines changed

cmd/example/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Example demonstrates usage of the llama3 tokenizer.
12
package main
23

34
import (

cmd/tokenizer/generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package main provides the tokenizer CLI tool.
12
package main
23

34
//go:generate gomarkdoc -o README.md -e . --embed --repository.url https://github.com/agentstation/tokenizer --repository.default-branch master --repository.path /cmd/tokenizer

cmd/tokenizer/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Common operations available for tokenizers:
4444
var versionCmd = &cobra.Command{
4545
Use: "version",
4646
Short: "Print version information",
47-
Run: func(cmd *cobra.Command, args []string) {
47+
Run: func(_ *cobra.Command, args []string) {
4848
fmt.Printf("tokenizer version %s\n", version)
4949
if commit != "none" {
5050
fmt.Printf(" commit: %s\n", commit)

generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package tokenizer provides a collection of high-performance tokenizer implementations.
12
package tokenizer
23

34
// Generate documentation for the root package

llama3/cmd/llama3/decode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ skipped using the --skip-special flag.`,
5050
return cmd
5151
}
5252

53-
func runDecode(cmd *cobra.Command, args []string) error {
53+
func runDecode(_ *cobra.Command, args []string) error {
5454
// Initialize tokenizer
5555
tokenizer, err := llama3.New()
5656
if err != nil {

llama3/cmd/llama3/encode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The output format can be:
5858
return cmd
5959
}
6060

61-
func runEncode(cmd *cobra.Command, args []string) error {
61+
func runEncode(_ *cobra.Command, args []string) error {
6262

6363
// Initialize tokenizer
6464
tokenizer, err := llama3.New()

llama3/cmd/llama3/info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ configuration.`,
2626
return cmd
2727
}
2828

29-
func runInfo(cmd *cobra.Command, args []string) error {
29+
func runInfo(_ *cobra.Command, args []string) error {
3030
// Initialize tokenizer
3131
tokenizer, err := llama3.New()
3232
if err != nil {

llama3/cmd/llama3/stream.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ import (
99
"github.com/agentstation/tokenizer/llama3"
1010
)
1111

12+
const (
13+
// Output format constants.
14+
outputFormatSpace = "space"
15+
outputFormatNewline = "newline"
16+
)
17+
1218
var (
1319
// Stream command flags.
1420
streamBufferSize int
@@ -58,7 +64,7 @@ Input is read from stdin only.`,
5864
return cmd
5965
}
6066

61-
func runStream(cmd *cobra.Command, args []string) error {
67+
func runStream(_ *cobra.Command, args []string) error {
6268

6369
// Validate output format
6470
if streamOutput != "space" && streamOutput != "newline" {
@@ -90,7 +96,7 @@ func runStream(cmd *cobra.Command, args []string) error {
9096
tokenCount++
9197

9298
switch streamOutput {
93-
case "newline":
99+
case outputFormatNewline:
94100
fmt.Println(token)
95101
case "space":
96102
if !first {

llama3/cmd/tools/generate-vectors/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Command generate-vectors creates test vectors for tokenizer validation.
12
package main
23

34
import (

llama3/cmd/tools/profile/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Command profile provides performance profiling for the tokenizer.
12
package main
23

34
import (

0 commit comments

Comments
 (0)