Skip to content

Commit

Permalink
chore: update dependencies (#1)
Browse files Browse the repository at this point in the history
* refactor: sort imports

* fix: typo

* chore: update dependencies

---------

Co-authored-by: wangyaohui <wangyaohui.01@bytedance.com>
  • Loading branch information
yaohui-wyh and wangyaohui authored Oct 24, 2023
1 parent 0d575fe commit 1e92a69
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions cmd/ctoc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/jessevdk/go-flags"
"github.com/pkoukk/tiktoken-go"

"github.com/yaohui-wyh/ctoc"
)

Expand Down
16 changes: 8 additions & 8 deletions file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
)

func TestAnalayzeFile4Python(t *testing.T) {
func TestAnalyzeFile4Python(t *testing.T) {
tmpfile, err := os.CreateTemp("", "tmp.py")
if err != nil {
t.Logf("os.CreateTemp() error. err=[%v]", err)
Expand Down Expand Up @@ -49,7 +49,7 @@ class A:
}
}

func TestAnalayzeFile4PythonInvalid(t *testing.T) {
func TestAnalyzeFile4PythonInvalid(t *testing.T) {
tmpfile, err := os.CreateTemp("", "tmp.py")
if err != nil {
t.Logf("os.CreateTemp() error. err=[%v]", err)
Expand Down Expand Up @@ -91,7 +91,7 @@ class A:
}
}

func TestAnalayzeFile4PythonNoShebang(t *testing.T) {
func TestAnalyzeFile4PythonNoShebang(t *testing.T) {
tmpfile, err := os.CreateTemp("", "tmp.py")
if err != nil {
t.Logf("os.CreateTemp() error. err=[%v]", err)
Expand Down Expand Up @@ -136,7 +136,7 @@ func TestAnalayzeFile4PythonNoShebang(t *testing.T) {
}
}

func TestAnalayzeFile4Go(t *testing.T) {
func TestAnalyzeFile4Go(t *testing.T) {
tmpfile, err := os.CreateTemp("", "tmp.go")
if err != nil {
t.Logf("os.CreateTemp() error. err=[%v]", err)
Expand Down Expand Up @@ -179,7 +179,7 @@ func main() {
}
}

func TestAnalayzeFile4GoWithOnelineBlockComment(t *testing.T) {
func TestAnalyzeFile4GoWithOnlineBlockComment(t *testing.T) {
t.SkipNow()
tmpfile, err := os.CreateTemp("", "tmp.go")
if err != nil {
Expand Down Expand Up @@ -223,7 +223,7 @@ func main() {
}
}

func TestAnalayzeFile4GoWithCommentInnerBlockComment(t *testing.T) {
func TestAnalyzeFile4GoWithCommentInnerBlockComment(t *testing.T) {
tmpfile, err := os.CreateTemp("", "tmp.go")
if err != nil {
t.Logf("os.CreateTemp() error. err=[%v]", err)
Expand Down Expand Up @@ -453,7 +453,7 @@ func TestAnalyzeFile4Makefile(t *testing.T) {
}
}

func TestAnalayzeReader(t *testing.T) {
func TestAnalyzeReader(t *testing.T) {
buf := bytes.NewBuffer([]byte(`#!/bin/python
class A:
Expand Down Expand Up @@ -485,7 +485,7 @@ class A:
}
}

func TestAnalayzeReader_OnCallbacks(t *testing.T) {
func TestAnalyzeReader_OnCallbacks(t *testing.T) {
buf := bytes.NewBuffer([]byte(`foo
"""bar
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ require (
github.com/jessevdk/go-flags v1.4.0
github.com/pkoukk/tiktoken-go v0.1.6
github.com/spf13/afero v1.2.2
golang.org/x/tools v0.1.12
golang.org/x/tools v0.14.0
)

require (
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/go-enry/go-oniguruma v1.2.1 // indirect
github.com/google/uuid v1.3.1 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.3.8 // indirect
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func checkOptionMatch(path string, info os.FileInfo, opts *ClocOptions) bool {

// getAllFiles return all the files to be analyzed in paths.
func getAllFiles(paths []string, languages *DefinedLanguages, opts *ClocOptions) (result map[string]*Language, err error) {
result = make(map[string]*Language, 0)
result = make(map[string]*Language)
fileCache := make(map[string]struct{})

for _, root := range paths {
Expand Down

0 comments on commit 1e92a69

Please sign in to comment.