From 8894ba86c9dd92894ba9a24403f5db04e9bbcdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Fri, 15 Mar 2024 10:06:05 +0100 Subject: [PATCH 001/117] chore: bump ls-lint in actions --- .github/workflows/github-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index 3abf9839..b5e38f0d 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -5,4 +5,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ls-lint/action@v2.2.2 \ No newline at end of file + - uses: ls-lint/action@v2.2.3 \ No newline at end of file From a8e466df18ff6c7353bb78ccbd6af344b5cb0672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Sun, 24 Mar 2024 16:42:28 +0100 Subject: [PATCH 002/117] feat: allow specifing individual files --- cmd/ls_lint/main.go | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/cmd/ls_lint/main.go b/cmd/ls_lint/main.go index 76f05c2f..cdbeb7cd 100644 --- a/cmd/ls_lint/main.go +++ b/cmd/ls_lint/main.go @@ -9,12 +9,14 @@ import ( "github.com/loeffel-io/ls-lint/v2/internal/linter" "github.com/loeffel-io/ls-lint/v2/internal/rule" "gopkg.in/yaml.v3" + "io/fs" "log" "maps" "os" "runtime" "slices" "strings" + "testing/fstest" ) var Version = "dev" @@ -32,6 +34,18 @@ func main() { var flagConfig _flag.Config flags.Var(&flagConfig, "config", "ls-lint config file path(s)") + flags.Usage = func() { + if _, err = fmt.Fprintln(flags.Output(), "ls-lint [options] [file|dir]*"); err != nil { + log.Fatal(err) + } + + if _, err = fmt.Fprintln(flags.Output(), "Options: "); err != nil { + log.Fatal(err) + } + + flags.PrintDefaults() + } + if err = flags.Parse(os.Args[1:]); err != nil { log.Fatal(err) } @@ -41,23 +55,37 @@ func main() { os.Exit(0) } - var filesystem = os.DirFS(*flagWorkdir) - if len(flagConfig) == 0 { flagConfig = _flag.Config{".ls-lint.yml"} } + var args = flags.Args() + var filesystem fs.FS + switch len(args) { + case 0: + filesystem = os.DirFS(*flagWorkdir) + default: + var mapFilesystem = make(fstest.MapFS, len(args)) + for _, file := range args { + var fileInfo os.FileInfo + if fileInfo, err = os.Stat(fmt.Sprintf("%s/%s", *flagWorkdir, file)); err != nil { + log.Fatal(err) + } + + mapFilesystem[file] = &fstest.MapFile{Mode: fileInfo.Mode()} + } + filesystem = mapFilesystem + } + var lslintConfig = config.NewConfig(make(config.Ls), make([]string, 0)) for _, c := range flagConfig { var tmpLslintConfig = config.NewConfig(nil, nil) var tmpConfigBytes []byte - // read file if tmpConfigBytes, err = os.ReadFile(c); err != nil { log.Fatal(err) } - // to yaml if err = yaml.Unmarshal(tmpConfigBytes, tmpLslintConfig); err != nil { log.Fatal(err) } @@ -68,7 +96,6 @@ func main() { lslintConfig.Ignore = slices.Compact(lslintConfig.Ignore) } - // linter var lslintLinter = linter.NewLinter( ".", lslintConfig, @@ -81,10 +108,8 @@ func main() { log.Fatal(err) } - // rule errors ruleErrors := lslintLinter.GetErrors() - // no ruleErrors if len(ruleErrors) == 0 { os.Exit(exitCode) } @@ -96,7 +121,6 @@ func main() { logger := log.New(writer, "", log.LstdFlags) - // with rule errors for _, ruleErr := range lslintLinter.GetErrors() { var ruleMessages []string From 0943fc0c380e96690cf380c0bc4b77bf23748423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Sun, 24 Mar 2024 17:15:30 +0100 Subject: [PATCH 003/117] chore: bump license date --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 12e7f204..8cb622c4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020-2023 Lucas Löffel +Copyright (c) 2020-2024 Lucas Löffel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 5b08ef5a6e159cae92eff16c6b8e25b4b0be78cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Sun, 24 Mar 2024 20:51:03 +0100 Subject: [PATCH 004/117] feat: add error-output-format option --- cmd/ls_lint/main.go | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/cmd/ls_lint/main.go b/cmd/ls_lint/main.go index cdbeb7cd..2a455f55 100644 --- a/cmd/ls_lint/main.go +++ b/cmd/ls_lint/main.go @@ -1,6 +1,7 @@ package main import ( + "encoding/json" "flag" "fmt" "github.com/loeffel-io/ls-lint/v2/internal/config" @@ -27,6 +28,7 @@ func main() { var writer = os.Stdout var flags = flag.NewFlagSet(os.Args[0], flag.ExitOnError) var flagWorkdir = flags.String("workdir", ".", "change working directory before executing the given subcommand") + var flagErrorOutputFormat = flags.String("error-output-format", "text", "use a specific error output format (text, json)") var flagWarn = flags.Bool("warn", false, "write lint errors to stdout instead of stderr (exit 0)") var flagDebug = flags.Bool("debug", false, "write debug informations to stdout") var flagVersion = flags.Bool("version", false, "prints version information for ls-lint") @@ -103,7 +105,6 @@ func main() { make([]*rule.Error, 0), ) - // runner if err = lslintLinter.Run(filesystem, *flagDebug); err != nil { log.Fatal(err) } @@ -119,16 +120,36 @@ func main() { exitCode = 1 } - logger := log.New(writer, "", log.LstdFlags) + switch *flagErrorOutputFormat { + case "json": + var errIndex = make(map[string][]string, len(lslintLinter.GetErrors())) + for _, ruleErr := range lslintLinter.GetErrors() { + errIndex[ruleErr.GetPath()] = make([]string, len(ruleErr.GetRules())) + for i, ruleErrMessages := range ruleErr.GetRules() { + errIndex[ruleErr.GetPath()][i] = ruleErrMessages.GetErrorMessage() + } + } - for _, ruleErr := range lslintLinter.GetErrors() { - var ruleMessages []string + var jsonStr []byte + if jsonStr, err = json.Marshal(errIndex); err != nil { + log.Fatal(err) + } - for _, errRule := range ruleErr.GetRules() { - ruleMessages = append(ruleMessages, errRule.GetErrorMessage()) + if _, err = fmt.Fprintln(writer, string(jsonStr)); err != nil { + log.Fatal(err) } + default: + for _, ruleErr := range lslintLinter.GetErrors() { + var ruleMessages []string - logger.Printf("%s failed for rules: %s", ruleErr.GetPath(), strings.Join(ruleMessages, "|")) + for _, errRule := range ruleErr.GetRules() { + ruleMessages = append(ruleMessages, errRule.GetErrorMessage()) + } + + if _, err = fmt.Fprintf(writer, "%s failed for rules: %s\n", ruleErr.GetPath(), strings.Join(ruleMessages, "|")); err != nil { + log.Fatal(err) + } + } } os.Exit(exitCode) From 61609d897bcf2b6029384dd68a1bf0fb903381c9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 19:56:02 +0000 Subject: [PATCH 005/117] chore(deps): update gcr.io/bazel-public/bazel docker digest to 7430f06 --- .github/workflows/bazel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index c365fc51..924b0b74 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: gcr.io/bazel-public/bazel@sha256:75cb96556a69f422296cb85699a7db8782c76105fdbe39b74ca4b39dc7102311 + image: gcr.io/bazel-public/bazel@sha256:7430f06fff16c8860ec486e1fe0e8c7ce0209a78605b97f41ab6e17f1330ab85 options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -24,7 +24,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest container: - image: gcr.io/bazel-public/bazel@sha256:75cb96556a69f422296cb85699a7db8782c76105fdbe39b74ca4b39dc7102311 + image: gcr.io/bazel-public/bazel@sha256:7430f06fff16c8860ec486e1fe0e8c7ce0209a78605b97f41ab6e17f1330ab85 options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: GH_TOKEN: ${{ github.token }} From e47c90cb3f8f33df68428b38f5eedd85bdd68be6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 19:56:05 +0000 Subject: [PATCH 006/117] chore(deps): update dependency bazel to v7.1.1 --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index 3769235d..ef09838c 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.1.0 \ No newline at end of file +7.1.1 \ No newline at end of file From 68890600a82278412327c9624b291077baa04b40 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 20:10:10 +0000 Subject: [PATCH 007/117] chore(deps): update dependency aspect_rules_js to v1.39.1 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index c75dd0a9..ca6bd541 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -32,9 +32,9 @@ http_archive( http_archive( name = "aspect_rules_js", - sha256 = "edc7b0255114fafdbbd593ea5d5fdfd54b2a603f33b3a49518910ac618e1bf2b", - strip_prefix = "rules_js-1.38.0", - url = "https://github.com/aspect-build/rules_js/releases/download/v1.38.0/rules_js-v1.38.0.tar.gz", + sha256 = "63cf42b07aae34904447c74f5b41652c4933984cc325726673a5e4561d9789e7", + strip_prefix = "rules_js-1.39.1", + url = "https://github.com/aspect-build/rules_js/releases/download/v1.39.1/rules_js-v1.39.1.tar.gz", ) load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") From 6453d8fbe5b7a160fe97885e4e6bf1cbeabc861d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 20:10:13 +0000 Subject: [PATCH 008/117] chore(deps): update dependency com_github_cli_cli_darwin_arm64 to v2.46.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index c75dd0a9..bb7c256d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -111,10 +111,10 @@ register_jq_toolchains() http_archive( name = "com_github_cli_cli_darwin_arm64", build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "a0423acd5954932a817d531a8160b67cf0456ea6c9e68c11c054c19ea7a6714b", - strip_prefix = "gh_2.45.0_macOS_arm64", + sha256 = "2540cf5281c93089e5e5d9fc502b08fb109db763f7810f048627b39ff0a855c5", + strip_prefix = "gh_2.46.0_macOS_arm64", urls = [ - "https://github.com/cli/cli/releases/download/v2.45.0/gh_2.45.0_macOS_arm64.zip", + "https://github.com/cli/cli/releases/download/v2.46.0/gh_2.46.0_macOS_arm64.zip", ], ) From 2f804913ee5f4b6793e689e0aae9c6d44dc45f41 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 20:10:15 +0000 Subject: [PATCH 009/117] chore(deps): update dependency com_github_cli_cli_linux_amd64 to v2.46.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index c75dd0a9..df4f97e0 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -121,10 +121,10 @@ http_archive( http_archive( name = "com_github_cli_cli_linux_amd64", build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "79e89a14af6fc69163aee00e764e86d5809d0c6c77e6f229aebe7a4ed115ee67", - strip_prefix = "gh_2.45.0_linux_amd64", + sha256 = "c671d450d7c0e95c84fbc6996591fc851d396848acd53e589ee388031cee9330", + strip_prefix = "gh_2.46.0_linux_amd64", urls = [ - "https://github.com/cli/cli/releases/download/v2.45.0/gh_2.45.0_linux_amd64.tar.gz", + "https://github.com/cli/cli/releases/download/v2.46.0/gh_2.46.0_linux_amd64.tar.gz", ], ) From ef49b6533f6de2f15fc7d1dfee62d7e253f59e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 25 Mar 2024 12:10:04 +0100 Subject: [PATCH 010/117] feat: add wildcard extension support --- internal/linter/linter.go | 25 +++++++++++--- internal/linter/linter_test.go | 60 ++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 4 deletions(-) diff --git a/internal/linter/linter.go b/internal/linter/linter.go index 1693b77d..c5857133 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -8,6 +8,7 @@ import ( "github.com/loeffel-io/ls-lint/v2/internal/rule" "golang.org/x/sync/errgroup" "io/fs" + "math" "path/filepath" "strings" "sync" @@ -116,12 +117,28 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string) error { var rulesError = 0 var rulesErrorMutex = new(sync.Mutex) - exts := strings.Split(filepath.Base(path), extSep) + exts := strings.Split(filepath.Base(path), extSep)[1:] rules := linter.config.GetConfig(index, path) - for i := 1; i < len(exts); i++ { - ext = fmt.Sprintf("%s%s", extSep, strings.Join(exts[i:], extSep)) - withoutExt := strings.TrimSuffix(filepath.Base(path), ext) + var n = len(exts) + var maxCombinations = int(math.Pow(2, float64(n))) // 2^N combinations + + var withoutExt string + for i := 0; i < maxCombinations; i++ { + combination := make([]string, n) + for j := 0; j < n; j++ { + if i&(1<<(n-1-j)) == 0 { // from left to right; right to left: i&(1< Date: Mon, 22 Apr 2024 10:42:49 +0000 Subject: [PATCH 011/117] chore(deps): update dependency aspect_rules_js to v1.41.2 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 8df1badf..d281d8a4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -32,9 +32,9 @@ http_archive( http_archive( name = "aspect_rules_js", - sha256 = "63cf42b07aae34904447c74f5b41652c4933984cc325726673a5e4561d9789e7", - strip_prefix = "rules_js-1.39.1", - url = "https://github.com/aspect-build/rules_js/releases/download/v1.39.1/rules_js-v1.39.1.tar.gz", + sha256 = "bc9b4a01ef8eb050d8a7a050eedde8ffb1e45a56b0e4094e26f06c17d5fcf1d5", + strip_prefix = "rules_js-1.41.2", + url = "https://github.com/aspect-build/rules_js/releases/download/v1.41.2/rules_js-v1.41.2.tar.gz", ) load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") From e14fc6c4f8f4e5b7d32d2d8523c8103043808b10 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:43:14 +0000 Subject: [PATCH 012/117] fix(deps): update module golang.org/x/sync to v0.7.0 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index bea92db2..bfe03a5e 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,6 @@ go 1.22 require ( github.com/bmatcuk/doublestar/v4 v4.6.1 - golang.org/x/sync v0.6.0 + golang.org/x/sync v0.7.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 4b609e77..cc52d138 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwN github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From fc4754271a9453239e25e621996254dd53e602c9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:45:50 +0000 Subject: [PATCH 013/117] chore(deps): update dependency com_github_cli_cli_darwin_arm64 to v2.48.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index d281d8a4..ff74c6b3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -111,10 +111,10 @@ register_jq_toolchains() http_archive( name = "com_github_cli_cli_darwin_arm64", build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "2540cf5281c93089e5e5d9fc502b08fb109db763f7810f048627b39ff0a855c5", - strip_prefix = "gh_2.46.0_macOS_arm64", + sha256 = "b82c847c581d2540d12f266d7f1739274c5cccbfc0dffe236739ac5cc21acc91", + strip_prefix = "gh_2.48.0_macOS_arm64", urls = [ - "https://github.com/cli/cli/releases/download/v2.46.0/gh_2.46.0_macOS_arm64.zip", + "https://github.com/cli/cli/releases/download/v2.48.0/gh_2.48.0_macOS_arm64.zip", ], ) From 40e7def5b890695c01fb92557492e1f2fc5bd215 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:45:53 +0000 Subject: [PATCH 014/117] chore(deps): update dependency com_github_cli_cli_linux_amd64 to v2.48.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index d281d8a4..f75c2411 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -121,10 +121,10 @@ http_archive( http_archive( name = "com_github_cli_cli_linux_amd64", build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "c671d450d7c0e95c84fbc6996591fc851d396848acd53e589ee388031cee9330", - strip_prefix = "gh_2.46.0_linux_amd64", + sha256 = "1c477e2562aca8679b0219569f0482f1975de76daca8ba307892c1787338a28d", + strip_prefix = "gh_2.48.0_linux_amd64", urls = [ - "https://github.com/cli/cli/releases/download/v2.46.0/gh_2.46.0_linux_amd64.tar.gz", + "https://github.com/cli/cli/releases/download/v2.48.0/gh_2.48.0_linux_amd64.tar.gz", ], ) From cbf51d1b7af760f9fd2c42f2d582fe5cecbf28bc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:46:26 +0000 Subject: [PATCH 015/117] chore(deps): update dependency bazel_gazelle to v0.36.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index f75c2411..48b13ad2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,10 +15,10 @@ http_archive( http_archive( name = "bazel_gazelle", - sha256 = "32938bda16e6700063035479063d9d24c60eda8d79fd4739563f50d331cb3209", + sha256 = "75df288c4b31c81eb50f51e2e14f4763cb7548daae126817247064637fd9ea62", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz", ], ) From ceb1d8e8075f6a778c575aeed80512d320e40f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 22 Apr 2024 12:50:05 +0200 Subject: [PATCH 016/117] chore: bump deps --- go.sum | 2 -- repositories.bzl | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/go.sum b/go.sum index cc52d138..eb4521ed 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/repositories.bzl b/repositories.bzl index 07cc6b97..a1d4319f 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -22,6 +22,6 @@ def go_repositories(): go_repository( name = "org_golang_x_sync", importpath = "golang.org/x/sync", - sum = "h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=", - version = "v0.6.0", + sum = "h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=", + version = "v0.7.0", ) From cc3e80d2483e5f0dda0125f3152825eaf724da3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 23 Apr 2024 15:57:54 +0200 Subject: [PATCH 017/117] feat: first version of exists --- .ls-lint.yml | 11 ++ cmd/ls_lint/main.go | 2 +- internal/config/config.go | 2 + internal/linter/linter.go | 84 ++++++++---- internal/linter/linter_test.go | 155 ++++++++++++++++++++++- internal/rule/BUILD.bazel | 2 + internal/rule/camelcase.go | 21 ++- internal/rule/camelcase_test.go | 11 +- internal/rule/error.go | 8 ++ internal/rule/exists.go | 144 +++++++++++++++++++++ internal/rule/exists_test.go | 81 ++++++++++++ internal/rule/kebabcase.go | 21 ++- internal/rule/kebabcase_test.go | 11 +- internal/rule/lowercase.go | 21 ++- internal/rule/lowercase_test.go | 11 +- internal/rule/pascalcase.go | 21 ++- internal/rule/pascalcase_test.go | 11 +- internal/rule/pointcase.go | 21 ++- internal/rule/pointcase_test.go | 11 +- internal/rule/regex.go | 31 +++-- internal/rule/regex_test.go | 11 +- internal/rule/rule.go | 5 +- internal/rule/screamingsnakecase.go | 21 ++- internal/rule/screamingsnakecase_test.go | 7 +- internal/rule/snakecase.go | 21 ++- internal/rule/snakecase_test.go | 11 +- 26 files changed, 646 insertions(+), 110 deletions(-) create mode 100644 internal/rule/exists.go create mode 100644 internal/rule/exists_test.go diff --git a/.ls-lint.yml b/.ls-lint.yml index 4fd1ee6c..d8b08629 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -7,6 +7,17 @@ ls: .yaml: snake_case .js: snake_case + peter: + .dir: exists:1 + .*: PascalCase | exists:1 + .js: exists:2 | snake_case + .go: exists:0 + + '**': + .js: exists:1-3 | snakecase + .go: snake_case + .html: PascalCase + ignore: - .git - .github diff --git a/cmd/ls_lint/main.go b/cmd/ls_lint/main.go index 2a455f55..65ff7f76 100644 --- a/cmd/ls_lint/main.go +++ b/cmd/ls_lint/main.go @@ -146,7 +146,7 @@ func main() { ruleMessages = append(ruleMessages, errRule.GetErrorMessage()) } - if _, err = fmt.Fprintf(writer, "%s failed for rules: %s\n", ruleErr.GetPath(), strings.Join(ruleMessages, "|")); err != nil { + if _, err = fmt.Fprintf(writer, "%s failed for `%s` rules: %s\n", ruleErr.GetPath(), ruleErr.GetExt(), strings.Join(ruleMessages, " | ")); err != nil { log.Fatal(err) } } diff --git a/internal/config/config.go b/internal/config/config.go index f8b2fb97..a742cfea 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -144,6 +144,8 @@ func (config *Config) copyRule(r rule.Rule) rule.Rule { switch r.GetName() { case "regex": return new(rule.Regex).Init() + case "exists": + return new(rule.Exists).Init() } return r diff --git a/internal/linter/linter.go b/internal/linter/linter.go index c5857133..a052b4eb 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -61,8 +61,10 @@ func (linter *Linter) AddError(error *rule.Error) { func (linter *Linter) validateDir(index config.RuleIndex, path string) error { var g = new(errgroup.Group) - var rulesError = 0 - var rulesErrorMutex = new(sync.Mutex) + + var rulesNonExclusiveCount int8 + var rulesNonExclusiveError int8 + var rulesMutex = new(sync.Mutex) rules := linter.config.GetConfig(index, path) basename := filepath.Base(path) @@ -76,18 +78,20 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string) error { } for _, ruleDir := range rules[dir] { - ruleDirCopy := ruleDir g.Go(func() error { - valid, err := ruleDirCopy.Validate(basename) + valid, err := ruleDir.Validate(basename, ruleDir.GetName() != "exists") if err != nil { return err } - if !valid { - rulesErrorMutex.Lock() - rulesError += 1 - rulesErrorMutex.Unlock() + if !ruleDir.GetExclusive() { + rulesMutex.Lock() + rulesNonExclusiveCount += 1 + if !valid { + rulesNonExclusiveError += 1 + } + rulesMutex.Unlock() } return nil @@ -98,12 +102,13 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string) error { return err } - if rulesError == 0 || rulesError != len(rules[dir]) { + if rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { return nil } linter.AddError(&rule.Error{ Path: path, + Ext: dir, Rules: rules[dir], RWMutex: new(sync.RWMutex), }) @@ -114,8 +119,10 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string) error { func (linter *Linter) validateFile(index config.RuleIndex, path string) error { var ext string var g = new(errgroup.Group) - var rulesError = 0 - var rulesErrorMutex = new(sync.Mutex) + + var rulesNonExclusiveCount int8 + var rulesNonExclusiveError int8 + var rulesMutex = new(sync.Mutex) exts := strings.Split(filepath.Base(path), extSep)[1:] rules := linter.config.GetConfig(index, path) @@ -142,18 +149,20 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string) error { if _, exists := rules[ext]; exists { for _, ruleFile := range rules[ext] { - ruleFileCopy := ruleFile g.Go(func() error { - valid, err := ruleFileCopy.Validate(withoutExt) + valid, err := ruleFile.Validate(withoutExt, ruleFile.GetName() != "exists") if err != nil { return err } - if !valid { - rulesErrorMutex.Lock() - rulesError += 1 - rulesErrorMutex.Unlock() + if !ruleFile.GetExclusive() { + rulesMutex.Lock() + rulesNonExclusiveCount += 1 + if !valid { + rulesNonExclusiveError += 1 + } + rulesMutex.Unlock() } return nil @@ -168,12 +177,13 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string) error { return err } - if rulesError == 0 || rulesError != len(rules[ext]) { + if rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { return nil } linter.AddError(&rule.Error{ Path: path, + Ext: ext, Rules: rules[ext], RWMutex: new(sync.RWMutex), }) @@ -210,7 +220,7 @@ func (linter *Linter) Run(filesystem fs.FS, debug bool) (err error) { fmt.Printf("%s:", path) } - for extension, rules := range pathIndex { + for ext, rules := range pathIndex { var tmpRules = make([]string, 0) for _, tmpRule := range rules { if len(tmpRule.GetParameters()) > 0 { @@ -221,7 +231,7 @@ func (linter *Linter) Run(filesystem fs.FS, debug bool) (err error) { tmpRules = append(tmpRules, tmpRule.GetName()) } - fmt.Printf(" %s: %s", extension, strings.Join(tmpRules, ", ")) + fmt.Printf(" %s: %s", ext, strings.Join(tmpRules, ", ")) } fmt.Printf("\n") } @@ -237,7 +247,7 @@ func (linter *Linter) Run(filesystem fs.FS, debug bool) (err error) { if debug { defer func() { fmt.Printf("-----------------------------\nstatistics\n-----------------------------\n") - fmt.Printf("time: %d ms\n", time.Since(linter.GetStatistics().Start).Milliseconds()) + fmt.Printf("time: %d µs / %d ms\n", time.Since(linter.GetStatistics().Start).Microseconds(), time.Since(linter.GetStatistics().Start).Milliseconds()) fmt.Printf("files: %d\n", linter.GetStatistics().Files) fmt.Printf("file skips: %d\n", linter.GetStatistics().FileSkips) fmt.Printf("dirs: %d\n", linter.GetStatistics().Dirs) @@ -246,7 +256,7 @@ func (linter *Linter) Run(filesystem fs.FS, debug bool) (err error) { }() } - return fs.WalkDir(filesystem, linter.root, func(path string, info fs.DirEntry, err error) error { + if err = fs.WalkDir(filesystem, linter.root, func(path string, info fs.DirEntry, err error) error { if linter.config.ShouldIgnore(ignoreIndex, path) { if info.IsDir() { if debug { @@ -284,5 +294,33 @@ func (linter *Linter) Run(filesystem fs.FS, debug bool) (err error) { } return linter.validateFile(index, path) - }) + }); err != nil { + return err + } + + for path, pathIndex := range index { + for ext, rules := range pathIndex { + for _, r := range rules { + if r.GetName() != "exists" { + continue + } + + var valid bool + if valid, err = r.Validate("", true); err != nil { + return err + } + + if !valid { + linter.AddError(&rule.Error{ + Path: path, + Ext: ext, + Rules: []rule.Rule{r}, + RWMutex: new(sync.RWMutex), + }) + } + } + } + } + + return nil } diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index 715f49ae..4d494788 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -1,6 +1,7 @@ package linter import ( + "cmp" "errors" "fmt" "github.com/loeffel-io/ls-lint/v2/internal/config" @@ -8,13 +9,15 @@ import ( "github.com/loeffel-io/ls-lint/v2/internal/rule" "io/fs" "reflect" + "slices" + "strings" "sync" "testing" "testing/fstest" "time" ) -func TestLinterRun(t *testing.T) { +func TestLinter_Run(t *testing.T) { var start = time.Now() var tests = []*struct { @@ -102,6 +105,7 @@ func TestLinterRun(t *testing.T) { expectedErrors: []*rule.Error{ { Path: "not-snake-case.png", + Ext: ".png", Rules: []rule.Rule{ new(rule.SnakeCase).Init(), }, @@ -218,6 +222,7 @@ func TestLinterRun(t *testing.T) { expectedErrors: []*rule.Error{ { Path: "src/c/c/packages/not-snake-case.png", + Ext: ".png", Rules: []rule.Rule{ new(rule.SnakeCase).Init(), }, @@ -346,6 +351,139 @@ func TestLinterRun(t *testing.T) { }, expectedErrors: []*rule.Error{}, }, + { + description: "exists", + filesystem: fstest.MapFS{ + "snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "kebab-case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "node_modules": &fstest.MapFile{Mode: fs.ModeDir}, + "node_modules/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, + }, + linter: NewLinter( + ".", + config.NewConfig( + config.Ls{ + ".png": "snake_case | exists:1", + "test": config.Ls{ + ".dir": "exists:1", + }, + "test/*": config.Ls{ + ".*": "exists:0", + ".png": "snake_case | exists:1-2", + }, + "not_exists": config.Ls{ + ".dir": "exists:0", + }, + }, + []string{ + "node_modules", + "kebab-case.png", + }, + ), + &debug.Statistic{ + Start: start, + Files: 0, + FileSkips: 0, + Dirs: 0, + DirSkips: 0, + RWMutex: new(sync.RWMutex), + }, + []*rule.Error{}, + ), + expectedErr: nil, + expectedStatistic: &debug.Statistic{ + Start: start, + Files: 3, + FileSkips: 1, + Dirs: 3, + DirSkips: 1, + RWMutex: new(sync.RWMutex), + }, + expectedErrors: []*rule.Error{}, + }, + { + description: "exists with error", + filesystem: fstest.MapFS{ + "snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "kebab-case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "node_modules": &fstest.MapFile{Mode: fs.ModeDir}, + "node_modules/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, + }, + linter: NewLinter( + ".", + config.NewConfig( + config.Ls{ + ".png": "snake_case | exists:2", + "test": config.Ls{ + ".dir": "exists:1", + }, + "test/*": config.Ls{ + ".*": "exists:0", + ".png": "snake_case | exists:3-5", + }, + "not_exists": config.Ls{ + ".dir": "exists:1", + }, + }, + []string{ + "node_modules", + "kebab-case.png", + }, + ), + &debug.Statistic{ + Start: start, + Files: 0, + FileSkips: 0, + Dirs: 0, + DirSkips: 0, + RWMutex: new(sync.RWMutex), + }, + []*rule.Error{}, + ), + expectedErr: nil, + expectedStatistic: &debug.Statistic{ + Start: start, + Files: 3, + FileSkips: 1, + Dirs: 3, + DirSkips: 1, + RWMutex: new(sync.RWMutex), + }, + expectedErrors: []*rule.Error{ + { + Path: "not_exists", + Ext: ".dir", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + { + Path: "test/sub", + Ext: ".png", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + { + Path: "", + Ext: ".png", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + }, + }, } var i = 0 @@ -370,6 +508,16 @@ func TestLinterRun(t *testing.T) { return } + if len(test.linter.GetErrors()) > 0 { + slices.SortStableFunc(test.linter.GetErrors(), func(a, b *rule.Error) int { + return cmp.Compare(strings.ToLower(a.GetPath()), strings.ToLower(b.GetPath())) + }) + + slices.SortStableFunc(test.expectedErrors, func(a, b *rule.Error) int { + return cmp.Compare(strings.ToLower(a.GetPath()), strings.ToLower(b.GetPath())) + }) + } + var j int var tmpError *rule.Error for j, tmpError = range test.linter.GetErrors() { @@ -378,6 +526,11 @@ func TestLinterRun(t *testing.T) { return } + if tmpError.GetExt() != test.expectedErrors[j].GetExt() { + t.Error(equalErrorsErr) + return + } + if len(tmpError.GetRules()) != len(test.expectedErrors[j].GetRules()) { t.Error(equalErrorsErr) return diff --git a/internal/rule/BUILD.bazel b/internal/rule/BUILD.bazel index c6092b9c..18674043 100644 --- a/internal/rule/BUILD.bazel +++ b/internal/rule/BUILD.bazel @@ -5,6 +5,7 @@ go_library( srcs = [ "camelcase.go", "error.go", + "exists.go", "kebabcase.go", "lowercase.go", "pascalcase.go", @@ -22,6 +23,7 @@ go_test( name = "rule_test", srcs = [ "camelcase_test.go", + "exists_test.go", "kebabcase_test.go", "lowercase_test.go", "pascalcase_test.go", diff --git a/internal/rule/camelcase.go b/internal/rule/camelcase.go index 20e01970..d4e24fd3 100644 --- a/internal/rule/camelcase.go +++ b/internal/rule/camelcase.go @@ -6,22 +6,24 @@ import ( ) type CamelCase struct { - Name string + name string + exclusive bool *sync.RWMutex } func (rule *CamelCase) Init() Rule { - rule.Name = "camelcase" + rule.name = "camelcase" + rule.exclusive = false rule.RWMutex = new(sync.RWMutex) return rule } func (rule *CamelCase) GetName() string { - rule.Lock() - defer rule.Unlock() + rule.RLock() + defer rule.RUnlock() - return rule.Name + return rule.name } func (rule *CamelCase) SetParameters(params []string) error { @@ -32,9 +34,16 @@ func (rule *CamelCase) GetParameters() []string { return nil } +func (rule *CamelCase) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive +} + // Validate checks if string is camel case // false if rune is no letter and no digit -func (rule *CamelCase) Validate(value string) (bool, error) { +func (rule *CamelCase) Validate(value string, fail bool) (bool, error) { for i, c := range value { // must be letter or digit if !unicode.IsLetter(c) && !unicode.IsDigit(c) { diff --git a/internal/rule/camelcase_test.go b/internal/rule/camelcase_test.go index 84a2e93b..040f9286 100644 --- a/internal/rule/camelcase_test.go +++ b/internal/rule/camelcase_test.go @@ -1,6 +1,9 @@ package rule -import "testing" +import ( + "errors" + "testing" +) func TestCamelCase(t *testing.T) { var rule = new(CamelCase).Init() @@ -23,10 +26,10 @@ func TestCamelCase(t *testing.T) { var i = 0 for _, test := range tests { - res, err := rule.Validate(test.value) + res, err := rule.Validate(test.value, true) - if err != nil && err != test.err { - t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) return } diff --git a/internal/rule/error.go b/internal/rule/error.go index f96c1fa4..f867c45f 100644 --- a/internal/rule/error.go +++ b/internal/rule/error.go @@ -4,6 +4,7 @@ import "sync" type Error struct { Path string + Ext string Rules []Rule *sync.RWMutex } @@ -15,6 +16,13 @@ func (error *Error) GetPath() string { return error.Path } +func (error *Error) GetExt() string { + error.RLock() + defer error.RUnlock() + + return error.Ext +} + func (error *Error) GetRules() []Rule { error.RLock() defer error.RUnlock() diff --git a/internal/rule/exists.go b/internal/rule/exists.go new file mode 100644 index 00000000..aef54ef3 --- /dev/null +++ b/internal/rule/exists.go @@ -0,0 +1,144 @@ +package rule + +import ( + "fmt" + "math" + "strconv" + "strings" + "sync" +) + +type Exists struct { + name string + exclusive bool + min int16 + max int16 + count int16 + *sync.RWMutex +} + +func (rule *Exists) Init() Rule { + rule.name = "exists" + rule.exclusive = true + rule.count = 0 + rule.RWMutex = new(sync.RWMutex) + + return rule +} + +func (rule *Exists) GetName() string { + rule.RLock() + defer rule.RUnlock() + + return rule.name +} + +// 0 = regex pattern +func (rule *Exists) SetParameters(params []string) error { + rule.Lock() + defer rule.Unlock() + + // exists + if len(params) == 0 { + rule.min = 1 + rule.max = math.MaxInt16 + return nil + } + + // exists: + if params[0] == "" { + return fmt.Errorf("exists value is empty") + } + + // exists:1 + var split = strings.Split(params[0], "-") + if len(split) == 1 { + var value int64 + var err error + + if value, err = strconv.ParseInt(params[0], 10, 16); err != nil { + return err.(*strconv.NumError).Err + } + + rule.min = int16(value) + rule.max = int16(value) + return nil + } + + // exists:1-4 + var minValue int64 + var maxValue int64 + var err error + + if minValue, err = strconv.ParseInt(split[0], 10, 16); err != nil { + return err.(*strconv.NumError).Err + } + + if maxValue, err = strconv.ParseInt(split[1], 10, 16); err != nil { + return err.(*strconv.NumError).Err + } + + rule.min = int16(minValue) + rule.max = int16(maxValue) + return nil +} + +func (rule *Exists) GetParameters() []string { + if rule.getMin() == rule.getMax() { + return []string{fmt.Sprintf("%d", rule.getMin())} + } + + return []string{fmt.Sprintf("%d-%d", rule.getMin(), rule.getMax())} +} + +func (rule *Exists) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive +} + +func (rule *Exists) Validate(value string, fail bool) (bool, error) { + if !fail { + rule.incrementCount() + return true, nil + } + + return rule.getCount() >= rule.getMin() && rule.getCount() <= rule.getMax(), nil +} + +func (rule *Exists) getMin() int16 { + rule.RLock() + defer rule.RUnlock() + + return rule.min +} + +func (rule *Exists) getMax() int16 { + rule.RLock() + defer rule.RUnlock() + + return rule.max +} + +func (rule *Exists) getCount() int16 { + rule.RLock() + defer rule.RUnlock() + + return rule.count +} + +func (rule *Exists) incrementCount() { + rule.Lock() + defer rule.Unlock() + + rule.count++ +} + +func (rule *Exists) GetErrorMessage() string { + if rule.getMin() == rule.getMax() { + return fmt.Sprintf("%s:%d", rule.GetName(), rule.getMin()) + } + + return fmt.Sprintf("%s:%d-%d", rule.GetName(), rule.getMin(), rule.getMax()) +} diff --git a/internal/rule/exists_test.go b/internal/rule/exists_test.go new file mode 100644 index 00000000..56c3de70 --- /dev/null +++ b/internal/rule/exists_test.go @@ -0,0 +1,81 @@ +package rule + +import ( + "errors" + "reflect" + "strconv" + "sync" + "testing" +) + +func TestExists_GetParameters(t *testing.T) { + var tests = []*struct { + params []string + expected []string + err error + }{ + {params: []string{"3"}, expected: []string{"3"}, err: nil}, + {params: []string{"0"}, expected: []string{"0"}, err: nil}, + {params: []string{"1-4"}, expected: []string{"1-4"}, err: nil}, + {params: []string{"-1"}, expected: []string{"0"}, err: strconv.ErrSyntax}, + {params: []string{"2342323423234"}, expected: []string{"0"}, err: strconv.ErrRange}, + {params: []string{"1-"}, expected: []string{"0"}, err: strconv.ErrSyntax}, + {params: []string{"1-2342323423234"}, expected: []string{"0"}, err: strconv.ErrRange}, + } + + var i = 0 + for _, test := range tests { + var rule = new(Exists).Init() + + err := rule.SetParameters(test.params) + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) + return + } + + params := rule.GetParameters() + if !reflect.DeepEqual(params, test.expected) { + t.Errorf("Test %d failed with unmatched return value - %+v", i, params) + return + } + + i++ + } +} + +func TestExists_Validate(t *testing.T) { + var tests = []*struct { + rule *Exists + fail bool + count int16 + valid bool + err error + }{ + {rule: &Exists{name: "exists", exclusive: true, min: 1, max: 1, count: 1, RWMutex: new(sync.RWMutex)}, fail: true, count: 1, valid: true, err: nil}, + {rule: &Exists{name: "exists", exclusive: true, min: 1, max: 3, count: 0, RWMutex: new(sync.RWMutex)}, fail: true, count: 0, valid: false, err: nil}, + {rule: &Exists{name: "exists", exclusive: true, min: 3, max: 6, count: 8, RWMutex: new(sync.RWMutex)}, fail: true, count: 8, valid: false, err: nil}, + {rule: &Exists{name: "exists", exclusive: true, min: 3, max: 6, count: 6, RWMutex: new(sync.RWMutex)}, fail: false, count: 7, valid: true, err: nil}, + } + + var i = 0 + for _, test := range tests { + var valid, err = test.rule.Validate("", test.fail) + + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) + return + } + + if test.rule.count != test.count { + t.Errorf("Test %d failed with unmatched count value - %d", i, test.rule.count) + return + } + + if valid != test.valid { + t.Errorf("Test %d failed with unmatched return value - %+v", i, valid) + return + } + + i++ + } +} diff --git a/internal/rule/kebabcase.go b/internal/rule/kebabcase.go index 43b1fb9b..78797e4d 100644 --- a/internal/rule/kebabcase.go +++ b/internal/rule/kebabcase.go @@ -6,22 +6,24 @@ import ( ) type KebabCase struct { - Name string + name string + exclusive bool *sync.RWMutex } func (rule *KebabCase) Init() Rule { - rule.Name = "kebabcase" + rule.name = "kebabcase" + rule.exclusive = false rule.RWMutex = new(sync.RWMutex) return rule } func (rule *KebabCase) GetName() string { - rule.Lock() - defer rule.Unlock() + rule.RLock() + defer rule.RUnlock() - return rule.Name + return rule.name } func (rule *KebabCase) SetParameters(params []string) error { @@ -32,9 +34,16 @@ func (rule *KebabCase) GetParameters() []string { return nil } +func (rule *KebabCase) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive +} + // Validate checks if string is kebab case // false if rune is no lowercase letter, digit or - -func (rule *KebabCase) Validate(value string) (bool, error) { +func (rule *KebabCase) Validate(value string, fail bool) (bool, error) { for _, c := range value { if c == 45 || unicode.IsDigit(c) { // 45 => - continue diff --git a/internal/rule/kebabcase_test.go b/internal/rule/kebabcase_test.go index e4300b6f..aa3aae20 100644 --- a/internal/rule/kebabcase_test.go +++ b/internal/rule/kebabcase_test.go @@ -1,6 +1,9 @@ package rule -import "testing" +import ( + "errors" + "testing" +) func TestKebabCase(t *testing.T) { var rule = new(KebabCase).Init() @@ -21,10 +24,10 @@ func TestKebabCase(t *testing.T) { var i = 0 for _, test := range tests { - res, err := rule.Validate(test.value) + res, err := rule.Validate(test.value, true) - if err != nil && err != test.err { - t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) return } diff --git a/internal/rule/lowercase.go b/internal/rule/lowercase.go index 1f9741ea..a30acbe8 100644 --- a/internal/rule/lowercase.go +++ b/internal/rule/lowercase.go @@ -6,22 +6,24 @@ import ( ) type Lowercase struct { - Name string + name string + exclusive bool *sync.RWMutex } func (rule *Lowercase) Init() Rule { - rule.Name = "lowercase" + rule.name = "lowercase" + rule.exclusive = false rule.RWMutex = new(sync.RWMutex) return rule } func (rule *Lowercase) GetName() string { - rule.Lock() - defer rule.Unlock() + rule.RLock() + defer rule.RUnlock() - return rule.Name + return rule.name } func (rule *Lowercase) SetParameters(params []string) error { @@ -32,8 +34,15 @@ func (rule *Lowercase) GetParameters() []string { return nil } +func (rule *Lowercase) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive +} + // Validate checks if every letter is lower -func (rule *Lowercase) Validate(value string) (bool, error) { +func (rule *Lowercase) Validate(value string, fail bool) (bool, error) { for _, c := range value { if unicode.IsLetter(c) && !unicode.IsLower(c) { return false, nil diff --git a/internal/rule/lowercase_test.go b/internal/rule/lowercase_test.go index b568b99f..e41f07ad 100644 --- a/internal/rule/lowercase_test.go +++ b/internal/rule/lowercase_test.go @@ -1,6 +1,9 @@ package rule -import "testing" +import ( + "errors" + "testing" +) func TestLowercase(t *testing.T) { var rule = new(Lowercase).Init() @@ -13,10 +16,10 @@ func TestLowercase(t *testing.T) { var i = 0 for _, test := range tests { - res, err := rule.Validate(test.value) + res, err := rule.Validate(test.value, true) - if err != nil && err != test.err { - t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) return } diff --git a/internal/rule/pascalcase.go b/internal/rule/pascalcase.go index 5d49400d..354787a3 100644 --- a/internal/rule/pascalcase.go +++ b/internal/rule/pascalcase.go @@ -6,22 +6,24 @@ import ( ) type PascalCase struct { - Name string + name string + exclusive bool *sync.RWMutex } func (rule *PascalCase) Init() Rule { - rule.Name = "pascalcase" + rule.name = "pascalcase" + rule.exclusive = false rule.RWMutex = new(sync.RWMutex) return rule } func (rule *PascalCase) GetName() string { - rule.Lock() - defer rule.Unlock() + rule.RLock() + defer rule.RUnlock() - return rule.Name + return rule.name } func (rule *PascalCase) SetParameters(params []string) error { @@ -32,10 +34,17 @@ func (rule *PascalCase) GetParameters() []string { return nil } +func (rule *PascalCase) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive +} + // Validate checks if string is pascal case // false if rune is no letter and no digit // false if first rune is not upper -func (rule *PascalCase) Validate(value string) (bool, error) { +func (rule *PascalCase) Validate(value string, fail bool) (bool, error) { for i, c := range value { // must be letter or digit if !unicode.IsLetter(c) && !unicode.IsDigit(c) { diff --git a/internal/rule/pascalcase_test.go b/internal/rule/pascalcase_test.go index 0b7e5b6e..84c7ca84 100644 --- a/internal/rule/pascalcase_test.go +++ b/internal/rule/pascalcase_test.go @@ -1,6 +1,9 @@ package rule -import "testing" +import ( + "errors" + "testing" +) func TestPascalCase(t *testing.T) { var rule = new(PascalCase).Init() @@ -22,10 +25,10 @@ func TestPascalCase(t *testing.T) { var i = 0 for _, test := range tests { - res, err := rule.Validate(test.value) + res, err := rule.Validate(test.value, true) - if err != nil && err != test.err { - t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) return } diff --git a/internal/rule/pointcase.go b/internal/rule/pointcase.go index c0432b10..5a427571 100644 --- a/internal/rule/pointcase.go +++ b/internal/rule/pointcase.go @@ -6,22 +6,24 @@ import ( ) type PointCase struct { - Name string + name string + exclusive bool *sync.RWMutex } func (rule *PointCase) Init() Rule { - rule.Name = "pointcase" + rule.name = "pointcase" + rule.exclusive = false rule.RWMutex = new(sync.RWMutex) return rule } func (rule *PointCase) GetName() string { - rule.Lock() - defer rule.Unlock() + rule.RLock() + defer rule.RUnlock() - return rule.Name + return rule.name } func (rule *PointCase) SetParameters(params []string) error { @@ -32,9 +34,16 @@ func (rule *PointCase) GetParameters() []string { return nil } +func (rule *PointCase) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive +} + // Validate checks if string is "point case" // false if rune is no lowercase letter, digit or . -func (rule *PointCase) Validate(value string) (bool, error) { +func (rule *PointCase) Validate(value string, fail bool) (bool, error) { for _, c := range value { if c == 46 || unicode.IsDigit(c) { // 46 => . continue diff --git a/internal/rule/pointcase_test.go b/internal/rule/pointcase_test.go index 9baf9eb8..b421578a 100644 --- a/internal/rule/pointcase_test.go +++ b/internal/rule/pointcase_test.go @@ -1,6 +1,9 @@ package rule -import "testing" +import ( + "errors" + "testing" +) func TestPointCase(t *testing.T) { var rule = new(PointCase).Init() @@ -21,10 +24,10 @@ func TestPointCase(t *testing.T) { var i = 0 for _, test := range tests { - res, err := rule.Validate(test.value) + res, err := rule.Validate(test.value, true) - if err != nil && err != test.err { - t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) return } diff --git a/internal/rule/regex.go b/internal/rule/regex.go index 06c63c51..144fdeb0 100644 --- a/internal/rule/regex.go +++ b/internal/rule/regex.go @@ -7,23 +7,25 @@ import ( ) type Regex struct { - Name string - RegexPattern string + name string + exclusive bool + regexPattern string *sync.RWMutex } func (rule *Regex) Init() Rule { - rule.Name = "regex" + rule.name = "regex" + rule.exclusive = false rule.RWMutex = new(sync.RWMutex) return rule } func (rule *Regex) GetName() string { - rule.Lock() - defer rule.Unlock() + rule.RLock() + defer rule.RUnlock() - return rule.Name + return rule.name } // 0 = regex pattern @@ -39,16 +41,23 @@ func (rule *Regex) SetParameters(params []string) error { return fmt.Errorf("regex pattern is empty") } - rule.RegexPattern = params[0] + rule.regexPattern = params[0] return nil } func (rule *Regex) GetParameters() []string { - return []string{rule.RegexPattern} + return []string{rule.regexPattern} +} + +func (rule *Regex) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive } // Validate checks if full string matches regex -func (rule *Regex) Validate(value string) (bool, error) { +func (rule *Regex) Validate(value string, fail bool) (bool, error) { return regexp.MatchString(fmt.Sprintf("^%s$", rule.getRegexPattern()), value) } @@ -56,9 +65,9 @@ func (rule *Regex) getRegexPattern() string { rule.RLock() defer rule.RUnlock() - return rule.RegexPattern + return rule.regexPattern } func (rule *Regex) GetErrorMessage() string { - return fmt.Sprintf("%s (%s)", rule.GetName(), rule.getRegexPattern()) + return fmt.Sprintf("%s:%s", rule.GetName(), rule.getRegexPattern()) } diff --git a/internal/rule/regex_test.go b/internal/rule/regex_test.go index b0103b2d..2f66bc86 100644 --- a/internal/rule/regex_test.go +++ b/internal/rule/regex_test.go @@ -1,6 +1,9 @@ package rule -import "testing" +import ( + "errors" + "testing" +) func TestRegex(t *testing.T) { var tests = []*struct { @@ -23,13 +26,13 @@ func TestRegex(t *testing.T) { // parameters err := rule.SetParameters(test.params) - if err != nil && err != test.err { - t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) return } // validate - res, err := rule.Validate(test.value) + res, err := rule.Validate(test.value, true) if err != nil && err != test.err { t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) diff --git a/internal/rule/rule.go b/internal/rule/rule.go index 5f394422..b761262e 100644 --- a/internal/rule/rule.go +++ b/internal/rule/rule.go @@ -3,6 +3,7 @@ package rule var RulesIndex = map[string]Rule{ "lowercase": new(Lowercase).Init(), "regex": new(Regex).Init(), + "exists": new(Exists).Init(), "camelcase": new(CamelCase).Init(), "pascalcase": new(PascalCase).Init(), @@ -15,6 +16,7 @@ var RulesIndex = map[string]Rule{ var Rules = map[string]Rule{ "lowercase": RulesIndex["lowercase"], "regex": RulesIndex["regex"], + "exists": RulesIndex["exists"], "camelcase": RulesIndex["camelcase"], "camelCase": RulesIndex["camelcase"], @@ -40,6 +42,7 @@ type Rule interface { GetName() string SetParameters(params []string) error GetParameters() []string - Validate(value string) (bool, error) + GetExclusive() bool + Validate(value string, fail bool) (bool, error) GetErrorMessage() string } diff --git a/internal/rule/screamingsnakecase.go b/internal/rule/screamingsnakecase.go index b5d837a6..f6d848a7 100644 --- a/internal/rule/screamingsnakecase.go +++ b/internal/rule/screamingsnakecase.go @@ -6,22 +6,24 @@ import ( ) type ScreamingSnakeCase struct { - Name string + name string + exclusive bool *sync.RWMutex } func (rule *ScreamingSnakeCase) Init() Rule { - rule.Name = "screamingsnakecase" + rule.name = "screamingsnakecase" + rule.exclusive = false rule.RWMutex = new(sync.RWMutex) return rule } func (rule *ScreamingSnakeCase) GetName() string { - rule.Lock() - defer rule.Unlock() + rule.RLock() + defer rule.RUnlock() - return rule.Name + return rule.name } func (rule *ScreamingSnakeCase) SetParameters(params []string) error { @@ -32,9 +34,16 @@ func (rule *ScreamingSnakeCase) GetParameters() []string { return nil } +func (rule *ScreamingSnakeCase) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive +} + // Validate checks if string is screaming sneak case // false if rune is no uppercase letter, digit or _ -func (rule *ScreamingSnakeCase) Validate(value string) (bool, error) { +func (rule *ScreamingSnakeCase) Validate(value string, fail bool) (bool, error) { for _, c := range value { if c == 95 || unicode.IsDigit(c) { // 95 => _ continue diff --git a/internal/rule/screamingsnakecase_test.go b/internal/rule/screamingsnakecase_test.go index d0fdeb06..13a30b6c 100644 --- a/internal/rule/screamingsnakecase_test.go +++ b/internal/rule/screamingsnakecase_test.go @@ -1,6 +1,7 @@ package rule import ( + "errors" "testing" ) @@ -25,10 +26,10 @@ func TestScreamingSnakeCase(t *testing.T) { var i = 0 for _, test := range tests { - res, err := rule.Validate(test.value) + res, err := rule.Validate(test.value, true) - if err != nil && err != test.err { - t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) return } diff --git a/internal/rule/snakecase.go b/internal/rule/snakecase.go index 31aa5265..21b3247a 100644 --- a/internal/rule/snakecase.go +++ b/internal/rule/snakecase.go @@ -6,22 +6,24 @@ import ( ) type SnakeCase struct { - Name string + name string + exclusive bool *sync.RWMutex } func (rule *SnakeCase) Init() Rule { - rule.Name = "snakecase" + rule.name = "snakecase" + rule.exclusive = false rule.RWMutex = new(sync.RWMutex) return rule } func (rule *SnakeCase) GetName() string { - rule.Lock() - defer rule.Unlock() + rule.RLock() + defer rule.RUnlock() - return rule.Name + return rule.name } func (rule *SnakeCase) SetParameters(params []string) error { @@ -32,9 +34,16 @@ func (rule *SnakeCase) GetParameters() []string { return nil } +func (rule *SnakeCase) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive +} + // Validate checks if string is sneak case // false if rune is no lowercase letter, digit or _ -func (rule *SnakeCase) Validate(value string) (bool, error) { +func (rule *SnakeCase) Validate(value string, fail bool) (bool, error) { for _, c := range value { if c == 95 || unicode.IsDigit(c) { // 95 => _ continue diff --git a/internal/rule/snakecase_test.go b/internal/rule/snakecase_test.go index eb9158f0..2fdee8b7 100644 --- a/internal/rule/snakecase_test.go +++ b/internal/rule/snakecase_test.go @@ -1,6 +1,9 @@ package rule -import "testing" +import ( + "errors" + "testing" +) func TestSnakeCase(t *testing.T) { var rule = new(SnakeCase).Init() @@ -21,10 +24,10 @@ func TestSnakeCase(t *testing.T) { var i = 0 for _, test := range tests { - res, err := rule.Validate(test.value) + res, err := rule.Validate(test.value, true) - if err != nil && err != test.err { - t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) return } From fe62af3a8ecde3ffd7b4d5e8cef3d9dd82442c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 23 Apr 2024 16:36:55 +0200 Subject: [PATCH 018/117] feat: error output format json ext support --- cmd/ls_lint/main.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/ls_lint/main.go b/cmd/ls_lint/main.go index 65ff7f76..49fc3fc9 100644 --- a/cmd/ls_lint/main.go +++ b/cmd/ls_lint/main.go @@ -122,11 +122,15 @@ func main() { switch *flagErrorOutputFormat { case "json": - var errIndex = make(map[string][]string, len(lslintLinter.GetErrors())) + var errIndex = make(map[string]map[string][]string, len(lslintLinter.GetErrors())) for _, ruleErr := range lslintLinter.GetErrors() { - errIndex[ruleErr.GetPath()] = make([]string, len(ruleErr.GetRules())) + if _, ok := errIndex[ruleErr.GetPath()]; !ok { + errIndex[ruleErr.GetPath()] = make(map[string][]string) + } + + errIndex[ruleErr.GetPath()][ruleErr.GetExt()] = make([]string, len(ruleErr.GetRules())) for i, ruleErrMessages := range ruleErr.GetRules() { - errIndex[ruleErr.GetPath()][i] = ruleErrMessages.GetErrorMessage() + errIndex[ruleErr.GetPath()][ruleErr.GetExt()][i] = ruleErrMessages.GetErrorMessage() } } From 2236997aecdc7215d7bed1fa0f0eb2fffc077b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 13 Jun 2024 18:38:55 +0200 Subject: [PATCH 019/117] feat: files for non exists rules --- .ls-lint.yml | 2 +- BUILD.bazel | 18 ++++++++++++++++++ WORKSPACE | 4 ++-- cmd/ls_lint/main.go | 25 +++++++------------------ internal/linter/linter.go | 19 ++++++++++++------- internal/linter/linter_test.go | 11 ++++++++++- 6 files changed, 50 insertions(+), 29 deletions(-) diff --git a/.ls-lint.yml b/.ls-lint.yml index d8b08629..037586aa 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -16,7 +16,7 @@ ls: '**': .js: exists:1-3 | snakecase .go: snake_case - .html: PascalCase + .html: snake_case ignore: - .git diff --git a/BUILD.bazel b/BUILD.bazel index e7756f1f..5a842aa4 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -2,8 +2,26 @@ load("@bazel_gazelle//:def.bzl", "gazelle") load("@io_bazel_rules_go//go:def.bzl", "TOOLS_NOGO", "nogo") # gazelle:prefix github.com/loeffel-io/ls-lint/v2 +# gazelle:exclude vendor +# gazelle:exclude .idea gazelle(name = "gazelle") +gazelle( + name = "gazelle_update_repos", + args = [ + "--from_file=go.mod", + "--to_macro=repositories.bzl%go_repositories", + "--prune", + ], + command = "update-repos", +) + +gazelle( + name = "gazelle_fix_diff", + command = "fix", + extra_args = ["--mode=diff"], +) + config_setting( name = "darwin_arm64", constraint_values = [ diff --git a/WORKSPACE b/WORKSPACE index 6a0224ec..d179e9f0 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -37,8 +37,8 @@ http_archive( url = "https://github.com/aspect-build/rules_js/releases/download/v1.41.2/rules_js-v1.41.2.tar.gz", ) -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") ############################################################ # custom repositories ###################################### @@ -55,7 +55,7 @@ go_repositories() go_rules_dependencies() -go_register_toolchains(version = "1.22.1") +go_register_toolchains(version = "1.22.4") ############################################################ # gazelle ################################################## diff --git a/cmd/ls_lint/main.go b/cmd/ls_lint/main.go index 49fc3fc9..8b45c690 100644 --- a/cmd/ls_lint/main.go +++ b/cmd/ls_lint/main.go @@ -10,14 +10,12 @@ import ( "github.com/loeffel-io/ls-lint/v2/internal/linter" "github.com/loeffel-io/ls-lint/v2/internal/rule" "gopkg.in/yaml.v3" - "io/fs" "log" "maps" "os" "runtime" "slices" "strings" - "testing/fstest" ) var Version = "dev" @@ -61,22 +59,13 @@ func main() { flagConfig = _flag.Config{".ls-lint.yml"} } - var args = flags.Args() - var filesystem fs.FS - switch len(args) { - case 0: - filesystem = os.DirFS(*flagWorkdir) - default: - var mapFilesystem = make(fstest.MapFS, len(args)) - for _, file := range args { - var fileInfo os.FileInfo - if fileInfo, err = os.Stat(fmt.Sprintf("%s/%s", *flagWorkdir, file)); err != nil { - log.Fatal(err) - } - - mapFilesystem[file] = &fstest.MapFile{Mode: fileInfo.Mode()} + var filesystem = os.DirFS(*flagWorkdir) + var files map[string]struct{} + if len(flags.Args()[0:]) > 0 { + files = make(map[string]struct{}, len(flags.Args()[0:])) + for _, file := range flags.Args()[0:] { + files[file] = struct{}{} } - filesystem = mapFilesystem } var lslintConfig = config.NewConfig(make(config.Ls), make([]string, 0)) @@ -105,7 +94,7 @@ func main() { make([]*rule.Error, 0), ) - if err = lslintLinter.Run(filesystem, *flagDebug); err != nil { + if err = lslintLinter.Run(filesystem, files, *flagDebug); err != nil { log.Fatal(err) } diff --git a/internal/linter/linter.go b/internal/linter/linter.go index a052b4eb..50f34bef 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -59,7 +59,7 @@ func (linter *Linter) AddError(error *rule.Error) { linter.errors = append(linter.errors, error) } -func (linter *Linter) validateDir(index config.RuleIndex, path string) error { +func (linter *Linter) validateDir(index config.RuleIndex, path string, validate bool) error { var g = new(errgroup.Group) var rulesNonExclusiveCount int8 @@ -102,7 +102,7 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string) error { return err } - if rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { + if !validate || rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { return nil } @@ -116,7 +116,7 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string) error { return nil } -func (linter *Linter) validateFile(index config.RuleIndex, path string) error { +func (linter *Linter) validateFile(index config.RuleIndex, path string, validate bool) error { var ext string var g = new(errgroup.Group) @@ -177,7 +177,7 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string) error { return err } - if rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { + if !validate || rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { return nil } @@ -191,7 +191,7 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string) error { return nil } -func (linter *Linter) Run(filesystem fs.FS, debug bool) (err error) { +func (linter *Linter) Run(filesystem fs.FS, files map[string]struct{}, debug bool) (err error) { var index config.RuleIndex var ignoreIndex = linter.config.GetIgnoreIndex() @@ -279,13 +279,18 @@ func (linter *Linter) Run(filesystem fs.FS, debug bool) (err error) { return fmt.Errorf("%s not found", path) } + var validate = len(files) == 0 + if _, fileExists := files[path]; !validate { + validate = fileExists + } + if info.IsDir() { if debug { fmt.Printf("lint dir: %s\n", path) linter.GetStatistics().AddDir() } - return linter.validateDir(index, path) + return linter.validateDir(index, path, validate) } if debug { @@ -293,7 +298,7 @@ func (linter *Linter) Run(filesystem fs.FS, debug bool) (err error) { linter.GetStatistics().AddFile() } - return linter.validateFile(index, path) + return linter.validateFile(index, path, validate) }); err != nil { return err } diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index 4d494788..53f8c9d4 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -23,6 +23,7 @@ func TestLinter_Run(t *testing.T) { var tests = []*struct { description string filesystem fs.FS + files map[string]struct{} linter *Linter expectedErr error expectedStatistic *debug.Statistic @@ -38,6 +39,7 @@ func TestLinter_Run(t *testing.T) { "test": &fstest.MapFile{Mode: fs.ModeDir}, "test/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, }, + files: nil, linter: NewLinter( ".", config.NewConfig( @@ -75,6 +77,7 @@ func TestLinter_Run(t *testing.T) { filesystem: fstest.MapFS{ "not-snake-case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, + files: nil, linter: NewLinter( ".", config.NewConfig( @@ -127,6 +130,7 @@ func TestLinter_Run(t *testing.T) { "src/c/c/packages": &fstest.MapFile{Mode: fs.ModeDir}, "src/c/c/packages/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, + files: nil, linter: NewLinter( ".", config.NewConfig( @@ -181,6 +185,7 @@ func TestLinter_Run(t *testing.T) { "src/c/c/packages": &fstest.MapFile{Mode: fs.ModeDir}, "src/c/c/packages/not-snake-case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, + files: nil, linter: NewLinter( ".", config.NewConfig( @@ -248,6 +253,7 @@ func TestLinter_Run(t *testing.T) { "src/c/c/packages/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, "src/c/d/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, + files: nil, linter: NewLinter( ".", config.NewConfig( @@ -308,6 +314,7 @@ func TestLinter_Run(t *testing.T) { "node_modules": &fstest.MapFile{Mode: fs.ModeDir}, "node_modules/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, + files: nil, linter: NewLinter( ".", config.NewConfig( @@ -363,6 +370,7 @@ func TestLinter_Run(t *testing.T) { "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, }, + files: nil, linter: NewLinter( ".", config.NewConfig( @@ -417,6 +425,7 @@ func TestLinter_Run(t *testing.T) { "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, }, + files: nil, linter: NewLinter( ".", config.NewConfig( @@ -490,7 +499,7 @@ func TestLinter_Run(t *testing.T) { for _, test := range tests { fmt.Printf("Run test %d (%s)\n", i, test.description) - var err = test.linter.Run(test.filesystem, true) + var err = test.linter.Run(test.filesystem, test.files, true) if !errors.Is(err, test.expectedErr) { t.Errorf("Test %d (%s) failed with unmatched error value - %v", i, test.description, err) From 16c31a0a07f5437a15a64d99c920b42945811b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20L=C3=B6ffel?= Date: Tue, 9 Jul 2024 11:12:15 +0200 Subject: [PATCH 020/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68e48f17..5a8d387e 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ An extremely fast directory and filename linter - Bring some structure to your p - Minimal setup with simple rules managed in one single or multiple `.ls-lint.yml` files - Works for directory and file names - all extensions supported - full unicode support - Incredibly fast - lints thousands of files and directories in milliseconds -- Support for Windows, MacOS and Linux + NPM Package + [GitHub Action](https://github.com/ls-lint/action) + [Homebrew](https://formulae.brew.sh/formula/ls-lint) + & Docker Image +- Support for Windows, MacOS and Linux + NPM Package + [GitHub Action](https://github.com/ls-lint/action) + [Homebrew](https://formulae.brew.sh/formula/ls-lint) + Docker - Almost zero third-party dependencies (only [go-yaml](https://github.com/go-yaml/yaml) and [doublestar](https://github.com/bmatcuk/doublestar)) From 92db1bd2fb5e7e2a85f92bd627ee29456c21fe16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 00:02:33 +0200 Subject: [PATCH 021/117] fix: exists only to current directory --- .ls-lint.yml | 18 +++++++-------- cmd/ls_lint/main.go | 37 +++++++++++++++++++++++++----- deployments/test.json | 0 internal/config/config.go | 9 ++++---- internal/config/config_test.go | 2 +- internal/linter/linter.go | 42 ++++++++++++++++++++++++++-------- internal/linter/linter_test.go | 2 +- internal/rule/error.go | 8 +++++++ peter/Affe.ts | 0 peter/Atest.js | 0 peter/Gurke.ts | 0 peter/test.js | 0 peter/test.vue | 0 peter/test/test.vue | 0 peter/youtube.js | 0 15 files changed, 87 insertions(+), 31 deletions(-) create mode 100644 deployments/test.json create mode 100644 peter/Affe.ts create mode 100644 peter/Atest.js create mode 100644 peter/Gurke.ts create mode 100644 peter/test.js create mode 100644 peter/test.vue create mode 100644 peter/test/test.vue create mode 100644 peter/youtube.js diff --git a/.ls-lint.yml b/.ls-lint.yml index 037586aa..e6edd232 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -1,5 +1,6 @@ ls: - .dir: snake_case + .dir: snake_case # | exists:1 + .json: exists:1 .bzl: snake_case .sh: snake_case .bazel: SCREAMING_SNAKE_CASE @@ -7,16 +8,15 @@ ls: .yaml: snake_case .js: snake_case - peter: + deployments: .dir: exists:1 - .*: PascalCase | exists:1 - .js: exists:2 | snake_case - .go: exists:0 + .json: exists:1 - '**': - .js: exists:1-3 | snakecase - .go: snake_case - .html: snake_case + peter: + .dir: exists:1 + .*: PascalCase | exists:2 + .js: exists:3 | snake_case + .vue: exists:1 ignore: - .git diff --git a/cmd/ls_lint/main.go b/cmd/ls_lint/main.go index 8b45c690..55102532 100644 --- a/cmd/ls_lint/main.go +++ b/cmd/ls_lint/main.go @@ -13,6 +13,7 @@ import ( "log" "maps" "os" + "path/filepath" "runtime" "slices" "strings" @@ -60,14 +61,28 @@ func main() { } var filesystem = os.DirFS(*flagWorkdir) - var files map[string]struct{} + var paths map[string]map[string]struct{} if len(flags.Args()[0:]) > 0 { - files = make(map[string]struct{}, len(flags.Args()[0:])) - for _, file := range flags.Args()[0:] { - files[file] = struct{}{} + paths = make(map[string]map[string]struct{}, len(flags.Args()[0:])) + for _, path := range flags.Args()[0:] { + if _, err = os.Stat(fmt.Sprintf("%s/%s", *flagWorkdir, path)); err != nil { + if os.IsNotExist(err) { + continue + } + + log.Fatal(err) + } + + dir := filepath.Dir(path) + if _, ok := paths[dir]; !ok { + paths[dir] = make(map[string]struct{}) + } + paths[dir][path] = struct{}{} } } + log.Printf("%+v", paths) + var lslintConfig = config.NewConfig(make(config.Ls), make([]string, 0)) for _, c := range flagConfig { var tmpLslintConfig = config.NewConfig(nil, nil) @@ -94,7 +109,7 @@ func main() { make([]*rule.Error, 0), ) - if err = lslintLinter.Run(filesystem, files, *flagDebug); err != nil { + if err = lslintLinter.Run(filesystem, paths, *flagDebug); err != nil { log.Fatal(err) } @@ -136,10 +151,20 @@ func main() { var ruleMessages []string for _, errRule := range ruleErr.GetRules() { + if !ruleErr.IsDir() && errRule.GetName() == "exists" { + continue + } + ruleMessages = append(ruleMessages, errRule.GetErrorMessage()) } - if _, err = fmt.Fprintf(writer, "%s failed for `%s` rules: %s\n", ruleErr.GetPath(), ruleErr.GetExt(), strings.Join(ruleMessages, " | ")); err != nil { + path := ruleErr.GetPath() + + if path == "" { + path = "." + } + + if _, err = fmt.Fprintf(writer, "%s failed for `%s` rules: %s\n", path, ruleErr.GetExt(), strings.Join(ruleMessages, " | ")); err != nil { log.Fatal(err) } } diff --git a/deployments/test.json b/deployments/test.json new file mode 100644 index 00000000..e69de29b diff --git a/internal/config/config.go b/internal/config/config.go index a742cfea..da03144d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -69,16 +69,17 @@ func (config *Config) ShouldIgnore(ignoreIndex map[string]bool, path string) boo return false } -func (config *Config) GetConfig(index RuleIndex, path string) map[string][]rule.Rule { +func (config *Config) GetConfig(index RuleIndex, path string) (string, map[string][]rule.Rule) { dirs := strings.Split(path, sep) for i := len(dirs); i >= 0; i-- { - if find, exists := index[strings.Join(dirs[:i], sep)]; exists { - return find + var dir = strings.Join(dirs[:i], sep) + if find, exists := index[dir]; exists { + return dir, find } } - return nil + return "", nil } func (config *Config) GetIndex(list Ls) (RuleIndex, error) { diff --git a/internal/config/config_test.go b/internal/config/config_test.go index d977186f..0fc3f52d 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -50,7 +50,7 @@ func TestGetConfig(t *testing.T) { var i = 0 for _, test := range tests { - res := test.config.GetConfig(test.index, test.path) + _, res := test.config.GetConfig(test.index, test.path) if !reflect.DeepEqual(res, test.expected) { t.Errorf("Test %d failed with unmatched return value - %+v", i, res) diff --git a/internal/linter/linter.go b/internal/linter/linter.go index 50f34bef..d56274e4 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -8,6 +8,7 @@ import ( "github.com/loeffel-io/ls-lint/v2/internal/rule" "golang.org/x/sync/errgroup" "io/fs" + "log" "math" "path/filepath" "strings" @@ -60,15 +61,21 @@ func (linter *Linter) AddError(error *rule.Error) { } func (linter *Linter) validateDir(index config.RuleIndex, path string, validate bool) error { + if !validate { + return nil + } + var g = new(errgroup.Group) var rulesNonExclusiveCount int8 var rulesNonExclusiveError int8 var rulesMutex = new(sync.Mutex) - rules := linter.config.GetConfig(index, path) + _, rules := linter.config.GetConfig(index, path) + basename := filepath.Base(path) + // here is the problem why exists not work for ls root directory if basename == linter.root { return nil } @@ -102,7 +109,7 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate return err } - if !validate || rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { + if rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { return nil } @@ -125,7 +132,12 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate var rulesMutex = new(sync.Mutex) exts := strings.Split(filepath.Base(path), extSep)[1:] - rules := linter.config.GetConfig(index, path) + indexDir, rules := linter.config.GetConfig(index, path) + + var pathDir string + if pathDir = filepath.Dir(path); pathDir == "." { + pathDir = "" + } var n = len(exts) var maxCombinations = int(math.Pow(2, float64(n))) // 2^N combinations @@ -149,7 +161,15 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate if _, exists := rules[ext]; exists { for _, ruleFile := range rules[ext] { + if !validate && ruleFile.GetName() != "exists" { + continue + } + g.Go(func() error { + if ruleFile.GetName() == "exists" && pathDir != indexDir { + return nil + } + valid, err := ruleFile.Validate(withoutExt, ruleFile.GetName() != "exists") if err != nil { @@ -191,11 +211,9 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate return nil } -func (linter *Linter) Run(filesystem fs.FS, files map[string]struct{}, debug bool) (err error) { - var index config.RuleIndex - var ignoreIndex = linter.config.GetIgnoreIndex() - +func (linter *Linter) Run(filesystem fs.FS, paths map[string]map[string]struct{}, debug bool) (err error) { // create index + var index config.RuleIndex if index, err = linter.config.GetIndex(linter.config.GetLs()); err != nil { return err } @@ -206,6 +224,7 @@ func (linter *Linter) Run(filesystem fs.FS, files map[string]struct{}, debug boo } // glob ignore index + var ignoreIndex = linter.config.GetIgnoreIndex() if err = glob.Index(filesystem, ignoreIndex, true); err != nil { return err } @@ -279,9 +298,9 @@ func (linter *Linter) Run(filesystem fs.FS, files map[string]struct{}, debug boo return fmt.Errorf("%s not found", path) } - var validate = len(files) == 0 - if _, fileExists := files[path]; !validate { - validate = fileExists + var validate = len(paths) == 0 + if _, ok := paths[filepath.Dir(path)][path]; !validate { + validate = ok } if info.IsDir() { @@ -310,6 +329,8 @@ func (linter *Linter) Run(filesystem fs.FS, files map[string]struct{}, debug boo continue } + log.Printf("%s - %+v - %+v", path, ext, r) + var valid bool if valid, err = r.Validate("", true); err != nil { return err @@ -318,6 +339,7 @@ func (linter *Linter) Run(filesystem fs.FS, files map[string]struct{}, debug boo if !valid { linter.AddError(&rule.Error{ Path: path, + Dir: true, Ext: ext, Rules: []rule.Rule{r}, RWMutex: new(sync.RWMutex), diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index 53f8c9d4..c15b526c 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -23,7 +23,7 @@ func TestLinter_Run(t *testing.T) { var tests = []*struct { description string filesystem fs.FS - files map[string]struct{} + files map[string]map[string]struct{} linter *Linter expectedErr error expectedStatistic *debug.Statistic diff --git a/internal/rule/error.go b/internal/rule/error.go index f867c45f..70c4591c 100644 --- a/internal/rule/error.go +++ b/internal/rule/error.go @@ -4,6 +4,7 @@ import "sync" type Error struct { Path string + Dir bool Ext string Rules []Rule *sync.RWMutex @@ -16,6 +17,13 @@ func (error *Error) GetPath() string { return error.Path } +func (error *Error) IsDir() bool { + error.RLock() + defer error.RUnlock() + + return error.Dir +} + func (error *Error) GetExt() string { error.RLock() defer error.RUnlock() diff --git a/peter/Affe.ts b/peter/Affe.ts new file mode 100644 index 00000000..e69de29b diff --git a/peter/Atest.js b/peter/Atest.js new file mode 100644 index 00000000..e69de29b diff --git a/peter/Gurke.ts b/peter/Gurke.ts new file mode 100644 index 00000000..e69de29b diff --git a/peter/test.js b/peter/test.js new file mode 100644 index 00000000..e69de29b diff --git a/peter/test.vue b/peter/test.vue new file mode 100644 index 00000000..e69de29b diff --git a/peter/test/test.vue b/peter/test/test.vue new file mode 100644 index 00000000..e69de29b diff --git a/peter/youtube.js b/peter/youtube.js new file mode 100644 index 00000000..e69de29b From c79f0f5ea5263eb9e022fc467b5af50a5d30b548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 09:38:44 +0200 Subject: [PATCH 022/117] feat: fix directory exists --- .ls-lint.yml | 3 +++ internal/linter/linter.go | 15 ++++++++++----- internal/rule/exists.go | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.ls-lint.yml b/.ls-lint.yml index e6edd232..9845b8e0 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -18,6 +18,9 @@ ls: .js: exists:3 | snake_case .vue: exists:1 + '*': + .dir: exists:1 + ignore: - .git - .github diff --git a/internal/linter/linter.go b/internal/linter/linter.go index d56274e4..b88977b8 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -8,7 +8,6 @@ import ( "github.com/loeffel-io/ls-lint/v2/internal/rule" "golang.org/x/sync/errgroup" "io/fs" - "log" "math" "path/filepath" "strings" @@ -71,11 +70,15 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate var rulesNonExclusiveError int8 var rulesMutex = new(sync.Mutex) - _, rules := linter.config.GetConfig(index, path) + indexDir, rules := linter.config.GetConfig(index, path) + + var pathDir string + if pathDir = path; pathDir == "." { + pathDir = "" + } basename := filepath.Base(path) - // here is the problem why exists not work for ls root directory if basename == linter.root { return nil } @@ -86,6 +89,10 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate for _, ruleDir := range rules[dir] { g.Go(func() error { + if ruleDir.GetName() == "exists" && pathDir != indexDir { + return nil + } + valid, err := ruleDir.Validate(basename, ruleDir.GetName() != "exists") if err != nil { @@ -329,8 +336,6 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]map[string]struct{} continue } - log.Printf("%s - %+v - %+v", path, ext, r) - var valid bool if valid, err = r.Validate("", true); err != nil { return err diff --git a/internal/rule/exists.go b/internal/rule/exists.go index aef54ef3..b870611a 100644 --- a/internal/rule/exists.go +++ b/internal/rule/exists.go @@ -137,7 +137,7 @@ func (rule *Exists) incrementCount() { func (rule *Exists) GetErrorMessage() string { if rule.getMin() == rule.getMax() { - return fmt.Sprintf("%s:%d", rule.GetName(), rule.getMin()) + return fmt.Sprintf("%s:%d (debug: %d)", rule.GetName(), rule.getMin(), rule.getCount()) } return fmt.Sprintf("%s:%d-%d", rule.GetName(), rule.getMin(), rule.getMax()) From 21d81e82c8e843309d3a2401ba07dc565b8773ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 14:34:09 +0200 Subject: [PATCH 023/117] feat: selected files/dirs --- .ls-lint.yml | 3 +- cmd/ls_lint/main.go | 21 ++-------- internal/linter/linter.go | 72 +++++++++++++++++++++++++--------- internal/linter/linter_test.go | 20 +++++----- peter/{Affe.ts => affe.ts} | 0 5 files changed, 69 insertions(+), 47 deletions(-) rename peter/{Affe.ts => affe.ts} (100%) diff --git a/.ls-lint.yml b/.ls-lint.yml index 9845b8e0..7f1133ca 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -1,6 +1,6 @@ ls: .dir: snake_case # | exists:1 - .json: exists:1 + .json: exists:2 .bzl: snake_case .sh: snake_case .bazel: SCREAMING_SNAKE_CASE @@ -20,6 +20,7 @@ ls: '*': .dir: exists:1 + .vue: snake_case ignore: - .git diff --git a/cmd/ls_lint/main.go b/cmd/ls_lint/main.go index 55102532..ed260672 100644 --- a/cmd/ls_lint/main.go +++ b/cmd/ls_lint/main.go @@ -13,7 +13,6 @@ import ( "log" "maps" "os" - "path/filepath" "runtime" "slices" "strings" @@ -61,28 +60,14 @@ func main() { } var filesystem = os.DirFS(*flagWorkdir) - var paths map[string]map[string]struct{} + var paths map[string]struct{} if len(flags.Args()[0:]) > 0 { - paths = make(map[string]map[string]struct{}, len(flags.Args()[0:])) + paths = make(map[string]struct{}, len(flags.Args()[0:])) for _, path := range flags.Args()[0:] { - if _, err = os.Stat(fmt.Sprintf("%s/%s", *flagWorkdir, path)); err != nil { - if os.IsNotExist(err) { - continue - } - - log.Fatal(err) - } - - dir := filepath.Dir(path) - if _, ok := paths[dir]; !ok { - paths[dir] = make(map[string]struct{}) - } - paths[dir][path] = struct{}{} + paths[path] = struct{}{} } } - log.Printf("%+v", paths) - var lslintConfig = config.NewConfig(make(config.Ls), make([]string, 0)) for _, c := range flagConfig { var tmpLslintConfig = config.NewConfig(nil, nil) diff --git a/internal/linter/linter.go b/internal/linter/linter.go index b88977b8..2719b941 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -59,9 +59,11 @@ func (linter *Linter) AddError(error *rule.Error) { linter.errors = append(linter.errors, error) } -func (linter *Linter) validateDir(index config.RuleIndex, path string, validate bool) error { +func (linter *Linter) validateDir(index config.RuleIndex, path string, validate bool) (string, string, error) { + indexDir, rules := linter.config.GetConfig(index, path) + if !validate { - return nil + return indexDir, dir, nil } var g = new(errgroup.Group) @@ -70,8 +72,6 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate var rulesNonExclusiveError int8 var rulesMutex = new(sync.Mutex) - indexDir, rules := linter.config.GetConfig(index, path) - var pathDir string if pathDir = path; pathDir == "." { pathDir = "" @@ -80,11 +80,11 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate basename := filepath.Base(path) if basename == linter.root { - return nil + return indexDir, dir, nil } if _, exists := rules[dir]; !exists { - return nil + return indexDir, dir, nil } for _, ruleDir := range rules[dir] { @@ -113,11 +113,11 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate } if err := g.Wait(); err != nil { - return err + return indexDir, dir, err } if rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { - return nil + return indexDir, dir, nil } linter.AddError(&rule.Error{ @@ -127,10 +127,10 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate RWMutex: new(sync.RWMutex), }) - return nil + return indexDir, dir, nil } -func (linter *Linter) validateFile(index config.RuleIndex, path string, validate bool) error { +func (linter *Linter) validateFile(index config.RuleIndex, path string, validate bool) (string, string, error) { var ext string var g = new(errgroup.Group) @@ -201,24 +201,30 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate } if err := g.Wait(); err != nil { - return err + return indexDir, ext, err } if !validate || rulesNonExclusiveError == 0 || rulesNonExclusiveError != rulesNonExclusiveCount { - return nil + return indexDir, ext, nil } linter.AddError(&rule.Error{ Path: path, + Dir: false, Ext: ext, Rules: rules[ext], RWMutex: new(sync.RWMutex), }) - return nil + return indexDir, ext, nil } -func (linter *Linter) Run(filesystem fs.FS, paths map[string]map[string]struct{}, debug bool) (err error) { +func (linter *Linter) Run(filesystem fs.FS, paths map[string]struct{}, debug bool) (err error) { + var pathsIndex map[string]map[string]struct{} = nil + if len(paths) > 0 { + pathsIndex = make(map[string]map[string]struct{}) + } + // create index var index config.RuleIndex if index, err = linter.config.GetIndex(linter.config.GetLs()); err != nil { @@ -274,7 +280,7 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]map[string]struct{} defer func() { fmt.Printf("-----------------------------\nstatistics\n-----------------------------\n") fmt.Printf("time: %d µs / %d ms\n", time.Since(linter.GetStatistics().Start).Microseconds(), time.Since(linter.GetStatistics().Start).Milliseconds()) - fmt.Printf("files: %d\n", linter.GetStatistics().Files) + fmt.Printf("paths: %d\n", linter.GetStatistics().Files) fmt.Printf("file skips: %d\n", linter.GetStatistics().FileSkips) fmt.Printf("dirs: %d\n", linter.GetStatistics().Dirs) fmt.Printf("dir skips: %d\n", linter.GetStatistics().DirSkips) @@ -305,8 +311,9 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]map[string]struct{} return fmt.Errorf("%s not found", path) } + var indexDir, ext string var validate = len(paths) == 0 - if _, ok := paths[filepath.Dir(path)][path]; !validate { + if _, ok := paths[path]; !validate { validate = ok } @@ -316,7 +323,19 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]map[string]struct{} linter.GetStatistics().AddDir() } - return linter.validateDir(index, path, validate) + if indexDir, ext, err = linter.validateDir(index, path, validate); err != nil { + return err + } + + if pathsIndex != nil && validate { + if _, ok := pathsIndex[indexDir]; !ok { + pathsIndex[indexDir] = make(map[string]struct{}) + } + + pathsIndex[indexDir][ext] = struct{}{} + } + + return nil } if debug { @@ -324,13 +343,30 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]map[string]struct{} linter.GetStatistics().AddFile() } - return linter.validateFile(index, path, validate) + if indexDir, ext, err = linter.validateFile(index, path, validate); err != nil { + return err + } + + if pathsIndex != nil && validate { + if _, ok := pathsIndex[indexDir]; !ok { + pathsIndex[indexDir] = make(map[string]struct{}) + } + + pathsIndex[indexDir][ext] = struct{}{} + } + + return nil }); err != nil { return err } + // validate exists for path, pathIndex := range index { for ext, rules := range pathIndex { + if _, ok := pathsIndex[path][ext]; pathsIndex != nil && !ok { + continue + } + for _, r := range rules { if r.GetName() != "exists" { continue diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index c15b526c..37107d33 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -23,7 +23,7 @@ func TestLinter_Run(t *testing.T) { var tests = []*struct { description string filesystem fs.FS - files map[string]map[string]struct{} + paths map[string]struct{} linter *Linter expectedErr error expectedStatistic *debug.Statistic @@ -39,7 +39,7 @@ func TestLinter_Run(t *testing.T) { "test": &fstest.MapFile{Mode: fs.ModeDir}, "test/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, }, - files: nil, + paths: nil, linter: NewLinter( ".", config.NewConfig( @@ -77,7 +77,7 @@ func TestLinter_Run(t *testing.T) { filesystem: fstest.MapFS{ "not-snake-case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, - files: nil, + paths: nil, linter: NewLinter( ".", config.NewConfig( @@ -130,7 +130,7 @@ func TestLinter_Run(t *testing.T) { "src/c/c/packages": &fstest.MapFile{Mode: fs.ModeDir}, "src/c/c/packages/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, - files: nil, + paths: nil, linter: NewLinter( ".", config.NewConfig( @@ -185,7 +185,7 @@ func TestLinter_Run(t *testing.T) { "src/c/c/packages": &fstest.MapFile{Mode: fs.ModeDir}, "src/c/c/packages/not-snake-case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, - files: nil, + paths: nil, linter: NewLinter( ".", config.NewConfig( @@ -253,7 +253,7 @@ func TestLinter_Run(t *testing.T) { "src/c/c/packages/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, "src/c/d/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, - files: nil, + paths: nil, linter: NewLinter( ".", config.NewConfig( @@ -314,7 +314,7 @@ func TestLinter_Run(t *testing.T) { "node_modules": &fstest.MapFile{Mode: fs.ModeDir}, "node_modules/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, }, - files: nil, + paths: nil, linter: NewLinter( ".", config.NewConfig( @@ -370,7 +370,7 @@ func TestLinter_Run(t *testing.T) { "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, }, - files: nil, + paths: nil, linter: NewLinter( ".", config.NewConfig( @@ -425,7 +425,7 @@ func TestLinter_Run(t *testing.T) { "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, }, - files: nil, + paths: nil, linter: NewLinter( ".", config.NewConfig( @@ -499,7 +499,7 @@ func TestLinter_Run(t *testing.T) { for _, test := range tests { fmt.Printf("Run test %d (%s)\n", i, test.description) - var err = test.linter.Run(test.filesystem, test.files, true) + var err = test.linter.Run(test.filesystem, test.paths, true) if !errors.Is(err, test.expectedErr) { t.Errorf("Test %d (%s) failed with unmatched error value - %v", i, test.description, err) diff --git a/peter/Affe.ts b/peter/affe.ts similarity index 100% rename from peter/Affe.ts rename to peter/affe.ts From d455a786904c8dc73376b1d45f83de75ee501b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 14:38:02 +0200 Subject: [PATCH 024/117] chore: remove debug --- .ls-lint.yml | 2 +- internal/rule/exists.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ls-lint.yml b/.ls-lint.yml index 7f1133ca..badff277 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -1,6 +1,6 @@ ls: .dir: snake_case # | exists:1 - .json: exists:2 + .json: exists:1-2 .bzl: snake_case .sh: snake_case .bazel: SCREAMING_SNAKE_CASE diff --git a/internal/rule/exists.go b/internal/rule/exists.go index b870611a..aef54ef3 100644 --- a/internal/rule/exists.go +++ b/internal/rule/exists.go @@ -137,7 +137,7 @@ func (rule *Exists) incrementCount() { func (rule *Exists) GetErrorMessage() string { if rule.getMin() == rule.getMax() { - return fmt.Sprintf("%s:%d (debug: %d)", rule.GetName(), rule.getMin(), rule.getCount()) + return fmt.Sprintf("%s:%d", rule.GetName(), rule.getMin()) } return fmt.Sprintf("%s:%d-%d", rule.GetName(), rule.getMin(), rule.getMax()) From aa1433df00319d74e86679fce6def370e717b552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 14:50:34 +0200 Subject: [PATCH 025/117] fix: error output format json --- .ls-lint.yml | 4 ++-- cmd/ls_lint/main.go | 29 ++++++++++++++++++----------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.ls-lint.yml b/.ls-lint.yml index badff277..7b10074c 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -1,6 +1,6 @@ ls: .dir: snake_case # | exists:1 - .json: exists:1-2 + .json: exists:2 .bzl: snake_case .sh: snake_case .bazel: SCREAMING_SNAKE_CASE @@ -13,7 +13,7 @@ ls: .json: exists:1 peter: - .dir: exists:1 + .dir: exists:2 .*: PascalCase | exists:2 .js: exists:3 | snake_case .vue: exists:1 diff --git a/cmd/ls_lint/main.go b/cmd/ls_lint/main.go index ed260672..b8513064 100644 --- a/cmd/ls_lint/main.go +++ b/cmd/ls_lint/main.go @@ -113,13 +113,21 @@ func main() { case "json": var errIndex = make(map[string]map[string][]string, len(lslintLinter.GetErrors())) for _, ruleErr := range lslintLinter.GetErrors() { - if _, ok := errIndex[ruleErr.GetPath()]; !ok { - errIndex[ruleErr.GetPath()] = make(map[string][]string) + path := ruleErr.GetPath() + if path == "" { + path = "." } - errIndex[ruleErr.GetPath()][ruleErr.GetExt()] = make([]string, len(ruleErr.GetRules())) - for i, ruleErrMessages := range ruleErr.GetRules() { - errIndex[ruleErr.GetPath()][ruleErr.GetExt()][i] = ruleErrMessages.GetErrorMessage() + if _, ok := errIndex[path]; !ok { + errIndex[path] = make(map[string][]string) + } + + for _, errRule := range ruleErr.GetRules() { + if !ruleErr.IsDir() && errRule.GetName() == "exists" { + continue + } + + errIndex[path][ruleErr.GetExt()] = append(errIndex[path][ruleErr.GetExt()], errRule.GetErrorMessage()) } } @@ -135,6 +143,11 @@ func main() { for _, ruleErr := range lslintLinter.GetErrors() { var ruleMessages []string + path := ruleErr.GetPath() + if path == "" { + path = "." + } + for _, errRule := range ruleErr.GetRules() { if !ruleErr.IsDir() && errRule.GetName() == "exists" { continue @@ -143,12 +156,6 @@ func main() { ruleMessages = append(ruleMessages, errRule.GetErrorMessage()) } - path := ruleErr.GetPath() - - if path == "" { - path = "." - } - if _, err = fmt.Fprintf(writer, "%s failed for `%s` rules: %s\n", path, ruleErr.GetExt(), strings.Join(ruleMessages, " | ")); err != nil { log.Fatal(err) } From faf29830961c59fa570fdfaa9c3ce6d56bce3eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 18:14:37 +0200 Subject: [PATCH 026/117] feat: add some more tests --- internal/linter/linter_test.go | 175 ++++++++++++++++++++++++++++++--- 1 file changed, 160 insertions(+), 15 deletions(-) diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index 37107d33..557aa5e5 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -361,14 +361,18 @@ func TestLinter_Run(t *testing.T) { { description: "exists", filesystem: fstest.MapFS{ - "snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, - "kebab-case.png": &fstest.MapFile{Mode: fs.ModePerm}, - "node_modules": &fstest.MapFile{Mode: fs.ModeDir}, - "node_modules/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, - "test": &fstest.MapFile{Mode: fs.ModeDir}, - "test/sub": &fstest.MapFile{Mode: fs.ModeDir}, - "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, - "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, + "snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "kebab-case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "node_modules": &fstest.MapFile{Mode: fs.ModeDir}, + "node_modules/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/subsub": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub/subsub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/subsub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/subsub/service.test.ts": &fstest.MapFile{Mode: fs.ModePerm}, }, paths: nil, linter: NewLinter( @@ -382,6 +386,9 @@ func TestLinter_Run(t *testing.T) { "test/*": config.Ls{ ".*": "exists:0", ".png": "snake_case | exists:1-2", + "*": config.Ls{ + ".*.ts": "snake_case | exists:1", + }, }, "not_exists": config.Ls{ ".dir": "exists:0", @@ -405,9 +412,71 @@ func TestLinter_Run(t *testing.T) { expectedErr: nil, expectedStatistic: &debug.Statistic{ Start: start, - Files: 3, + Files: 6, FileSkips: 1, - Dirs: 3, + Dirs: 4, + DirSkips: 1, + RWMutex: new(sync.RWMutex), + }, + expectedErrors: []*rule.Error{}, + }, + { + description: "exists with paths", + filesystem: fstest.MapFS{ + "snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "kebab-case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "node_modules": &fstest.MapFile{Mode: fs.ModeDir}, + "node_modules/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/subsub": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub/subsub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/subsub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, + }, + paths: map[string]struct{}{ + "snake_case.png": {}, + "test": {}, + "test/sub/snake_case_123.png": {}, + }, + linter: NewLinter( + ".", + config.NewConfig( + config.Ls{ + ".png": "snake_case | exists:1", + "test": config.Ls{ + ".dir": "exists:1", + }, + "test/*": config.Ls{ + ".*": "exists:0", + ".png": "snake_case | exists:1-2", + }, + "not_exists": config.Ls{ + ".dir": "exists:0", + }, + }, + []string{ + "node_modules", + "kebab-case.png", + }, + ), + &debug.Statistic{ + Start: start, + Files: 0, + FileSkips: 0, + Dirs: 0, + DirSkips: 0, + RWMutex: new(sync.RWMutex), + }, + []*rule.Error{}, + ), + expectedErr: nil, + expectedStatistic: &debug.Statistic{ + Start: start, + Files: 5, + FileSkips: 1, + Dirs: 4, DirSkips: 1, RWMutex: new(sync.RWMutex), }, @@ -422,6 +491,7 @@ func TestLinter_Run(t *testing.T) { "node_modules/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, "test": &fstest.MapFile{Mode: fs.ModeDir}, "test/sub": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub/test.ts": &fstest.MapFile{Mode: fs.ModePerm}, "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, }, @@ -460,7 +530,7 @@ func TestLinter_Run(t *testing.T) { expectedErr: nil, expectedStatistic: &debug.Statistic{ Start: start, - Files: 3, + Files: 4, FileSkips: 1, Dirs: 3, DirSkips: 1, @@ -483,6 +553,14 @@ func TestLinter_Run(t *testing.T) { }, RWMutex: new(sync.RWMutex), }, + { + Path: "test/sub", + Ext: ".*", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, { Path: "", Ext: ".png", @@ -493,6 +571,73 @@ func TestLinter_Run(t *testing.T) { }, }, }, + { + description: "exists with paths and bypass error", + filesystem: fstest.MapFS{ + "snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "kebab-case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "node_modules": &fstest.MapFile{Mode: fs.ModeDir}, + "node_modules/snake_case.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub": &fstest.MapFile{Mode: fs.ModeDir}, + "test/sub/test.ts": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, + "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, + }, + paths: map[string]struct{}{ + "test/sub/test.ts": {}, + }, + linter: NewLinter( + ".", + config.NewConfig( + config.Ls{ + ".png": "snake_case | exists:2", + "test": config.Ls{ + ".dir": "exists:1", + }, + "test/*": config.Ls{ + ".*": "exists:0", + ".png": "snake_case | exists:3-5", + }, + "not_exists": config.Ls{ + ".dir": "exists:1", + }, + }, + []string{ + "node_modules", + "kebab-case.png", + }, + ), + &debug.Statistic{ + Start: start, + Files: 0, + FileSkips: 0, + Dirs: 0, + DirSkips: 0, + RWMutex: new(sync.RWMutex), + }, + []*rule.Error{}, + ), + expectedErr: nil, + expectedStatistic: &debug.Statistic{ + Start: start, + Files: 4, + FileSkips: 1, + Dirs: 3, + DirSkips: 1, + RWMutex: new(sync.RWMutex), + }, + expectedErrors: []*rule.Error{ + { + Path: "test/sub", + Ext: ".*", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + }, + }, } var i = 0 @@ -518,12 +663,12 @@ func TestLinter_Run(t *testing.T) { } if len(test.linter.GetErrors()) > 0 { - slices.SortStableFunc(test.linter.GetErrors(), func(a, b *rule.Error) int { - return cmp.Compare(strings.ToLower(a.GetPath()), strings.ToLower(b.GetPath())) + slices.SortFunc(test.linter.GetErrors(), func(a, b *rule.Error) int { + return cmp.Compare(strings.ToLower(a.GetPath()+a.GetExt()), strings.ToLower(b.GetPath()+b.GetExt())) }) - slices.SortStableFunc(test.expectedErrors, func(a, b *rule.Error) int { - return cmp.Compare(strings.ToLower(a.GetPath()), strings.ToLower(b.GetPath())) + slices.SortFunc(test.expectedErrors, func(a, b *rule.Error) int { + return cmp.Compare(strings.ToLower(a.GetPath()+a.GetExt()), strings.ToLower(b.GetPath()+b.GetExt())) }) } From 457659fc71e1f84842028f13bdfcd6b869c1afa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 18:15:36 +0200 Subject: [PATCH 027/117] feat: use stable sort func --- internal/linter/linter_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index 557aa5e5..14c2161b 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -663,11 +663,11 @@ func TestLinter_Run(t *testing.T) { } if len(test.linter.GetErrors()) > 0 { - slices.SortFunc(test.linter.GetErrors(), func(a, b *rule.Error) int { + slices.SortStableFunc(test.linter.GetErrors(), func(a, b *rule.Error) int { return cmp.Compare(strings.ToLower(a.GetPath()+a.GetExt()), strings.ToLower(b.GetPath()+b.GetExt())) }) - slices.SortFunc(test.expectedErrors, func(a, b *rule.Error) int { + slices.SortStableFunc(test.expectedErrors, func(a, b *rule.Error) int { return cmp.Compare(strings.ToLower(a.GetPath()+a.GetExt()), strings.ToLower(b.GetPath()+b.GetExt())) }) } From b23184d1857b8e100e578f26e751b7f787ef5593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 18:20:34 +0200 Subject: [PATCH 028/117] feat: extend tests --- .ls-lint.yml | 2 +- internal/linter/linter_test.go | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.ls-lint.yml b/.ls-lint.yml index 7b10074c..2637265d 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -13,7 +13,7 @@ ls: .json: exists:1 peter: - .dir: exists:2 + .dir: exists:2 | PascalCase .*: PascalCase | exists:2 .js: exists:3 | snake_case .vue: exists:1 diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index 14c2161b..c3170972 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -585,6 +585,7 @@ func TestLinter_Run(t *testing.T) { "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, }, paths: map[string]struct{}{ + "snake_case.png": {}, "test/sub/test.ts": {}, }, linter: NewLinter( @@ -598,6 +599,10 @@ func TestLinter_Run(t *testing.T) { "test/*": config.Ls{ ".*": "exists:0", ".png": "snake_case | exists:3-5", + ".vue": "exists:1", + "*": config.Ls{ + ".dir": "exists:1 | snake_case", + }, }, "not_exists": config.Ls{ ".dir": "exists:1", @@ -636,6 +641,14 @@ func TestLinter_Run(t *testing.T) { }, RWMutex: new(sync.RWMutex), }, + { + Path: "", + Ext: ".png", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, }, }, } From 6158e85422eccda8e79213e391b9a65835175987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 18:45:08 +0200 Subject: [PATCH 029/117] chore: review improvements --- internal/linter/linter.go | 2 +- internal/rule/exists.go | 20 ++++++++++---------- internal/rule/exists_test.go | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/linter/linter.go b/internal/linter/linter.go index 2719b941..b629bb50 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -279,7 +279,7 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]struct{}, debug boo if debug { defer func() { fmt.Printf("-----------------------------\nstatistics\n-----------------------------\n") - fmt.Printf("time: %d µs / %d ms\n", time.Since(linter.GetStatistics().Start).Microseconds(), time.Since(linter.GetStatistics().Start).Milliseconds()) + fmt.Printf("time: %s\n", time.Since(linter.GetStatistics().Start).Truncate(time.Microsecond).String()) fmt.Printf("paths: %d\n", linter.GetStatistics().Files) fmt.Printf("file skips: %d\n", linter.GetStatistics().FileSkips) fmt.Printf("dirs: %d\n", linter.GetStatistics().Dirs) diff --git a/internal/rule/exists.go b/internal/rule/exists.go index aef54ef3..fddbe966 100644 --- a/internal/rule/exists.go +++ b/internal/rule/exists.go @@ -11,9 +11,9 @@ import ( type Exists struct { name string exclusive bool - min int16 - max int16 - count int16 + min uint16 + max uint16 + count uint16 *sync.RWMutex } @@ -60,8 +60,8 @@ func (rule *Exists) SetParameters(params []string) error { return err.(*strconv.NumError).Err } - rule.min = int16(value) - rule.max = int16(value) + rule.min = uint16(value) + rule.max = uint16(value) return nil } @@ -78,8 +78,8 @@ func (rule *Exists) SetParameters(params []string) error { return err.(*strconv.NumError).Err } - rule.min = int16(minValue) - rule.max = int16(maxValue) + rule.min = uint16(minValue) + rule.max = uint16(maxValue) return nil } @@ -107,21 +107,21 @@ func (rule *Exists) Validate(value string, fail bool) (bool, error) { return rule.getCount() >= rule.getMin() && rule.getCount() <= rule.getMax(), nil } -func (rule *Exists) getMin() int16 { +func (rule *Exists) getMin() uint16 { rule.RLock() defer rule.RUnlock() return rule.min } -func (rule *Exists) getMax() int16 { +func (rule *Exists) getMax() uint16 { rule.RLock() defer rule.RUnlock() return rule.max } -func (rule *Exists) getCount() int16 { +func (rule *Exists) getCount() uint16 { rule.RLock() defer rule.RUnlock() diff --git a/internal/rule/exists_test.go b/internal/rule/exists_test.go index 56c3de70..356548b0 100644 --- a/internal/rule/exists_test.go +++ b/internal/rule/exists_test.go @@ -47,7 +47,7 @@ func TestExists_Validate(t *testing.T) { var tests = []*struct { rule *Exists fail bool - count int16 + count uint16 valid bool err error }{ From fb0e68a0cd6e10ade5fdb5dc553a1d8ae210c0ba Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:46:36 +0000 Subject: [PATCH 030/117] chore(deps): update dependency bazel to v7.2.1 --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index ef09838c..468c41f9 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.1.1 \ No newline at end of file +7.2.1 \ No newline at end of file From b4443608e2a054e09f9dc3d6ac8a63af8eee2f8a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:46:39 +0000 Subject: [PATCH 031/117] chore(deps): update dependency bazel_gazelle to v0.37.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index d179e9f0..fb043522 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,10 +15,10 @@ http_archive( http_archive( name = "bazel_gazelle", - sha256 = "75df288c4b31c81eb50f51e2e14f4763cb7548daae126817247064637fd9ea62", + sha256 = "d76bf7a60fd8b050444090dfa2837a4eaf9829e1165618ee35dceca5cbdf58d5", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz", ], ) From c1a378dfbb7250e0647932ee43e3cd288b84c41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 11 Jul 2024 18:50:20 +0200 Subject: [PATCH 032/117] chore: clean up e2e --- .ls-lint.yml | 18 ++---------------- deployments/test.json | 0 peter/Atest.js | 0 peter/Gurke.ts | 0 peter/affe.ts | 0 peter/test.js | 0 peter/test.vue | 0 peter/test/test.vue | 0 peter/youtube.js | 0 9 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 deployments/test.json delete mode 100644 peter/Atest.js delete mode 100644 peter/Gurke.ts delete mode 100644 peter/affe.ts delete mode 100644 peter/test.js delete mode 100644 peter/test.vue delete mode 100644 peter/test/test.vue delete mode 100644 peter/youtube.js diff --git a/.ls-lint.yml b/.ls-lint.yml index 2637265d..e3b6704d 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -1,6 +1,6 @@ ls: - .dir: snake_case # | exists:1 - .json: exists:2 + .dir: snake_case + .json: snake_case .bzl: snake_case .sh: snake_case .bazel: SCREAMING_SNAKE_CASE @@ -8,20 +8,6 @@ ls: .yaml: snake_case .js: snake_case - deployments: - .dir: exists:1 - .json: exists:1 - - peter: - .dir: exists:2 | PascalCase - .*: PascalCase | exists:2 - .js: exists:3 | snake_case - .vue: exists:1 - - '*': - .dir: exists:1 - .vue: snake_case - ignore: - .git - .github diff --git a/deployments/test.json b/deployments/test.json deleted file mode 100644 index e69de29b..00000000 diff --git a/peter/Atest.js b/peter/Atest.js deleted file mode 100644 index e69de29b..00000000 diff --git a/peter/Gurke.ts b/peter/Gurke.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/peter/affe.ts b/peter/affe.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/peter/test.js b/peter/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/peter/test.vue b/peter/test.vue deleted file mode 100644 index e69de29b..00000000 diff --git a/peter/test/test.vue b/peter/test/test.vue deleted file mode 100644 index e69de29b..00000000 diff --git a/peter/youtube.js b/peter/youtube.js deleted file mode 100644 index e69de29b..00000000 From 823041d08a40d43dfd5793f5fb277a99ed5924a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:09:22 +0000 Subject: [PATCH 033/117] chore(deps): update gcr.io/bazel-public/bazel docker digest to 65e2c7b --- .github/workflows/bazel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 924b0b74..268b5308 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: gcr.io/bazel-public/bazel@sha256:7430f06fff16c8860ec486e1fe0e8c7ce0209a78605b97f41ab6e17f1330ab85 + image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -24,7 +24,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest container: - image: gcr.io/bazel-public/bazel@sha256:7430f06fff16c8860ec486e1fe0e8c7ce0209a78605b97f41ab6e17f1330ab85 + image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: GH_TOKEN: ${{ github.token }} From f53c9c2e1fa6b636358825a26133303d5dce2998 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:09:32 +0000 Subject: [PATCH 034/117] chore(deps): update dependency aspect_rules_js to v1.42.3 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index fb043522..e66e6668 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -32,9 +32,9 @@ http_archive( http_archive( name = "aspect_rules_js", - sha256 = "bc9b4a01ef8eb050d8a7a050eedde8ffb1e45a56b0e4094e26f06c17d5fcf1d5", - strip_prefix = "rules_js-1.41.2", - url = "https://github.com/aspect-build/rules_js/releases/download/v1.41.2/rules_js-v1.41.2.tar.gz", + sha256 = "2cfb3875e1231cefd3fada6774f2c0c5a99db0070e0e48ea398acbff7c6c765b", + strip_prefix = "rules_js-1.42.3", + url = "https://github.com/aspect-build/rules_js/releases/download/v1.42.3/rules_js-v1.42.3.tar.gz", ) load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") From 2905de077b41f61ea8b7d31f756693e67f6a1caa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:09:40 +0000 Subject: [PATCH 035/117] chore(deps): update dependency com_github_cli_cli_linux_amd64 to v2.52.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index fb043522..ec619865 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -121,10 +121,10 @@ http_archive( http_archive( name = "com_github_cli_cli_linux_amd64", build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "1c477e2562aca8679b0219569f0482f1975de76daca8ba307892c1787338a28d", - strip_prefix = "gh_2.48.0_linux_amd64", + sha256 = "3ea6ed8b2585f406a064cecd7e1501e58f56c8e7ca764ae1f3483d1b8ed68826", + strip_prefix = "gh_2.52.0_linux_amd64", urls = [ - "https://github.com/cli/cli/releases/download/v2.48.0/gh_2.48.0_linux_amd64.tar.gz", + "https://github.com/cli/cli/releases/download/v2.52.0/gh_2.52.0_linux_amd64.tar.gz", ], ) From 31d082652a522f888903970360b0323bb959f6aa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:09:51 +0000 Subject: [PATCH 036/117] chore(deps): update dependency rules_pkg to v1 --- WORKSPACE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index fb043522..dc755b8f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -24,9 +24,9 @@ http_archive( http_archive( name = "rules_pkg", - sha256 = "d250924a2ecc5176808fc4c25d5cf5e9e79e6346d79d5ab1c493e289e722d1d0", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", urls = [ - "https://github.com/bazelbuild/rules_pkg/releases/download/0.10.1/rules_pkg-0.10.1.tar.gz", + "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", ], ) From 65768d9656c80ff1ad5fd701c21dfea64619e394 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:26:32 +0000 Subject: [PATCH 037/117] chore(deps): update dependency com_github_uutils_coreutils_linux_amd64 to v0.0.27 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index dc755b8f..dbdf865d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -145,9 +145,9 @@ http_archive( http_archive( name = "com_github_uutils_coreutils_linux_amd64", build_file_content = """exports_files(["coreutils"])""", - sha256 = "bbb38c5b8dd8e3a69745120a50b7ca75f516e755899fa1bbd2ce57c706faff58", - strip_prefix = "coreutils-0.0.23-x86_64-unknown-linux-gnu", + sha256 = "02ab80c97c7849dc12b30ea21b3c06cf238563e9dbd72343373275871f4cb043", + strip_prefix = "coreutils-0.0.27-x86_64-unknown-linux-gnu", urls = [ - "https://github.com/uutils/coreutils/releases/download/0.0.23/coreutils-0.0.23-x86_64-unknown-linux-gnu.tar.gz", + "https://github.com/uutils/coreutils/releases/download/0.0.27/coreutils-0.0.27-x86_64-unknown-linux-gnu.tar.gz", ], ) From 5ab168bffd20cee7ee5b5da9194665575c0341f1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:26:38 +0000 Subject: [PATCH 038/117] chore(deps): update dependency com_github_cli_cli_darwin_arm64 to v2.52.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index dc755b8f..094bfd78 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -111,10 +111,10 @@ register_jq_toolchains() http_archive( name = "com_github_cli_cli_darwin_arm64", build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "b82c847c581d2540d12f266d7f1739274c5cccbfc0dffe236739ac5cc21acc91", - strip_prefix = "gh_2.48.0_macOS_arm64", + sha256 = "c1c445154ede0707caf24907c74a153e397635ebb35887e73937de1f00dc0c10", + strip_prefix = "gh_2.52.0_macOS_arm64", urls = [ - "https://github.com/cli/cli/releases/download/v2.48.0/gh_2.48.0_macOS_arm64.zip", + "https://github.com/cli/cli/releases/download/v2.52.0/gh_2.52.0_macOS_arm64.zip", ], ) From 6d29d664ec8cd32200c3693b2322806bb2f26875 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:26:45 +0000 Subject: [PATCH 039/117] chore(deps): update dependency io_bazel_rules_go to v0.48.1 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index dc755b8f..1f141639 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -6,10 +6,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", - sha256 = "80a98277ad1311dacd837f9b16db62887702e9f1d1c4c9f796d0121a46c8e184", + sha256 = "b2038e2de2cace18f032249cb4bb0048abf583a36369fa98f687af1b3f880b26", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip", ], ) From c0c32b31fa54066ae5b4398c2c6d9b8eca2aff16 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:27:16 +0000 Subject: [PATCH 040/117] chore(deps): update dependency com_github_uutils_coreutils_darwin_arm64 to v0.0.27 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index de70db93..203d34ae 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -135,10 +135,10 @@ http_archive( http_archive( name = "com_github_uutils_coreutils_darwin_arm64", build_file_content = """exports_files(["coreutils"])""", - sha256 = "28ff74b232b1b570db2c2fa8e5fe3e8109ef3f74ebeced11a29304e20f501791", - strip_prefix = "coreutils-0.0.23-aarch64-apple-darwin", + sha256 = "06301e1a027cfac2c22309a89023a47de94208bb673511f8f507059eb0eaf1ae", + strip_prefix = "coreutils-0.0.27-aarch64-apple-darwin", urls = [ - "https://github.com/uutils/coreutils/releases/download/0.0.23/coreutils-0.0.23-aarch64-apple-darwin.tar.gz", # only amd64 + "https://github.com/uutils/coreutils/releases/download/0.0.27/coreutils-0.0.27-aarch64-apple-darwin.tar.gz", # only amd64 ], ) From 8d0a661920f3a2ee7c571df9ed1cb12cc1efb4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Fri, 12 Jul 2024 09:00:48 +0200 Subject: [PATCH 041/117] fix: copy rule --- MODULE.bazel.lock | 1658 ++------------------------- WORKSPACE | 2 +- internal/config/config.go | 15 +- internal/glob/BUILD.bazel | 1 + internal/glob/glob.go | 50 +- internal/linter/linter.go | 4 +- internal/linter/linter_test.go | 70 +- internal/rule/camelcase.go | 4 + internal/rule/exists.go | 19 +- internal/rule/kebabcase.go | 4 + internal/rule/lowercase.go | 4 + internal/rule/pascalcase.go | 4 + internal/rule/pointcase.go | 4 + internal/rule/regex.go | 11 + internal/rule/rule.go | 1 + internal/rule/screamingsnakecase.go | 4 + internal/rule/snakecase.go | 4 + 17 files changed, 248 insertions(+), 1611 deletions(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 11bf37a4..f5cd5310 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,1042 +1,70 @@ { - "lockFileVersion": 6, - "moduleFileHash": "0e3e315145ac7ee7a4e0ac825e1c5e03c068ec1254dd42c3caaecb27e921dc4d", - "flags": { - "cmdRegistries": [ - "https://bcr.bazel.build/" - ], - "cmdModuleOverrides": {}, - "allowedYankedVersions": [], - "envVarAllowedYankedVersions": "", - "ignoreDevDependency": false, - "directDependenciesMode": "WARNING", - "compatibilityMode": "ERROR" - }, - "localOverrideHashes": { - "bazel_tools": "1ae69322ac3823527337acf02016e8ee95813d8d356f47060255b8956fa642f0" - }, - "moduleDepGraph": { - "": { - "name": "", - "version": "", - "key": "", - "repoName": "", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - } - }, - "bazel_tools@_": { - "name": "bazel_tools", - "version": "", - "key": "bazel_tools@_", - "repoName": "bazel_tools", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [ - "@local_config_cc_toolchains//:all", - "@local_config_sh//:local_sh_toolchain" - ], - "extensionUsages": [ - { - "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", - "extensionName": "cc_configure_extension", - "usingModule": "bazel_tools@_", - "location": { - "file": "@@bazel_tools//:MODULE.bazel", - "line": 18, - "column": 29 - }, - "imports": { - "local_config_cc": "local_config_cc", - "local_config_cc_toolchains": "local_config_cc_toolchains" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - }, - { - "extensionBzlFile": "@bazel_tools//tools/osx:xcode_configure.bzl", - "extensionName": "xcode_configure_extension", - "usingModule": "bazel_tools@_", - "location": { - "file": "@@bazel_tools//:MODULE.bazel", - "line": 22, - "column": 32 - }, - "imports": { - "local_config_xcode": "local_config_xcode" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - }, - { - "extensionBzlFile": "@rules_java//java:extensions.bzl", - "extensionName": "toolchains", - "usingModule": "bazel_tools@_", - "location": { - "file": "@@bazel_tools//:MODULE.bazel", - "line": 25, - "column": 32 - }, - "imports": { - "local_jdk": "local_jdk", - "remote_java_tools": "remote_java_tools", - "remote_java_tools_linux": "remote_java_tools_linux", - "remote_java_tools_windows": "remote_java_tools_windows", - "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", - "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - }, - { - "extensionBzlFile": "@bazel_tools//tools/sh:sh_configure.bzl", - "extensionName": "sh_configure_extension", - "usingModule": "bazel_tools@_", - "location": { - "file": "@@bazel_tools//:MODULE.bazel", - "line": 36, - "column": 39 - }, - "imports": { - "local_config_sh": "local_config_sh" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - }, - { - "extensionBzlFile": "@bazel_tools//tools/test:extensions.bzl", - "extensionName": "remote_coverage_tools_extension", - "usingModule": "bazel_tools@_", - "location": { - "file": "@@bazel_tools//:MODULE.bazel", - "line": 40, - "column": 48 - }, - "imports": { - "remote_coverage_tools": "remote_coverage_tools" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - }, - { - "extensionBzlFile": "@bazel_tools//tools/android:android_extensions.bzl", - "extensionName": "remote_android_tools_extensions", - "usingModule": "bazel_tools@_", - "location": { - "file": "@@bazel_tools//:MODULE.bazel", - "line": 43, - "column": 42 - }, - "imports": { - "android_gmaven_r8": "android_gmaven_r8", - "android_tools": "android_tools" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - }, - { - "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", - "extensionName": "buildozer_binary", - "usingModule": "bazel_tools@_", - "location": { - "file": "@@bazel_tools//:MODULE.bazel", - "line": 47, - "column": 33 - }, - "imports": { - "buildozer_binary": "buildozer_binary" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - } - ], - "deps": { - "rules_cc": "rules_cc@0.0.9", - "rules_java": "rules_java@7.4.0", - "rules_license": "rules_license@0.0.7", - "rules_proto": "rules_proto@5.3.0-21.7", - "rules_python": "rules_python@0.22.1", - "buildozer": "buildozer@6.4.0.2", - "platforms": "platforms@0.0.7", - "com_google_protobuf": "protobuf@21.7", - "zlib": "zlib@1.3", - "build_bazel_apple_support": "apple_support@1.5.0", - "local_config_platform": "local_config_platform@_" - } - }, - "local_config_platform@_": { - "name": "local_config_platform", - "version": "", - "key": "local_config_platform@_", - "repoName": "local_config_platform", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "platforms": "platforms@0.0.7", - "bazel_tools": "bazel_tools@_" - } - }, - "rules_cc@0.0.9": { - "name": "rules_cc", - "version": "0.0.9", - "key": "rules_cc@0.0.9", - "repoName": "rules_cc", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [ - "@local_config_cc_toolchains//:all" - ], - "extensionUsages": [ - { - "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", - "extensionName": "cc_configure_extension", - "usingModule": "rules_cc@0.0.9", - "location": { - "file": "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel", - "line": 9, - "column": 29 - }, - "imports": { - "local_config_cc_toolchains": "local_config_cc_toolchains" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - } - ], - "deps": { - "platforms": "platforms@0.0.7", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz" - ], - "integrity": "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8=", - "strip_prefix": "rules_cc-0.0.9", - "remote_patches": { - "https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch": "sha256-mM+qzOI0SgAdaJBlWOSMwMPKpaA9b7R37Hj/tp5bb4g=" - }, - "remote_patch_strip": 0 - } - } - }, - "rules_java@7.4.0": { - "name": "rules_java", - "version": "7.4.0", - "key": "rules_java@7.4.0", - "repoName": "rules_java", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [ - "//toolchains:all", - "@local_jdk//:runtime_toolchain_definition", - "@local_jdk//:bootstrap_runtime_toolchain_definition", - "@remotejdk11_linux_toolchain_config_repo//:all", - "@remotejdk11_linux_aarch64_toolchain_config_repo//:all", - "@remotejdk11_linux_ppc64le_toolchain_config_repo//:all", - "@remotejdk11_linux_s390x_toolchain_config_repo//:all", - "@remotejdk11_macos_toolchain_config_repo//:all", - "@remotejdk11_macos_aarch64_toolchain_config_repo//:all", - "@remotejdk11_win_toolchain_config_repo//:all", - "@remotejdk11_win_arm64_toolchain_config_repo//:all", - "@remotejdk17_linux_toolchain_config_repo//:all", - "@remotejdk17_linux_aarch64_toolchain_config_repo//:all", - "@remotejdk17_linux_ppc64le_toolchain_config_repo//:all", - "@remotejdk17_linux_s390x_toolchain_config_repo//:all", - "@remotejdk17_macos_toolchain_config_repo//:all", - "@remotejdk17_macos_aarch64_toolchain_config_repo//:all", - "@remotejdk17_win_toolchain_config_repo//:all", - "@remotejdk17_win_arm64_toolchain_config_repo//:all", - "@remotejdk21_linux_toolchain_config_repo//:all", - "@remotejdk21_linux_aarch64_toolchain_config_repo//:all", - "@remotejdk21_macos_toolchain_config_repo//:all", - "@remotejdk21_macos_aarch64_toolchain_config_repo//:all", - "@remotejdk21_win_toolchain_config_repo//:all" - ], - "extensionUsages": [ - { - "extensionBzlFile": "@rules_java//java:extensions.bzl", - "extensionName": "toolchains", - "usingModule": "rules_java@7.4.0", - "location": { - "file": "https://bcr.bazel.build/modules/rules_java/7.4.0/MODULE.bazel", - "line": 19, - "column": 27 - }, - "imports": { - "remote_java_tools": "remote_java_tools", - "remote_java_tools_linux": "remote_java_tools_linux", - "remote_java_tools_windows": "remote_java_tools_windows", - "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", - "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64", - "local_jdk": "local_jdk", - "remotejdk11_linux_toolchain_config_repo": "remotejdk11_linux_toolchain_config_repo", - "remotejdk11_linux_aarch64_toolchain_config_repo": "remotejdk11_linux_aarch64_toolchain_config_repo", - "remotejdk11_linux_ppc64le_toolchain_config_repo": "remotejdk11_linux_ppc64le_toolchain_config_repo", - "remotejdk11_linux_s390x_toolchain_config_repo": "remotejdk11_linux_s390x_toolchain_config_repo", - "remotejdk11_macos_toolchain_config_repo": "remotejdk11_macos_toolchain_config_repo", - "remotejdk11_macos_aarch64_toolchain_config_repo": "remotejdk11_macos_aarch64_toolchain_config_repo", - "remotejdk11_win_toolchain_config_repo": "remotejdk11_win_toolchain_config_repo", - "remotejdk11_win_arm64_toolchain_config_repo": "remotejdk11_win_arm64_toolchain_config_repo", - "remotejdk17_linux_toolchain_config_repo": "remotejdk17_linux_toolchain_config_repo", - "remotejdk17_linux_aarch64_toolchain_config_repo": "remotejdk17_linux_aarch64_toolchain_config_repo", - "remotejdk17_linux_ppc64le_toolchain_config_repo": "remotejdk17_linux_ppc64le_toolchain_config_repo", - "remotejdk17_linux_s390x_toolchain_config_repo": "remotejdk17_linux_s390x_toolchain_config_repo", - "remotejdk17_macos_toolchain_config_repo": "remotejdk17_macos_toolchain_config_repo", - "remotejdk17_macos_aarch64_toolchain_config_repo": "remotejdk17_macos_aarch64_toolchain_config_repo", - "remotejdk17_win_toolchain_config_repo": "remotejdk17_win_toolchain_config_repo", - "remotejdk17_win_arm64_toolchain_config_repo": "remotejdk17_win_arm64_toolchain_config_repo", - "remotejdk21_linux_toolchain_config_repo": "remotejdk21_linux_toolchain_config_repo", - "remotejdk21_linux_aarch64_toolchain_config_repo": "remotejdk21_linux_aarch64_toolchain_config_repo", - "remotejdk21_macos_toolchain_config_repo": "remotejdk21_macos_toolchain_config_repo", - "remotejdk21_macos_aarch64_toolchain_config_repo": "remotejdk21_macos_aarch64_toolchain_config_repo", - "remotejdk21_win_toolchain_config_repo": "remotejdk21_win_toolchain_config_repo" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - } - ], - "deps": { - "platforms": "platforms@0.0.7", - "rules_cc": "rules_cc@0.0.9", - "bazel_skylib": "bazel_skylib@1.3.0", - "rules_proto": "rules_proto@5.3.0-21.7", - "rules_license": "rules_license@0.0.7", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/rules_java/releases/download/7.4.0/rules_java-7.4.0.tar.gz" - ], - "integrity": "sha256-l27wi0nJKXQfIBeQ5Z44B8cq2B9CjIvJU82+/1/tFes=", - "strip_prefix": "", - "remote_patches": {}, - "remote_patch_strip": 0 - } - } - }, - "rules_license@0.0.7": { - "name": "rules_license", - "version": "0.0.7", - "key": "rules_license@0.0.7", - "repoName": "rules_license", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz" - ], - "integrity": "sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=", - "strip_prefix": "", - "remote_patches": {}, - "remote_patch_strip": 0 - } - } - }, - "rules_proto@5.3.0-21.7": { - "name": "rules_proto", - "version": "5.3.0-21.7", - "key": "rules_proto@5.3.0-21.7", - "repoName": "rules_proto", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "bazel_skylib": "bazel_skylib@1.3.0", - "com_google_protobuf": "protobuf@21.7", - "rules_cc": "rules_cc@0.0.9", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz" - ], - "integrity": "sha256-3D+yBqLLNEG0heseQjFlsjEjWh6psDG0Qzz3vB+kYN0=", - "strip_prefix": "rules_proto-5.3.0-21.7", - "remote_patches": {}, - "remote_patch_strip": 0 - } - } - }, - "rules_python@0.22.1": { - "name": "rules_python", - "version": "0.22.1", - "key": "rules_python@0.22.1", - "repoName": "rules_python", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [ - "@bazel_tools//tools/python:autodetecting_toolchain" - ], - "extensionUsages": [ - { - "extensionBzlFile": "@rules_python//python/extensions/private:internal_deps.bzl", - "extensionName": "internal_deps", - "usingModule": "rules_python@0.22.1", - "location": { - "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel", - "line": 14, - "column": 30 - }, - "imports": { - "pypi__build": "pypi__build", - "pypi__click": "pypi__click", - "pypi__colorama": "pypi__colorama", - "pypi__importlib_metadata": "pypi__importlib_metadata", - "pypi__installer": "pypi__installer", - "pypi__more_itertools": "pypi__more_itertools", - "pypi__packaging": "pypi__packaging", - "pypi__pep517": "pypi__pep517", - "pypi__pip": "pypi__pip", - "pypi__pip_tools": "pypi__pip_tools", - "pypi__setuptools": "pypi__setuptools", - "pypi__tomli": "pypi__tomli", - "pypi__wheel": "pypi__wheel", - "pypi__zipp": "pypi__zipp", - "pypi__coverage_cp310_aarch64-apple-darwin": "pypi__coverage_cp310_aarch64-apple-darwin", - "pypi__coverage_cp310_aarch64-unknown-linux-gnu": "pypi__coverage_cp310_aarch64-unknown-linux-gnu", - "pypi__coverage_cp310_x86_64-apple-darwin": "pypi__coverage_cp310_x86_64-apple-darwin", - "pypi__coverage_cp310_x86_64-unknown-linux-gnu": "pypi__coverage_cp310_x86_64-unknown-linux-gnu", - "pypi__coverage_cp311_aarch64-unknown-linux-gnu": "pypi__coverage_cp311_aarch64-unknown-linux-gnu", - "pypi__coverage_cp311_x86_64-apple-darwin": "pypi__coverage_cp311_x86_64-apple-darwin", - "pypi__coverage_cp311_x86_64-unknown-linux-gnu": "pypi__coverage_cp311_x86_64-unknown-linux-gnu", - "pypi__coverage_cp38_aarch64-apple-darwin": "pypi__coverage_cp38_aarch64-apple-darwin", - "pypi__coverage_cp38_aarch64-unknown-linux-gnu": "pypi__coverage_cp38_aarch64-unknown-linux-gnu", - "pypi__coverage_cp38_x86_64-apple-darwin": "pypi__coverage_cp38_x86_64-apple-darwin", - "pypi__coverage_cp38_x86_64-unknown-linux-gnu": "pypi__coverage_cp38_x86_64-unknown-linux-gnu", - "pypi__coverage_cp39_aarch64-apple-darwin": "pypi__coverage_cp39_aarch64-apple-darwin", - "pypi__coverage_cp39_aarch64-unknown-linux-gnu": "pypi__coverage_cp39_aarch64-unknown-linux-gnu", - "pypi__coverage_cp39_x86_64-apple-darwin": "pypi__coverage_cp39_x86_64-apple-darwin", - "pypi__coverage_cp39_x86_64-unknown-linux-gnu": "pypi__coverage_cp39_x86_64-unknown-linux-gnu" - }, - "devImports": [], - "tags": [ - { - "tagName": "install", - "attributeValues": {}, - "devDependency": false, - "location": { - "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel", - "line": 15, - "column": 22 - } - } - ], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - }, - { - "extensionBzlFile": "@rules_python//python/extensions:python.bzl", - "extensionName": "python", - "usingModule": "rules_python@0.22.1", - "location": { - "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel", - "line": 50, - "column": 23 - }, - "imports": { - "pythons_hub": "pythons_hub" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - } - ], - "deps": { - "platforms": "platforms@0.0.7", - "bazel_skylib": "bazel_skylib@1.3.0", - "rules_proto": "rules_proto@5.3.0-21.7", - "com_google_protobuf": "protobuf@21.7", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/rules_python/releases/download/0.22.1/rules_python-0.22.1.tar.gz" - ], - "integrity": "sha256-pWQP3dS+sD6MH95e1xYMC6a9R359BIZhwwwGk2om/WM=", - "strip_prefix": "rules_python-0.22.1", - "remote_patches": { - "https://bcr.bazel.build/modules/rules_python/0.22.1/patches/module_dot_bazel_version.patch": "sha256-3+VLDH9gYDzNI4eOW7mABC/LKxh1xqF6NhacLbNTucs=" - }, - "remote_patch_strip": 1 - } - } - }, - "buildozer@6.4.0.2": { - "name": "buildozer", - "version": "6.4.0.2", - "key": "buildozer@6.4.0.2", - "repoName": "buildozer", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [ - { - "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", - "extensionName": "buildozer_binary", - "usingModule": "buildozer@6.4.0.2", - "location": { - "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", - "line": 7, - "column": 33 - }, - "imports": { - "buildozer_binary": "buildozer_binary" - }, - "devImports": [], - "tags": [ - { - "tagName": "buildozer", - "attributeValues": { - "sha256": { - "darwin-amd64": "d29e347ecd6b5673d72cb1a8de05bf1b06178dd229ff5eb67fad5100c840cc8e", - "darwin-arm64": "9b9e71bdbec5e7223871e913b65d12f6d8fa026684daf991f00e52ed36a6978d", - "linux-amd64": "8dfd6345da4e9042daa738d7fdf34f699c5dfce4632f7207956fceedd8494119", - "linux-arm64": "6559558fded658c8fa7432a9d011f7c4dcbac6b738feae73d2d5c352e5f605fa", - "windows-amd64": "e7f05bf847f7c3689dd28926460ce6e1097ae97380ac8e6ae7147b7b706ba19b" - }, - "version": "6.4.0" - }, - "devDependency": false, - "location": { - "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", - "line": 8, - "column": 27 - } - } - ], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - } - ], - "deps": { - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/fmeum/buildozer/releases/download/v6.4.0.2/buildozer-v6.4.0.2.tar.gz" - ], - "integrity": "sha256-k7tFKQMR2AygxpmZfH0yEPnQmF3efFgD9rBPkj+Yz/8=", - "strip_prefix": "buildozer-6.4.0.2", - "remote_patches": { - "https://bcr.bazel.build/modules/buildozer/6.4.0.2/patches/module_dot_bazel_version.patch": "sha256-gKANF2HMilj7bWmuXs4lbBIAAansuWC4IhWGB/CerjU=" - }, - "remote_patch_strip": 1 - } - } - }, - "platforms@0.0.7": { - "name": "platforms", - "version": "0.0.7", - "key": "platforms@0.0.7", - "repoName": "platforms", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "rules_license": "rules_license@0.0.7", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz" - ], - "integrity": "sha256-OlYcmee9vpFzqmU/1Xn+hJ8djWc5V4CrR3Cx84FDHVE=", - "strip_prefix": "", - "remote_patches": {}, - "remote_patch_strip": 0 - } - } - }, - "protobuf@21.7": { - "name": "protobuf", - "version": "21.7", - "key": "protobuf@21.7", - "repoName": "protobuf", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [ - { - "extensionBzlFile": "@rules_jvm_external//:extensions.bzl", - "extensionName": "maven", - "usingModule": "protobuf@21.7", - "location": { - "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel", - "line": 22, - "column": 22 - }, - "imports": { - "maven": "maven" - }, - "devImports": [], - "tags": [ - { - "tagName": "install", - "attributeValues": { - "name": "maven", - "artifacts": [ - "com.google.code.findbugs:jsr305:3.0.2", - "com.google.code.gson:gson:2.8.9", - "com.google.errorprone:error_prone_annotations:2.3.2", - "com.google.j2objc:j2objc-annotations:1.3", - "com.google.guava:guava:31.1-jre", - "com.google.guava:guava-testlib:31.1-jre", - "com.google.truth:truth:1.1.2", - "junit:junit:4.13.2", - "org.mockito:mockito-core:4.3.1" - ] - }, - "devDependency": false, - "location": { - "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel", - "line": 24, - "column": 14 - } - } - ], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - } - ], - "deps": { - "bazel_skylib": "bazel_skylib@1.3.0", - "rules_python": "rules_python@0.22.1", - "rules_cc": "rules_cc@0.0.9", - "rules_proto": "rules_proto@5.3.0-21.7", - "rules_java": "rules_java@7.4.0", - "rules_pkg": "rules_pkg@0.7.0", - "com_google_abseil": "abseil-cpp@20211102.0", - "zlib": "zlib@1.3", - "upb": "upb@0.0.0-20220923-a547704", - "rules_jvm_external": "rules_jvm_external@4.4.2", - "com_google_googletest": "googletest@1.11.0", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-all-21.7.zip" - ], - "integrity": "sha256-VJOiH17T/FAuZv7GuUScBqVRztYwAvpIkDxA36jeeko=", - "strip_prefix": "protobuf-21.7", - "remote_patches": { - "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel.patch": "sha256-q3V2+eq0v2XF0z8z+V+QF4cynD6JvHI1y3kI/+rzl5s=", - "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel_for_examples.patch": "sha256-O7YP6s3lo/1opUiO0jqXYORNHdZ/2q3hjz1QGy8QdIU=", - "https://bcr.bazel.build/modules/protobuf/21.7/patches/relative_repo_names.patch": "sha256-RK9RjW8T5UJNG7flIrnFiNE9vKwWB+8uWWtJqXYT0w4=", - "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_missing_files.patch": "sha256-Hyne4DG2u5bXcWHNxNMirA2QFAe/2Cl8oMm1XJdkQIY=" - }, - "remote_patch_strip": 1 - } - } - }, - "zlib@1.3": { - "name": "zlib", - "version": "1.3", - "key": "zlib@1.3", - "repoName": "zlib", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "platforms": "platforms@0.0.7", - "rules_cc": "rules_cc@0.0.9", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" - ], - "integrity": "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=", - "strip_prefix": "zlib-1.3", - "remote_patches": { - "https://bcr.bazel.build/modules/zlib/1.3/patches/add_build_file.patch": "sha256-Ei+FYaaOo7A3jTKunMEodTI0Uw5NXQyZEcboMC8JskY=", - "https://bcr.bazel.build/modules/zlib/1.3/patches/module_dot_bazel.patch": "sha256-fPWLM+2xaF/kuy+kZc1YTfW6hNjrkG400Ho7gckuyJk=" - }, - "remote_patch_strip": 0 - } - } - }, - "apple_support@1.5.0": { - "name": "apple_support", - "version": "1.5.0", - "key": "apple_support@1.5.0", - "repoName": "build_bazel_apple_support", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [ - "@local_config_apple_cc_toolchains//:all" - ], - "extensionUsages": [ - { - "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl", - "extensionName": "apple_cc_configure_extension", - "usingModule": "apple_support@1.5.0", - "location": { - "file": "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel", - "line": 17, - "column": 35 - }, - "imports": { - "local_config_apple_cc": "local_config_apple_cc", - "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - } - ], - "deps": { - "bazel_skylib": "bazel_skylib@1.3.0", - "platforms": "platforms@0.0.7", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/apple_support/releases/download/1.5.0/apple_support.1.5.0.tar.gz" - ], - "integrity": "sha256-miM41vja0yRPgj8txghKA+TQ+7J8qJLclw5okNW0gYQ=", - "strip_prefix": "", - "remote_patches": {}, - "remote_patch_strip": 0 - } - } - }, - "bazel_skylib@1.3.0": { - "name": "bazel_skylib", - "version": "1.3.0", - "key": "bazel_skylib@1.3.0", - "repoName": "bazel_skylib", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [ - "//toolchains/unittest:cmd_toolchain", - "//toolchains/unittest:bash_toolchain" - ], - "extensionUsages": [], - "deps": { - "platforms": "platforms@0.0.7", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz" - ], - "integrity": "sha256-dNVE2W9KW7Yw1GXKi7z+Ix41lOWq5X4e2/F6brPKJQY=", - "strip_prefix": "", - "remote_patches": {}, - "remote_patch_strip": 0 - } - } - }, - "rules_pkg@0.7.0": { - "name": "rules_pkg", - "version": "0.7.0", - "key": "rules_pkg@0.7.0", - "repoName": "rules_pkg", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "rules_python": "rules_python@0.22.1", - "bazel_skylib": "bazel_skylib@1.3.0", - "rules_license": "rules_license@0.0.7", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz" - ], - "integrity": "sha256-iimOgydi7aGDBZfWT+fbWBeKqEzVkm121bdE1lWJQcI=", - "strip_prefix": "", - "remote_patches": { - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/patches/module_dot_bazel.patch": "sha256-4OaEPZwYF6iC71ZTDg6MJ7LLqX7ZA0/kK4mT+4xKqiE=" - }, - "remote_patch_strip": 0 - } - } - }, - "abseil-cpp@20211102.0": { - "name": "abseil-cpp", - "version": "20211102.0", - "key": "abseil-cpp@20211102.0", - "repoName": "abseil-cpp", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "rules_cc": "rules_cc@0.0.9", - "platforms": "platforms@0.0.7", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz" - ], - "integrity": "sha256-3PcbnLqNwMqZQMSzFqDHlr6Pq0KwcLtrfKtitI8OZsQ=", - "strip_prefix": "abseil-cpp-20211102.0", - "remote_patches": { - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/patches/module_dot_bazel.patch": "sha256-4izqopgGCey4jVZzl/w3M2GVPNohjh2B5TmbThZNvPY=" - }, - "remote_patch_strip": 0 - } - } - }, - "upb@0.0.0-20220923-a547704": { - "name": "upb", - "version": "0.0.0-20220923-a547704", - "key": "upb@0.0.0-20220923-a547704", - "repoName": "upb", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "bazel_skylib": "bazel_skylib@1.3.0", - "rules_proto": "rules_proto@5.3.0-21.7", - "com_google_protobuf": "protobuf@21.7", - "com_google_absl": "abseil-cpp@20211102.0", - "platforms": "platforms@0.0.7", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/protocolbuffers/upb/archive/a5477045acaa34586420942098f5fecd3570f577.tar.gz" - ], - "integrity": "sha256-z39x6v+QskwaKLSWRan/A6mmwecTQpHOcJActj5zZLU=", - "strip_prefix": "upb-a5477045acaa34586420942098f5fecd3570f577", - "remote_patches": { - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/patches/module_dot_bazel.patch": "sha256-wH4mNS6ZYy+8uC0HoAft/c7SDsq2Kxf+J8dUakXhaB0=" - }, - "remote_patch_strip": 0 - } - } - }, - "rules_jvm_external@4.4.2": { - "name": "rules_jvm_external", - "version": "4.4.2", - "key": "rules_jvm_external@4.4.2", - "repoName": "rules_jvm_external", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [ - { - "extensionBzlFile": "@rules_jvm_external//:non-module-deps.bzl", - "extensionName": "non_module_deps", - "usingModule": "rules_jvm_external@4.4.2", - "location": { - "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", - "line": 9, - "column": 32 - }, - "imports": { - "io_bazel_rules_kotlin": "io_bazel_rules_kotlin" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - }, - { - "extensionBzlFile": "@rules_jvm_external//:extensions.bzl", - "extensionName": "maven", - "usingModule": "rules_jvm_external@4.4.2", - "location": { - "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", - "line": 16, - "column": 22 - }, - "imports": { - "rules_jvm_external_deps": "rules_jvm_external_deps" - }, - "devImports": [], - "tags": [ - { - "tagName": "install", - "attributeValues": { - "name": "rules_jvm_external_deps", - "artifacts": [ - "com.google.cloud:google-cloud-core:1.93.10", - "com.google.cloud:google-cloud-storage:1.113.4", - "com.google.code.gson:gson:2.9.0", - "org.apache.maven:maven-artifact:3.8.6", - "software.amazon.awssdk:s3:2.17.183" - ], - "lock_file": "@rules_jvm_external//:rules_jvm_external_deps_install.json" - }, - "devDependency": false, - "location": { - "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", - "line": 18, - "column": 14 - } - } - ], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - } - ], - "deps": { - "bazel_skylib": "bazel_skylib@1.3.0", - "io_bazel_stardoc": "stardoc@0.5.1", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/rules_jvm_external/archive/refs/tags/4.4.2.zip" - ], - "integrity": "sha256-c1YC9QgT6y6pPKP15DsZWb2AshO4NqB6YqKddXZwt3s=", - "strip_prefix": "rules_jvm_external-4.4.2", - "remote_patches": {}, - "remote_patch_strip": 0 - } - } - }, - "googletest@1.11.0": { - "name": "googletest", - "version": "1.11.0", - "key": "googletest@1.11.0", - "repoName": "googletest", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "com_google_absl": "abseil-cpp@20211102.0", - "platforms": "platforms@0.0.7", - "rules_cc": "rules_cc@0.0.9", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz" - ], - "integrity": "sha256-tIcL8SH/d5W6INILzdhie44Ijy0dqymaAxwQNO3ck9U=", - "strip_prefix": "googletest-release-1.11.0", - "remote_patches": { - "https://bcr.bazel.build/modules/googletest/1.11.0/patches/module_dot_bazel.patch": "sha256-HuahEdI/n8KCI071sN3CEziX+7qP/Ec77IWayYunLP0=" - }, - "remote_patch_strip": 0 - } - } - }, - "stardoc@0.5.1": { - "name": "stardoc", - "version": "0.5.1", - "key": "stardoc@0.5.1", - "repoName": "stardoc", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "bazel_skylib": "bazel_skylib@1.3.0", - "rules_java": "rules_java@7.4.0", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/stardoc/releases/download/0.5.1/stardoc-0.5.1.tar.gz" - ], - "integrity": "sha256-qoFNrgrEALurLoiB+ZFcb0fElmS/CHxAmhX5BDjSwj4=", - "strip_prefix": "", - "remote_patches": { - "https://bcr.bazel.build/modules/stardoc/0.5.1/patches/module_dot_bazel.patch": "sha256-UAULCuTpJE7SG0YrR9XLjMfxMRmbP+za3uW9ONZ5rjI=" - }, - "remote_patch_strip": 0 - } - } - } + "lockFileVersion": 11, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/source.json": "7e3a9adf473e9af076ae485ed649d5641ad50ec5c11718103f34de03170d94ad", + "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", + "https://bcr.bazel.build/modules/apple_support/1.5.0/source.json": "eb98a7627c0bc486b57f598ad8da50f6625d974c8f723e9ea71bd39f709c9862", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", + "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", + "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749", + "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", + "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", + "https://bcr.bazel.build/modules/googletest/1.11.0/source.json": "c73d9ef4268c91bd0c1cd88f1f9dfa08e814b1dbe89b5f594a9f08ba0244d206", + "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", + "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", + "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", + "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", + "https://bcr.bazel.build/modules/platforms/0.0.9/source.json": "cd74d854bf16a9e002fb2ca7b1a421f4403cda29f824a765acd3a8c56f8d43e6", + "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", + "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", + "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", + "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/7.6.1/source.json": "8f3f3076554e1558e8e468b2232991c510ecbcbed9e6f8c06ac31c93bcf38362", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35", + "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", + "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", + "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c", + "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/source.json": "d57902c052424dfda0e71646cb12668d39c4620ee0544294d9d941e7d12bc3a9", + "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", + "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7", + "https://bcr.bazel.build/modules/rules_python/0.22.1/source.json": "57226905e783bae7c37c2dd662be078728e48fa28ee4324a7eabcafb5a43d014", + "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", + "https://bcr.bazel.build/modules/stardoc/0.5.1/source.json": "a96f95e02123320aa015b956f29c00cb818fa891ef823d55148e1a362caacf29", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", + "https://bcr.bazel.build/modules/zlib/1.3/MODULE.bazel": "6a9c02f19a24dcedb05572b2381446e27c272cd383aed11d41d99da9e3167a72", + "https://bcr.bazel.build/modules/zlib/1.3/source.json": "b6b43d0737af846022636e6e255fd4a96fee0d34f08f3830e6e0bac51465c37c" }, + "selectedYankedVersions": {}, "moduleExtensions": { "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { "general": { - "bzlTransitiveDigest": "pMLFCYaRPkgXPQ8vtuNkMfiHfPmRBy6QJfnid4sWfv0=", + "bzlTransitiveDigest": "PjIds3feoYE8SGbbIq2SFTZy3zmxeO2tQevJZNDo7iY=", + "usagesDigest": "aLmqbvowmHkkBPve05yyDNGN7oh7QE9kBADr3QIZTZs=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -1061,572 +89,22 @@ ] } }, - "@@bazel_tools//tools/cpp:cc_configure.bzl%cc_configure_extension": { + "@@platforms//host:extension.bzl%host_platform": { "general": { - "bzlTransitiveDigest": "PHpT2yqMGms2U4L3E/aZ+WcQalmZWm+ILdP3yiLsDhA=", + "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", + "usagesDigest": "meSzxn3DUCcYEhq4HQwExWkWtU4EjriRBQLsZN+Q0SU=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "local_config_cc": { - "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", - "ruleClassName": "cc_autoconf", - "attributes": {} - }, - "local_config_cc_toolchains": { - "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", - "ruleClassName": "cc_autoconf_toolchains", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [ - [ - "bazel_tools", - "bazel_tools", - "bazel_tools" - ] - ] - } - }, - "@@bazel_tools//tools/osx:xcode_configure.bzl%xcode_configure_extension": { - "general": { - "bzlTransitiveDigest": "Qh2bWTU6QW6wkrd87qrU4YeY+SG37Nvw3A0PR4Y0L2Y=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "local_config_xcode": { - "bzlFile": "@@bazel_tools//tools/osx:xcode_configure.bzl", - "ruleClassName": "xcode_autoconf", - "attributes": { - "xcode_locator": "@bazel_tools//tools/osx:xcode_locator.m", - "remote_xcode": "" - } - } - }, - "recordedRepoMappingEntries": [] - } - }, - "@@bazel_tools//tools/sh:sh_configure.bzl%sh_configure_extension": { - "general": { - "bzlTransitiveDigest": "hp4NgmNjEg5+xgvzfh6L83bt9/aiiWETuNpwNuF1MSU=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "local_config_sh": { - "bzlFile": "@@bazel_tools//tools/sh:sh_configure.bzl", - "ruleClassName": "sh_config", + "host_platform": { + "bzlFile": "@@platforms//host:extension.bzl", + "ruleClassName": "host_platform_repo", "attributes": {} } }, "recordedRepoMappingEntries": [] } - }, - "@@rules_java~//java:extensions.bzl%toolchains": { - "general": { - "bzlTransitiveDigest": "tJHbmWnq7m+9eUBnUdv7jZziQ26FmcGL9C5/hU3Q9UQ=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "remotejdk21_linux_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\n" - } - }, - "remotejdk17_linux_s390x_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\n" - } - }, - "remotejdk17_macos_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\n" - } - }, - "remotejdk21_macos_aarch64_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\n" - } - }, - "remotejdk17_linux_aarch64_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\n" - } - }, - "remotejdk21_macos_aarch64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", - "sha256": "e8260516de8b60661422a725f1df2c36ef888f6fb35393566b00e7325db3d04e", - "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz" - ] - } - }, - "remotejdk17_linux_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\n" - } - }, - "remotejdk17_macos_aarch64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", - "sha256": "314b04568ec0ae9b36ba03c9cbd42adc9e1265f74678923b19297d66eb84dcca", - "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz" - ] - } - }, - "remote_java_tools_windows": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "fe2f88169696d6c6fc6e90ba61bb46be7d0ae3693cbafdf336041bf56679e8d1", - "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_windows-v13.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_windows-v13.4.zip" - ] - } - }, - "remotejdk11_win": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", - "sha256": "43408193ce2fa0862819495b5ae8541085b95660153f2adcf91a52d3a1710e83", - "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-win_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip", - "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip" - ] - } - }, - "remotejdk11_win_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\n" - } - }, - "remotejdk11_linux_aarch64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", - "sha256": "54174439f2b3fddd11f1048c397fe7bb45d4c9d66d452d6889b013d04d21c4de", - "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz" - ] - } - }, - "remotejdk17_linux": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", - "sha256": "b9482f2304a1a68a614dfacddcf29569a72f0fac32e6c74f83dc1b9a157b8340", - "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz" - ] - } - }, - "remotejdk11_linux_s390x_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\n" - } - }, - "remotejdk11_linux_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\n" - } - }, - "remotejdk11_macos": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", - "sha256": "bcaab11cfe586fae7583c6d9d311c64384354fb2638eb9a012eca4c3f1a1d9fd", - "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz" - ] - } - }, - "remotejdk11_win_arm64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", - "sha256": "b8a28e6e767d90acf793ea6f5bed0bb595ba0ba5ebdf8b99f395266161e53ec2", - "strip_prefix": "jdk-11.0.13+8", - "urls": [ - "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-aarch64.zip" - ] - } - }, - "remotejdk17_macos": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", - "sha256": "640453e8afe8ffe0fb4dceb4535fb50db9c283c64665eebb0ba68b19e65f4b1f", - "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz" - ] - } - }, - "remotejdk21_macos": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", - "sha256": "3ad8fe288eb57d975c2786ae453a036aa46e47ab2ac3d81538ebae2a54d3c025", - "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz" - ] - } - }, - "remotejdk21_macos_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\n" - } - }, - "remotejdk17_macos_aarch64_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\n" - } - }, - "remotejdk17_win": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", - "sha256": "192f2afca57701de6ec496234f7e45d971bf623ff66b8ee4a5c81582054e5637", - "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip", - "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip" - ] - } - }, - "remotejdk11_macos_aarch64_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\n" - } - }, - "remotejdk11_linux_ppc64le_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\n" - } - }, - "remotejdk21_linux": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", - "sha256": "5ad730fbee6bb49bfff10bf39e84392e728d89103d3474a7e5def0fd134b300a", - "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz" - ] - } - }, - "remote_java_tools_linux": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "ba10f09a138cf185d04cbc807d67a3da42ab13d618c5d1ce20d776e199c33a39", - "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_linux-v13.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_linux-v13.4.zip" - ] - } - }, - "remotejdk21_win": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", - "sha256": "f7cc15ca17295e69c907402dfe8db240db446e75d3b150da7bf67243cded93de", - "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-win_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip", - "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip" - ] - } - }, - "remotejdk21_linux_aarch64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", - "sha256": "ce7df1af5d44a9f455617c4b8891443fbe3e4b269c777d8b82ed66f77167cfe0", - "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_aarch64", - "urls": [ - "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz", - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz" - ] - } - }, - "remotejdk11_linux_aarch64_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\n" - } - }, - "remotejdk11_linux_s390x": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", - "sha256": "a58fc0361966af0a5d5a31a2d8a208e3c9bb0f54f345596fd80b99ea9a39788b", - "strip_prefix": "jdk-11.0.15+10", - "urls": [ - "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz", - "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz" - ] - } - }, - "remotejdk17_linux_aarch64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", - "sha256": "6531cef61e416d5a7b691555c8cf2bdff689201b8a001ff45ab6740062b44313", - "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz" - ] - } - }, - "remotejdk17_win_arm64_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\n" - } - }, - "remotejdk11_linux": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", - "sha256": "a34b404f87a08a61148b38e1416d837189e1df7a040d949e743633daf4695a3c", - "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz" - ] - } - }, - "remotejdk11_macos_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\n" - } - }, - "remotejdk17_linux_ppc64le_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\n" - } - }, - "remotejdk17_win_arm64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", - "sha256": "6802c99eae0d788e21f52d03cab2e2b3bf42bc334ca03cbf19f71eb70ee19f85", - "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip", - "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip" - ] - } - }, - "remote_java_tools_darwin_arm64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "076a7e198ad077f8c7d997986ef5102427fae6bbfce7a7852d2e080ed8767528", - "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_arm64-v13.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_arm64-v13.4.zip" - ] - } - }, - "remotejdk17_linux_ppc64le": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", - "sha256": "00a4c07603d0218cd678461b5b3b7e25b3253102da4022d31fc35907f21a2efd", - "strip_prefix": "jdk-17.0.8.1+1", - "urls": [ - "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz", - "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz" - ] - } - }, - "remotejdk21_linux_aarch64_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\n" - } - }, - "remotejdk11_win_arm64_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\n" - } - }, - "local_jdk": { - "bzlFile": "@@rules_java~//toolchains:local_java_repository.bzl", - "ruleClassName": "_local_java_repository_rule", - "attributes": { - "java_home": "", - "version": "", - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = {RUNTIME_VERSION},\n)\n" - } - }, - "remote_java_tools_darwin_x86_64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "4523aec4d09c587091a2dae6f5c9bc6922c220f3b6030e5aba9c8f015913cc65", - "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_x86_64-v13.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_x86_64-v13.4.zip" - ] - } - }, - "remote_java_tools": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "e025fd260ac39b47c111f5212d64ec0d00d85dec16e49368aae82fc626a940cf", - "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools-v13.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools-v13.4.zip" - ] - } - }, - "remotejdk17_linux_s390x": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", - "sha256": "ffacba69c6843d7ca70d572489d6cc7ab7ae52c60f0852cedf4cf0d248b6fc37", - "strip_prefix": "jdk-17.0.8.1+1", - "urls": [ - "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz", - "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz" - ] - } - }, - "remotejdk17_win_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\n" - } - }, - "remotejdk11_linux_ppc64le": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", - "sha256": "a8fba686f6eb8ae1d1a9566821dbd5a85a1108b96ad857fdbac5c1e4649fc56f", - "strip_prefix": "jdk-11.0.15+10", - "urls": [ - "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz", - "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz" - ] - } - }, - "remotejdk11_macos_aarch64": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", - "sha256": "7632bc29f8a4b7d492b93f3bc75a7b61630894db85d136456035ab2a24d38885", - "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz" - ] - } - }, - "remotejdk21_win_toolchain_config_repo": { - "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", - "ruleClassName": "_toolchain_config", - "attributes": { - "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\n" - } - } - }, - "recordedRepoMappingEntries": [ - [ - "rules_java~", - "bazel_tools", - "bazel_tools" - ], - [ - "rules_java~", - "remote_java_tools", - "rules_java~~toolchains~remote_java_tools" - ] - ] - } } } } diff --git a/WORKSPACE b/WORKSPACE index 956c2cb0..6ac564d6 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -55,7 +55,7 @@ go_repositories() go_rules_dependencies() -go_register_toolchains(version = "1.22.4") +go_register_toolchains(version = "1.22.5") ############################################################ # gazelle ################################################## diff --git a/internal/config/config.go b/internal/config/config.go index da03144d..b790e4a0 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -123,8 +123,8 @@ func (config *Config) walkIndex(index RuleIndex, key string, list Ls) error { ruleSplit := strings.SplitN(ruleName, ":", 2) ruleName = ruleSplit[0] - if r, exists := rule.Rules[ruleName]; exists { - r = config.copyRule(r) + if r, ok := rule.Rules[ruleName]; ok { + r = r.Copy() if err := r.SetParameters(ruleSplit[1:]); err != nil { return fmt.Errorf("rule %s failed with %s", ruleName, err.Error()) @@ -140,14 +140,3 @@ func (config *Config) walkIndex(index RuleIndex, key string, list Ls) error { return nil } - -func (config *Config) copyRule(r rule.Rule) rule.Rule { - switch r.GetName() { - case "regex": - return new(rule.Regex).Init() - case "exists": - return new(rule.Exists).Init() - } - - return r -} diff --git a/internal/glob/BUILD.bazel b/internal/glob/BUILD.bazel index 394a43a8..f282b30a 100644 --- a/internal/glob/BUILD.bazel +++ b/internal/glob/BUILD.bazel @@ -6,6 +6,7 @@ go_library( importpath = "github.com/loeffel-io/ls-lint/v2/internal/glob", visibility = ["//:__subpackages__"], deps = [ + "//internal/config", "//internal/rule", "@com_github_bmatcuk_doublestar_v4//:doublestar", ], diff --git a/internal/glob/glob.go b/internal/glob/glob.go index f2c09585..b81cb0c0 100644 --- a/internal/glob/glob.go +++ b/internal/glob/glob.go @@ -2,12 +2,60 @@ package glob import ( "github.com/bmatcuk/doublestar/v4" + "github.com/loeffel-io/ls-lint/v2/internal/config" "github.com/loeffel-io/ls-lint/v2/internal/rule" "io/fs" "strings" ) -func Index[IndexValue bool | map[string][]rule.Rule](filesystem fs.FS, index map[string]IndexValue, files bool) (err error) { +func Index(filesystem fs.FS, index config.RuleIndex, files bool) (err error) { + for key, value := range index { + var matches []string + + if !strings.ContainsAny(key, "*{}") { + continue + } + + if matches, err = doublestar.Glob(filesystem, key); err != nil { + return err + } + + if len(matches) == 0 { + delete(index, key) + continue + } + + for _, match := range matches { + var matchInfo fs.FileInfo + + if matchInfo, err = fs.Stat(filesystem, match); err != nil { + return err + } + + if !files && !matchInfo.IsDir() { + continue + } + + if _, ok := index[match]; !ok { + valueCopy := make(map[string][]rule.Rule, len(value)) + for k, rules := range value { + valueCopy[k] = make([]rule.Rule, len(rules)) + for i, r := range rules { + valueCopy[k][i] = r.Copy() + } + } + + index[match] = valueCopy + } + + delete(index, key) + } + } + + return nil +} + +func IgnoreIndex(filesystem fs.FS, index map[string]bool, files bool) (err error) { for key, value := range index { var matches []string diff --git a/internal/linter/linter.go b/internal/linter/linter.go index b629bb50..4f5c68e7 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -166,7 +166,7 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate withoutExt = strings.TrimSuffix(filepath.Base(path), ext) } - if _, exists := rules[ext]; exists { + if _, ok := rules[ext]; ok { for _, ruleFile := range rules[ext] { if !validate && ruleFile.GetName() != "exists" { continue @@ -238,7 +238,7 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]struct{}, debug boo // glob ignore index var ignoreIndex = linter.config.GetIgnoreIndex() - if err = glob.Index(filesystem, ignoreIndex, true); err != nil { + if err = glob.IgnoreIndex(filesystem, ignoreIndex, true); err != nil { return err } diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index c3170972..6f53c3ca 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -494,6 +494,11 @@ func TestLinter_Run(t *testing.T) { "test/sub/test.ts": &fstest.MapFile{Mode: fs.ModePerm}, "test/sub/snake_case_123.png": &fstest.MapFile{Mode: fs.ModePerm}, "test/sub/snake_case_456.png": &fstest.MapFile{Mode: fs.ModePerm}, + "wildcards": &fstest.MapFile{Mode: fs.ModeDir}, + "wildcards/a": &fstest.MapFile{Mode: fs.ModeDir}, + "wildcards/a/b": &fstest.MapFile{Mode: fs.ModeDir}, + "wildcards/a/b/test.vue": &fstest.MapFile{Mode: fs.ModePerm}, + "wildcards/a/b/c": &fstest.MapFile{Mode: fs.ModeDir}, }, paths: nil, linter: NewLinter( @@ -511,6 +516,11 @@ func TestLinter_Run(t *testing.T) { "not_exists": config.Ls{ ".dir": "exists:1", }, + "wildcards/**": config.Ls{ + ".dir": "exists:1", + ".*": "snake_case | exists:1", + ".vue": "snake_case | exists:1", + }, }, []string{ "node_modules", @@ -530,9 +540,9 @@ func TestLinter_Run(t *testing.T) { expectedErr: nil, expectedStatistic: &debug.Statistic{ Start: start, - Files: 4, + Files: 5, FileSkips: 1, - Dirs: 3, + Dirs: 7, DirSkips: 1, RWMutex: new(sync.RWMutex), }, @@ -569,6 +579,62 @@ func TestLinter_Run(t *testing.T) { }, RWMutex: new(sync.RWMutex), }, + { + Path: "wildcards", + Ext: ".vue", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + { + Path: "wildcards", + Ext: ".*", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + { + Path: "wildcards/a", + Ext: ".vue", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + { + Path: "wildcards/a", + Ext: ".*", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + { + Path: "wildcards/a/b", + Ext: ".*", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + { + Path: "wildcards/a/b/c", + Ext: ".vue", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, + { + Path: "wildcards/a/b/c", + Ext: ".*", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, }, }, { diff --git a/internal/rule/camelcase.go b/internal/rule/camelcase.go index d4e24fd3..65300c71 100644 --- a/internal/rule/camelcase.go +++ b/internal/rule/camelcase.go @@ -79,3 +79,7 @@ func (rule *CamelCase) Validate(value string, fail bool) (bool, error) { func (rule *CamelCase) GetErrorMessage() string { return rule.GetName() } + +func (rule *CamelCase) Copy() Rule { + return rule +} diff --git a/internal/rule/exists.go b/internal/rule/exists.go index fddbe966..7841175a 100644 --- a/internal/rule/exists.go +++ b/internal/rule/exists.go @@ -3,6 +3,7 @@ package rule import ( "fmt" "math" + "math/rand" "strconv" "strings" "sync" @@ -14,6 +15,7 @@ type Exists struct { min uint16 max uint16 count uint16 + test int *sync.RWMutex } @@ -22,6 +24,7 @@ func (rule *Exists) Init() Rule { rule.exclusive = true rule.count = 0 rule.RWMutex = new(sync.RWMutex) + rule.test = rand.Intn(100) return rule } @@ -137,8 +140,20 @@ func (rule *Exists) incrementCount() { func (rule *Exists) GetErrorMessage() string { if rule.getMin() == rule.getMax() { - return fmt.Sprintf("%s:%d", rule.GetName(), rule.getMin()) + return fmt.Sprintf("%s:%d (debug: %d)", rule.GetName(), rule.getMin(), rule.getCount()) } - return fmt.Sprintf("%s:%d-%d", rule.GetName(), rule.getMin(), rule.getMax()) + return fmt.Sprintf("%s:%d-%d (debug: %d)", rule.GetName(), rule.getMin(), rule.getMax(), rule.getCount()) +} + +func (rule *Exists) Copy() Rule { + rule.RLock() + defer rule.RUnlock() + + var c = new(Exists) + c.Init() + c.min = rule.min + c.max = rule.max + + return c } diff --git a/internal/rule/kebabcase.go b/internal/rule/kebabcase.go index 78797e4d..5c2d4761 100644 --- a/internal/rule/kebabcase.go +++ b/internal/rule/kebabcase.go @@ -64,3 +64,7 @@ func (rule *KebabCase) Validate(value string, fail bool) (bool, error) { func (rule *KebabCase) GetErrorMessage() string { return rule.GetName() } + +func (rule *KebabCase) Copy() Rule { + return rule +} diff --git a/internal/rule/lowercase.go b/internal/rule/lowercase.go index a30acbe8..1ae43dbb 100644 --- a/internal/rule/lowercase.go +++ b/internal/rule/lowercase.go @@ -55,3 +55,7 @@ func (rule *Lowercase) Validate(value string, fail bool) (bool, error) { func (rule *Lowercase) GetErrorMessage() string { return rule.GetName() } + +func (rule *Lowercase) Copy() Rule { + return rule +} diff --git a/internal/rule/pascalcase.go b/internal/rule/pascalcase.go index 354787a3..ad9636b8 100644 --- a/internal/rule/pascalcase.go +++ b/internal/rule/pascalcase.go @@ -84,3 +84,7 @@ func (rule *PascalCase) Validate(value string, fail bool) (bool, error) { func (rule *PascalCase) GetErrorMessage() string { return rule.GetName() } + +func (rule *PascalCase) Copy() Rule { + return rule +} diff --git a/internal/rule/pointcase.go b/internal/rule/pointcase.go index 5a427571..762e0f3b 100644 --- a/internal/rule/pointcase.go +++ b/internal/rule/pointcase.go @@ -64,3 +64,7 @@ func (rule *PointCase) Validate(value string, fail bool) (bool, error) { func (rule *PointCase) GetErrorMessage() string { return rule.GetName() } + +func (rule *PointCase) Copy() Rule { + return rule +} diff --git a/internal/rule/regex.go b/internal/rule/regex.go index 144fdeb0..435bc601 100644 --- a/internal/rule/regex.go +++ b/internal/rule/regex.go @@ -71,3 +71,14 @@ func (rule *Regex) getRegexPattern() string { func (rule *Regex) GetErrorMessage() string { return fmt.Sprintf("%s:%s", rule.GetName(), rule.getRegexPattern()) } + +func (rule *Regex) Copy() Rule { + rule.RLock() + defer rule.RUnlock() + + var c = new(Regex) + c.Init() + c.regexPattern = rule.regexPattern + + return c +} diff --git a/internal/rule/rule.go b/internal/rule/rule.go index b761262e..fbf91bf6 100644 --- a/internal/rule/rule.go +++ b/internal/rule/rule.go @@ -45,4 +45,5 @@ type Rule interface { GetExclusive() bool Validate(value string, fail bool) (bool, error) GetErrorMessage() string + Copy() Rule } diff --git a/internal/rule/screamingsnakecase.go b/internal/rule/screamingsnakecase.go index f6d848a7..57d00714 100644 --- a/internal/rule/screamingsnakecase.go +++ b/internal/rule/screamingsnakecase.go @@ -64,3 +64,7 @@ func (rule *ScreamingSnakeCase) Validate(value string, fail bool) (bool, error) func (rule *ScreamingSnakeCase) GetErrorMessage() string { return rule.GetName() } + +func (rule *ScreamingSnakeCase) Copy() Rule { + return rule +} diff --git a/internal/rule/snakecase.go b/internal/rule/snakecase.go index 21b3247a..d73a2265 100644 --- a/internal/rule/snakecase.go +++ b/internal/rule/snakecase.go @@ -64,3 +64,7 @@ func (rule *SnakeCase) Validate(value string, fail bool) (bool, error) { func (rule *SnakeCase) GetErrorMessage() string { return rule.GetName() } + +func (rule *SnakeCase) Copy() Rule { + return rule +} From 46334bb761a346cc36e0256b9610d986840433e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Fri, 12 Jul 2024 09:01:43 +0200 Subject: [PATCH 042/117] chore: ignore gha creds --- .ls-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.ls-lint.yml b/.ls-lint.yml index e3b6704d..dd4de91a 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -14,4 +14,5 @@ ignore: - .idea - genhtml - bazel-* + - gha-* - deployments/npm/pnpm-lock.yaml \ No newline at end of file From 95a90f5e2956a4fe599f831b5d240489d5b664b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20L=C3=B6ffel?= Date: Fri, 12 Jul 2024 09:04:49 +0200 Subject: [PATCH 043/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a8d387e..00a7e99f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ An extremely fast directory and filename linter - Bring some structure to your p [![Go Report Card](https://goreportcard.com/badge/github.com/loeffel-io/ls-lint)](https://goreportcard.com/report/github.com/loeffel-io/ls-lint) Version ![npm](https://img.shields.io/npm/dy/@ls-lint/ls-lint?label=npm%20downloads) -![npm](https://badgen.net/static/npm%20downloads%20total/4.7M+/green) +![npm](https://badgen.net/static/npm%20downloads%20total/5M+/green) License - Minimal setup with simple rules managed in one single or multiple `.ls-lint.yml` files From 351686d831ca83e1dc512ca30dd4ebb6a00416dd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 05:31:01 +0000 Subject: [PATCH 044/117] chore(deps): update dependency io_bazel_rules_go to v0.49.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 6ac564d6..7ed17b19 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -6,10 +6,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", - sha256 = "b2038e2de2cace18f032249cb4bb0048abf583a36369fa98f687af1b3f880b26", + sha256 = "d93ef02f1e72c82d8bb3d5169519b36167b33cf68c252525e3b9d3d5dd143de7", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip", ], ) From dc16afcf2fb381181b12fbe0c9c9da0efd25ca66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Sun, 14 Jul 2024 22:29:27 +0200 Subject: [PATCH 045/117] feat: support ppc64le --- cmd/ls_lint/target.bzl | 5 ++++- deployments/npm/bin/cli.js | 2 ++ deployments/npm/package.json | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/ls_lint/target.bzl b/cmd/ls_lint/target.bzl index 11eefea4..ef27e900 100644 --- a/cmd/ls_lint/target.bzl +++ b/cmd/ls_lint/target.bzl @@ -1,4 +1,3 @@ -# linux ppc64le not supported yet: https://github.com/bazelbuild/platforms/pull/64 targets = [ [ "darwin", @@ -20,6 +19,10 @@ targets = [ "linux", "s390x", ], + [ + "linux", + "ppc64le", + ], [ "windows", "amd64", diff --git a/deployments/npm/bin/cli.js b/deployments/npm/bin/cli.js index 5e985ba6..99b4526c 100644 --- a/deployments/npm/bin/cli.js +++ b/deployments/npm/bin/cli.js @@ -39,6 +39,8 @@ function getPlatformPath() { return 'ls-lint-linux-arm64'; case 's390x': return 'ls-lint-linux-s390x'; + case 'ppc64le': + return 'ls-lint-linux-ppc64le'; default: console.log('ls-lint builds are not available on platform: ' + process.platform + ' arch: ' + process.arch); process.exit(1); diff --git a/deployments/npm/package.json b/deployments/npm/package.json index 59f55924..305853b1 100644 --- a/deployments/npm/package.json +++ b/deployments/npm/package.json @@ -17,7 +17,8 @@ "cpu": [ "x64", "arm64", - "s390x" + "s390x", + "ppc64le" ], "keywords": [ "linter", From 73c20e1a432eedba0e132ac97b3cfed637880a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 11:39:46 +0200 Subject: [PATCH 046/117] test: remove nodejs --- .github/workflows/bazel.yml | 5 ++--- deployments/github/github.sh | 2 +- deployments/npm/BUILD.bazel | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 268b5308..c0dee6c7 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -32,11 +32,10 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel steps: - - run: set -eu && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs + - run: set -eu - uses: actions/checkout@v4 - uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/github:ls_lint_publish - - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint - - run: (cd bazel-bin/deployments/npm/ls_lint && NPM_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc npm publish --no-git-checks) # workaround: https://bazelbuild.slack.com/archives/CEZUUKQ6P/p1667995025343689 # --dry-run --tag beta + - run: NPM_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint.publish \ No newline at end of file diff --git a/deployments/github/github.sh b/deployments/github/github.sh index e71d4f2d..b8c41d8d 100755 --- a/deployments/github/github.sh +++ b/deployments/github/github.sh @@ -4,4 +4,4 @@ set -euo pipefail gh=$1 github_files=$2 -$gh release create --generate-notes --latest ${STABLE_GIT_TAG} $github_files # --draft \ No newline at end of file +$gh release create --generate-notes --latest ${STABLE_GIT_TAG} --prerelease $github_files # --draft \ No newline at end of file diff --git a/deployments/npm/BUILD.bazel b/deployments/npm/BUILD.bazel index 68f0ca14..2f6425cb 100644 --- a/deployments/npm/BUILD.bazel +++ b/deployments/npm/BUILD.bazel @@ -42,6 +42,10 @@ npm_package( ":package_files", ":package_files_bin", ], + args = [ + "--tag beta", + "--no-git-checks", + ], hardlink = "off", include_srcs_packages = [ "deployments/npm/**", From 99e7865cb78c937a6779b7c142595d4952aea3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 11:43:18 +0200 Subject: [PATCH 047/117] test: prerelease --- deployments/github/github.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/github/github.sh b/deployments/github/github.sh index b8c41d8d..84f79184 100755 --- a/deployments/github/github.sh +++ b/deployments/github/github.sh @@ -4,4 +4,4 @@ set -euo pipefail gh=$1 github_files=$2 -$gh release create --generate-notes --latest ${STABLE_GIT_TAG} --prerelease $github_files # --draft \ No newline at end of file +$gh release create --generate-notes --prerelease $github_files # --draft # --latest ${STABLE_GIT_TAG} \ No newline at end of file From 9bfa6f157b49ad3fc1f788f62ab50c51c00ef404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 11:50:46 +0200 Subject: [PATCH 048/117] test: prerelease --- deployments/github/github.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/github/github.sh b/deployments/github/github.sh index 84f79184..3d975159 100755 --- a/deployments/github/github.sh +++ b/deployments/github/github.sh @@ -4,4 +4,4 @@ set -euo pipefail gh=$1 github_files=$2 -$gh release create --generate-notes --prerelease $github_files # --draft # --latest ${STABLE_GIT_TAG} \ No newline at end of file +$gh release create --generate-notes --prerelease ${STABLE_GIT_TAG} $github_files # --draft # --prerelease/--latest # --latest \ No newline at end of file From 8d2944a982b013ac66dd832184727fe937a5301b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 12:08:04 +0200 Subject: [PATCH 049/117] test: new npm --- .github/workflows/bazel.yml | 3 ++- deployments/github/github.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index c0dee6c7..9a22384d 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -38,4 +38,5 @@ jobs: with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/github:ls_lint_publish - - run: NPM_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint.publish \ No newline at end of file + - run: echo ${GITHUB_WORKSPACE} + - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint.publish -- --userconfig=${GITHUB_WORKSPACE}/deployments/npm/.npmrc \ No newline at end of file diff --git a/deployments/github/github.sh b/deployments/github/github.sh index 3d975159..112bda2d 100755 --- a/deployments/github/github.sh +++ b/deployments/github/github.sh @@ -4,4 +4,4 @@ set -euo pipefail gh=$1 github_files=$2 -$gh release create --generate-notes --prerelease ${STABLE_GIT_TAG} $github_files # --draft # --prerelease/--latest # --latest \ No newline at end of file +$gh release create --generate-notes --prerelease ${STABLE_GIT_TAG} $github_files # --draft/--prerelease/--latest \ No newline at end of file From ad23d91bbe229be98fa42fdaea6ed032ac762dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 12:23:19 +0200 Subject: [PATCH 050/117] test: npm --- .github/workflows/bazel.yml | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 9a22384d..b5cde6a8 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -1,23 +1,23 @@ name: Bazel on: [ push ] jobs: - build: - runs-on: ubuntu-latest - container: - image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 - options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel - steps: - - run: set -eu - - uses: actions/checkout@v4 - - uses: google-github-actions/auth@v2 - with: - credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - - run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} +# build: +# runs-on: ubuntu-latest +# container: +# image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 +# options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user +# env: +# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} +# GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel +# steps: +# - run: set -eu +# - uses: actions/checkout@v4 +# - uses: google-github-actions/auth@v2 +# with: +# credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} +# - run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... +# - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... +# - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} release: needs: build @@ -37,6 +37,6 @@ jobs: - uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/github:ls_lint_publish - - run: echo ${GITHUB_WORKSPACE} - - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint.publish -- --userconfig=${GITHUB_WORKSPACE}/deployments/npm/.npmrc \ No newline at end of file + # - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/github:ls_lint_publish + - run: ls -al ${GITHUB_WORKSPACE}/deployments/npm + - run: NPM_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint.publish \ No newline at end of file From 71f6e148e36b164585d82e1921f7a816dd4c57e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 12:25:05 +0200 Subject: [PATCH 051/117] test: npm --- .github/workflows/bazel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index b5cde6a8..ebc38630 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -20,7 +20,7 @@ jobs: # - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} release: - needs: build +# needs: build if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest container: From 9af54933f79fb697d34e05a76fc17d79b3c14919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 12:36:57 +0200 Subject: [PATCH 052/117] test: npm --- .github/workflows/bazel.yml | 39 ++++++++++++++++++------------------- deployments/npm/BUILD.bazel | 1 + 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index ebc38630..37a10793 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -1,26 +1,26 @@ name: Bazel on: [ push ] jobs: -# build: -# runs-on: ubuntu-latest -# container: -# image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 -# options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user -# env: -# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} -# GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel -# steps: -# - run: set -eu -# - uses: actions/checkout@v4 -# - uses: google-github-actions/auth@v2 -# with: -# credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} -# - run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... -# - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... -# - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} + # build: + # runs-on: ubuntu-latest + # container: + # image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 + # options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user + # env: + # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + # GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel + # steps: + # - run: set -eu + # - uses: actions/checkout@v4 + # - uses: google-github-actions/auth@v2 + # with: + # credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} + # - run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... + # - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... + # - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} release: -# needs: build + # needs: build if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest container: @@ -37,6 +37,5 @@ jobs: - uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - # - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/github:ls_lint_publish - - run: ls -al ${GITHUB_WORKSPACE}/deployments/npm + - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/github:ls_lint_publish - run: NPM_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint.publish \ No newline at end of file diff --git a/deployments/npm/BUILD.bazel b/deployments/npm/BUILD.bazel index 2f6425cb..a1420411 100644 --- a/deployments/npm/BUILD.bazel +++ b/deployments/npm/BUILD.bazel @@ -45,6 +45,7 @@ npm_package( args = [ "--tag beta", "--no-git-checks", + "--verbose", ], hardlink = "off", include_srcs_packages = [ From 14b2cf9d365c5e3a31efeb4b897fa1e87c4b0f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 13:37:55 +0200 Subject: [PATCH 053/117] feat: npm token --- .github/workflows/bazel.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 37a10793..c0dee6c7 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -1,26 +1,26 @@ name: Bazel on: [ push ] jobs: - # build: - # runs-on: ubuntu-latest - # container: - # image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 - # options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user - # env: - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - # GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel - # steps: - # - run: set -eu - # - uses: actions/checkout@v4 - # - uses: google-github-actions/auth@v2 - # with: - # credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - # - run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - # - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - # - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} + build: + runs-on: ubuntu-latest + container: + image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 + options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel + steps: + - run: set -eu + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 + with: + credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} + - run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... + - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... + - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} release: - # needs: build + needs: build if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest container: From e5d842863807f8378a97a1cb4bb18ff97340e6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 13:39:04 +0200 Subject: [PATCH 054/117] chore: remove verbose --- deployments/npm/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/deployments/npm/BUILD.bazel b/deployments/npm/BUILD.bazel index a1420411..2f6425cb 100644 --- a/deployments/npm/BUILD.bazel +++ b/deployments/npm/BUILD.bazel @@ -45,7 +45,6 @@ npm_package( args = [ "--tag beta", "--no-git-checks", - "--verbose", ], hardlink = "off", include_srcs_packages = [ From 0fccb1bbc1be167a3ea7328aff1d1b01a026e351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 16:22:27 +0200 Subject: [PATCH 055/117] chore: bump action --- .github/workflows/github-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index b5e38f0d..deea7c05 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -5,4 +5,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ls-lint/action@v2.2.3 \ No newline at end of file + - uses: ls-lint/action@v2.3.0-beta.1 \ No newline at end of file From ca2e78c9cc73eca93d56bdbbcbe73dd21a90a35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 16:40:57 +0200 Subject: [PATCH 056/117] test: action --- .github/workflows/github-action.yml | 5 ++++- .ls-lint-2.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .ls-lint-2.yml diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index deea7c05..608c7f33 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -5,4 +5,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ls-lint/action@v2.3.0-beta.1 \ No newline at end of file + - uses: ls-lint/action@v2.3.0-beta.1 + with: + config: .ls-lint.yml .ls-lint-2.yml + debug: true \ No newline at end of file diff --git a/.ls-lint-2.yml b/.ls-lint-2.yml new file mode 100644 index 00000000..87a5c576 --- /dev/null +++ b/.ls-lint-2.yml @@ -0,0 +1,2 @@ +ls: + .youtube: kebab-case \ No newline at end of file From 8d83c77fce57b59efc0f4ce06bc10a6195139f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 16:58:29 +0200 Subject: [PATCH 057/117] test: action --- .github/workflows/github-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index 608c7f33..92b16b71 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -7,5 +7,5 @@ jobs: - uses: actions/checkout@v4 - uses: ls-lint/action@v2.3.0-beta.1 with: - config: .ls-lint.yml .ls-lint-2.yml + config: '.ls-lint.yml .ls-lint-2.yml' debug: true \ No newline at end of file From b74d9a32447b407ea5edb7d7ebe0290918666686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 17:02:31 +0200 Subject: [PATCH 058/117] test: action --- .github/workflows/github-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index 92b16b71..608c7f33 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -7,5 +7,5 @@ jobs: - uses: actions/checkout@v4 - uses: ls-lint/action@v2.3.0-beta.1 with: - config: '.ls-lint.yml .ls-lint-2.yml' + config: .ls-lint.yml .ls-lint-2.yml debug: true \ No newline at end of file From 3d205f5e7f48496601ff47994c133218cd2cb672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 17:21:27 +0200 Subject: [PATCH 059/117] test: action --- peterGurke.youtube | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 peterGurke.youtube diff --git a/peterGurke.youtube b/peterGurke.youtube new file mode 100644 index 00000000..e69de29b From 2bf0555479d84bdd16c7355e5bd8fea1c7e3cd9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 17:22:37 +0200 Subject: [PATCH 060/117] test: action --- peterGurke.youtube => peter_gurke.youtube | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename peterGurke.youtube => peter_gurke.youtube (100%) diff --git a/peterGurke.youtube b/peter_gurke.youtube similarity index 100% rename from peterGurke.youtube rename to peter_gurke.youtube From 8651833d603496d4f65f9f43b285fab035af1dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 17:50:47 +0200 Subject: [PATCH 061/117] test: yaml --- peter-schuh.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 peter-schuh.yaml diff --git a/peter-schuh.yaml b/peter-schuh.yaml new file mode 100644 index 00000000..e69de29b From ac2d19dd35d6ee8bb5868c7eee12f1da5de3ac8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 18:01:20 +0200 Subject: [PATCH 062/117] test: paths --- .github/workflows/github-action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index 608c7f33..9c23cd25 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -8,4 +8,5 @@ jobs: - uses: ls-lint/action@v2.3.0-beta.1 with: config: .ls-lint.yml .ls-lint-2.yml - debug: true \ No newline at end of file + debug: true + paths: peter-schuh.yaml \ No newline at end of file From 06cc571bef10dce4854ec441e74fdbee7e7636d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 18:02:22 +0200 Subject: [PATCH 063/117] test: paths --- .github/workflows/github-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index 9c23cd25..60955417 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -9,4 +9,4 @@ jobs: with: config: .ls-lint.yml .ls-lint-2.yml debug: true - paths: peter-schuh.yaml \ No newline at end of file + paths: peter-schuh.yaml peter_gurke.youtube \ No newline at end of file From e86fcf9367e478161f34684acc30eb48fc7dd608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 18:06:49 +0200 Subject: [PATCH 064/117] test: paths --- .github/workflows/github-action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index 60955417..608c7f33 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -8,5 +8,4 @@ jobs: - uses: ls-lint/action@v2.3.0-beta.1 with: config: .ls-lint.yml .ls-lint-2.yml - debug: true - paths: peter-schuh.yaml peter_gurke.youtube \ No newline at end of file + debug: true \ No newline at end of file From 3c8ecbedfd867b05f6b381e2cfc59e1d161c519e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Mon, 15 Jul 2024 18:37:45 +0200 Subject: [PATCH 065/117] feat: clean --- .github/workflows/github-action.yml | 5 +---- .ls-lint-2.yml | 2 -- peter-schuh.yaml | 0 peter_gurke.youtube | 0 4 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 .ls-lint-2.yml delete mode 100644 peter-schuh.yaml delete mode 100644 peter_gurke.youtube diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index 608c7f33..deea7c05 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -5,7 +5,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ls-lint/action@v2.3.0-beta.1 - with: - config: .ls-lint.yml .ls-lint-2.yml - debug: true \ No newline at end of file + - uses: ls-lint/action@v2.3.0-beta.1 \ No newline at end of file diff --git a/.ls-lint-2.yml b/.ls-lint-2.yml deleted file mode 100644 index 87a5c576..00000000 --- a/.ls-lint-2.yml +++ /dev/null @@ -1,2 +0,0 @@ -ls: - .youtube: kebab-case \ No newline at end of file diff --git a/peter-schuh.yaml b/peter-schuh.yaml deleted file mode 100644 index e69de29b..00000000 diff --git a/peter_gurke.youtube b/peter_gurke.youtube deleted file mode 100644 index e69de29b..00000000 From 8cf724f13d3b291ee6ff84ed191f7a48eca34d46 Mon Sep 17 00:00:00 2001 From: Robin Irmer Date: Thu, 12 Sep 2024 12:55:22 +0200 Subject: [PATCH 066/117] chore: remove pointcase rule Signed-off-by: Robin Irmer --- internal/rule/BUILD.bazel | 2 - internal/rule/pointcase.go | 70 --------------------------------- internal/rule/pointcase_test.go | 41 ------------------- internal/rule/rule.go | 4 -- 4 files changed, 117 deletions(-) delete mode 100644 internal/rule/pointcase.go delete mode 100644 internal/rule/pointcase_test.go diff --git a/internal/rule/BUILD.bazel b/internal/rule/BUILD.bazel index 18674043..5cac7909 100644 --- a/internal/rule/BUILD.bazel +++ b/internal/rule/BUILD.bazel @@ -9,7 +9,6 @@ go_library( "kebabcase.go", "lowercase.go", "pascalcase.go", - "pointcase.go", "regex.go", "rule.go", "screamingsnakecase.go", @@ -27,7 +26,6 @@ go_test( "kebabcase_test.go", "lowercase_test.go", "pascalcase_test.go", - "pointcase_test.go", "regex_test.go", "rule_test.go", "screamingsnakecase_test.go", diff --git a/internal/rule/pointcase.go b/internal/rule/pointcase.go deleted file mode 100644 index 762e0f3b..00000000 --- a/internal/rule/pointcase.go +++ /dev/null @@ -1,70 +0,0 @@ -package rule - -import ( - "sync" - "unicode" -) - -type PointCase struct { - name string - exclusive bool - *sync.RWMutex -} - -func (rule *PointCase) Init() Rule { - rule.name = "pointcase" - rule.exclusive = false - rule.RWMutex = new(sync.RWMutex) - - return rule -} - -func (rule *PointCase) GetName() string { - rule.RLock() - defer rule.RUnlock() - - return rule.name -} - -func (rule *PointCase) SetParameters(params []string) error { - return nil -} - -func (rule *PointCase) GetParameters() []string { - return nil -} - -func (rule *PointCase) GetExclusive() bool { - rule.RLock() - defer rule.RUnlock() - - return rule.exclusive -} - -// Validate checks if string is "point case" -// false if rune is no lowercase letter, digit or . -func (rule *PointCase) Validate(value string, fail bool) (bool, error) { - for _, c := range value { - if c == 46 || unicode.IsDigit(c) { // 46 => . - continue - } - - if !unicode.IsLetter(c) { - return false, nil - } - - if !unicode.IsLower(c) { - return false, nil - } - } - - return true, nil -} - -func (rule *PointCase) GetErrorMessage() string { - return rule.GetName() -} - -func (rule *PointCase) Copy() Rule { - return rule -} diff --git a/internal/rule/pointcase_test.go b/internal/rule/pointcase_test.go deleted file mode 100644 index b421578a..00000000 --- a/internal/rule/pointcase_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package rule - -import ( - "errors" - "testing" -) - -func TestPointCase(t *testing.T) { - var rule = new(PointCase).Init() - - var tests = []*ruleTest{ - {value: "point", expected: true, err: nil}, - {value: "pointcase", expected: true, err: nil}, - {value: "pointCase", expected: false, err: nil}, - {value: "Pointcase", expected: false, err: nil}, - {value: "PointCase", expected: false, err: nil}, - {value: "POINTCASE", expected: false, err: nil}, - {value: "point.case", expected: true, err: nil}, - {value: "point12.case", expected: true, err: nil}, - {value: "point.case.test", expected: true, err: nil}, - {value: "point-case-test", expected: false, err: nil}, - {value: "point_case_test", expected: false, err: nil}, - } - - var i = 0 - for _, test := range tests { - res, err := rule.Validate(test.value, true) - - if !errors.Is(err, test.err) { - t.Errorf("Test %d failed with unmatched error - %e", i, err) - return - } - - if res != test.expected { - t.Errorf("Test %d failed with unmatched return value - %+v", i, res) - return - } - - i++ - } -} diff --git a/internal/rule/rule.go b/internal/rule/rule.go index fbf91bf6..b3b3ceda 100644 --- a/internal/rule/rule.go +++ b/internal/rule/rule.go @@ -10,7 +10,6 @@ var RulesIndex = map[string]Rule{ "snakecase": new(SnakeCase).Init(), "screamingsnakecase": new(ScreamingSnakeCase).Init(), "kebabcase": new(KebabCase).Init(), - "pointcase": new(PointCase).Init(), } var Rules = map[string]Rule{ @@ -32,9 +31,6 @@ var Rules = map[string]Rule{ "kebabcase": RulesIndex["kebabcase"], "kebab-case": RulesIndex["kebabcase"], - - "pointcase": RulesIndex["pointcase"], - "point.case": RulesIndex["pointcase"], } type Rule interface { From bc001ee4e0a8d0557f0dc50e6d5624ffa4d16761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20L=C3=B6ffel?= Date: Tue, 29 Oct 2024 11:06:57 +0100 Subject: [PATCH 067/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 00a7e99f..38f8f9ca 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ An extremely fast directory and filename linter - Bring some structure to your p [![Go Report Card](https://goreportcard.com/badge/github.com/loeffel-io/ls-lint)](https://goreportcard.com/report/github.com/loeffel-io/ls-lint) Version ![npm](https://img.shields.io/npm/dy/@ls-lint/ls-lint?label=npm%20downloads) -![npm](https://badgen.net/static/npm%20downloads%20total/5M+/green) +![npm](https://badgen.net/static/npm%20downloads%20total/6M+/green) License - Minimal setup with simple rules managed in one single or multiple `.ls-lint.yml` files From c44ebff5ec198aaa7c88d3ccaddab33b0acede29 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:07:42 +0000 Subject: [PATCH 068/117] chore(deps): update dependency io_bazel_rules_go to v0.50.1 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 7ed17b19..a88f569a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -6,10 +6,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", - sha256 = "d93ef02f1e72c82d8bb3d5169519b36167b33cf68c252525e3b9d3d5dd143de7", + sha256 = "f4a9314518ca6acfa16cc4ab43b0b8ce1e4ea64b81c38d8a3772883f153346b8", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", ], ) From 85de4e3d9c8f6e6e277248f8bf7a27ff349f637e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:30:25 +0000 Subject: [PATCH 069/117] chore(deps): update dependency bazel to v7.4.1 --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index 468c41f9..6b0e58e7 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.2.1 \ No newline at end of file +7.4.1 \ No newline at end of file From bd52e8c1ca5ab99b6ba1b859ff3ec71c061a6283 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:26:36 +0000 Subject: [PATCH 070/117] chore(deps): update gcr.io/bazel-public/bazel docker digest to 35c1285 --- .github/workflows/bazel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index c0dee6c7..02c95dfc 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 + image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -24,7 +24,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest container: - image: gcr.io/bazel-public/bazel@sha256:65e2c7b5814b000163817ddcfedb16ce3abe4ddd745d683ad399cab14398e4e2 + image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: GH_TOKEN: ${{ github.token }} From cf7d591430936e7e764458a815c15f68993485f5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:26:47 +0000 Subject: [PATCH 071/117] chore(deps): update dependency bazel_gazelle to v0.40.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index a88f569a..ae1efca5 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,10 +15,10 @@ http_archive( http_archive( name = "bazel_gazelle", - sha256 = "d76bf7a60fd8b050444090dfa2837a4eaf9829e1165618ee35dceca5cbdf58d5", + sha256 = "a80893292ae1d78eaeedd50d1cab98f242a17e3d5741b1b9fb58b5fd9d2d57bc", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.40.0/bazel-gazelle-v0.40.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.40.0/bazel-gazelle-v0.40.0.tar.gz", ], ) From 1bc79acef491460388423c68b668e802aa90621e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:26:55 +0000 Subject: [PATCH 072/117] chore(deps): update dependency com_github_cli_cli_linux_amd64 to v2.62.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index a88f569a..a1d2dca5 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -121,10 +121,10 @@ http_archive( http_archive( name = "com_github_cli_cli_linux_amd64", build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "3ea6ed8b2585f406a064cecd7e1501e58f56c8e7ca764ae1f3483d1b8ed68826", - strip_prefix = "gh_2.52.0_linux_amd64", + sha256 = "41c8b0698ad3003cb5c44bde672a1ffd5f818595abd80162fbf8cc999418446a", + strip_prefix = "gh_2.62.0_linux_amd64", urls = [ - "https://github.com/cli/cli/releases/download/v2.52.0/gh_2.52.0_linux_amd64.tar.gz", + "https://github.com/cli/cli/releases/download/v2.62.0/gh_2.62.0_linux_amd64.tar.gz", ], ) From fa212d50de4ac63526ee077dfe25fd9023b63739 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:27:43 +0000 Subject: [PATCH 073/117] chore(deps): update dependency com_github_uutils_coreutils_darwin_arm64 to v0.0.28 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index ae1efca5..bfcf95ff 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -135,10 +135,10 @@ http_archive( http_archive( name = "com_github_uutils_coreutils_darwin_arm64", build_file_content = """exports_files(["coreutils"])""", - sha256 = "06301e1a027cfac2c22309a89023a47de94208bb673511f8f507059eb0eaf1ae", - strip_prefix = "coreutils-0.0.27-aarch64-apple-darwin", + sha256 = "bbd9b97fc38b9e8841feb93b5684f3587afb3d651a1cc91e46d00b1b0bcf28f6", + strip_prefix = "coreutils-0.0.28-aarch64-apple-darwin", urls = [ - "https://github.com/uutils/coreutils/releases/download/0.0.27/coreutils-0.0.27-aarch64-apple-darwin.tar.gz", # only amd64 + "https://github.com/uutils/coreutils/releases/download/0.0.28/coreutils-0.0.28-aarch64-apple-darwin.tar.gz", # only amd64 ], ) From c98e45c3dce71b8b624f0ea70942f834f42c3c73 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:27:47 +0000 Subject: [PATCH 074/117] chore(deps): update dependency com_github_uutils_coreutils_linux_amd64 to v0.0.28 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index ae1efca5..8d1d7b14 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -145,9 +145,9 @@ http_archive( http_archive( name = "com_github_uutils_coreutils_linux_amd64", build_file_content = """exports_files(["coreutils"])""", - sha256 = "02ab80c97c7849dc12b30ea21b3c06cf238563e9dbd72343373275871f4cb043", - strip_prefix = "coreutils-0.0.27-x86_64-unknown-linux-gnu", + sha256 = "e22a4a9179bbde667865917dc1399e4686a18159da35be6c1b78582c52a373a2", + strip_prefix = "coreutils-0.0.28-x86_64-unknown-linux-gnu", urls = [ - "https://github.com/uutils/coreutils/releases/download/0.0.27/coreutils-0.0.27-x86_64-unknown-linux-gnu.tar.gz", + "https://github.com/uutils/coreutils/releases/download/0.0.28/coreutils-0.0.28-x86_64-unknown-linux-gnu.tar.gz", ], ) From 2687e8a750f6061fce15bcea28e2a1533881b882 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:27:52 +0000 Subject: [PATCH 075/117] chore(deps): update dependency com_github_cli_cli_darwin_arm64 to v2.62.0 --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index ae1efca5..f5a26fa6 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -111,10 +111,10 @@ register_jq_toolchains() http_archive( name = "com_github_cli_cli_darwin_arm64", build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "c1c445154ede0707caf24907c74a153e397635ebb35887e73937de1f00dc0c10", - strip_prefix = "gh_2.52.0_macOS_arm64", + sha256 = "fdb77f31b8a6dd23c3fd858758d692a45f7fc76383e37d475bdcae038df92afc", + strip_prefix = "gh_2.62.0_macOS_arm64", urls = [ - "https://github.com/cli/cli/releases/download/v2.52.0/gh_2.52.0_macOS_arm64.zip", + "https://github.com/cli/cli/releases/download/v2.62.0/gh_2.62.0_macOS_arm64.zip", ], ) From 6217231354fb10c5415f10b2386b19efa585108d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 09:38:55 +0100 Subject: [PATCH 076/117] chore: bump deps --- MODULE.bazel.lock | 20 ++++++++++---------- WORKSPACE | 6 +++--- go.mod | 6 +++--- go.sum | 4 ++++ repositories.bzl | 8 ++++---- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index f5cd5310..d62a47c0 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -34,8 +34,8 @@ "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", - "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", - "https://bcr.bazel.build/modules/rules_java/7.6.1/source.json": "8f3f3076554e1558e8e468b2232991c510ecbcbed9e6f8c06ac31c93bcf38362", + "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", + "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35", "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", @@ -56,27 +56,27 @@ "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", - "https://bcr.bazel.build/modules/zlib/1.3/MODULE.bazel": "6a9c02f19a24dcedb05572b2381446e27c272cd383aed11d41d99da9e3167a72", - "https://bcr.bazel.build/modules/zlib/1.3/source.json": "b6b43d0737af846022636e6e255fd4a96fee0d34f08f3830e6e0bac51465c37c" + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d" }, "selectedYankedVersions": {}, "moduleExtensions": { "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { "general": { "bzlTransitiveDigest": "PjIds3feoYE8SGbbIq2SFTZy3zmxeO2tQevJZNDo7iY=", - "usagesDigest": "aLmqbvowmHkkBPve05yyDNGN7oh7QE9kBADr3QIZTZs=", + "usagesDigest": "+hz7IHWN6A1oVJJWNDB6yZRG+RYhF76wAYItpAeIUIg=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "local_config_apple_cc": { + "local_config_apple_cc_toolchains": { "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf", + "ruleClassName": "_apple_cc_autoconf_toolchains", "attributes": {} }, - "local_config_apple_cc_toolchains": { + "local_config_apple_cc": { "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf_toolchains", + "ruleClassName": "_apple_cc_autoconf", "attributes": {} } }, @@ -92,7 +92,7 @@ "@@platforms//host:extension.bzl%host_platform": { "general": { "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", - "usagesDigest": "meSzxn3DUCcYEhq4HQwExWkWtU4EjriRBQLsZN+Q0SU=", + "usagesDigest": "pCYpDQmqMbmiiPI1p2Kd3VLm5T48rRAht5WdW0X2GlA=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, diff --git a/WORKSPACE b/WORKSPACE index 921a9d59..563285b7 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,10 +15,10 @@ http_archive( http_archive( name = "bazel_gazelle", - sha256 = "a80893292ae1d78eaeedd50d1cab98f242a17e3d5741b1b9fb58b5fd9d2d57bc", + integrity = "sha256-LHVFzJFKQR5cFcPVWgpe00+/9i3vDh8Ktu0UvaIiw8w=", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.40.0/bazel-gazelle-v0.40.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.40.0/bazel-gazelle-v0.40.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.39.0/bazel-gazelle-v0.39.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.39.0/bazel-gazelle-v0.39.0.tar.gz", ], ) diff --git a/go.mod b/go.mod index bfe03a5e..fe30a4db 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/loeffel-io/ls-lint/v2 -go 1.22 +go 1.23.3 require ( - github.com/bmatcuk/doublestar/v4 v4.6.1 - golang.org/x/sync v0.7.0 + github.com/bmatcuk/doublestar/v4 v4.7.1 + golang.org/x/sync v0.9.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index eb4521ed..50bed50b 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,11 @@ github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= +github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/repositories.bzl b/repositories.bzl index a1d4319f..f3d0d426 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -4,8 +4,8 @@ def go_repositories(): go_repository( name = "com_github_bmatcuk_doublestar_v4", importpath = "github.com/bmatcuk/doublestar/v4", - sum = "h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=", - version = "v4.6.1", + sum = "h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q=", + version = "v4.7.1", ) go_repository( name = "in_gopkg_check_v1", @@ -22,6 +22,6 @@ def go_repositories(): go_repository( name = "org_golang_x_sync", importpath = "golang.org/x/sync", - sum = "h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=", - version = "v0.7.0", + sum = "h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=", + version = "v0.9.0", ) From 4255482acbfe2b11e548b0b0798e39189d557a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 11:17:35 +0100 Subject: [PATCH 077/117] chore: bzlmod migration --- .bazelversion | 2 +- BUILD.bazel | 16 +- LICENSE | 2 +- MODULE.bazel | 96 ++++- MODULE.bazel.lock | 794 ++++++++++++++++++++++++++++++++++-- WORKSPACE | 153 ------- cmd/ls_lint/BUILD.bazel | 4 +- go.sum | 4 - internal/config/BUILD.bazel | 2 +- internal/debug/BUILD.bazel | 2 +- internal/flag/BUILD.bazel | 2 +- internal/glob/BUILD.bazel | 2 +- internal/linter/BUILD.bazel | 2 +- internal/linter/linter.go | 31 +- internal/rule/BUILD.bazel | 2 +- nogo.json | 1 + repositories.bzl | 27 -- 17 files changed, 881 insertions(+), 261 deletions(-) delete mode 100644 WORKSPACE create mode 100644 nogo.json delete mode 100644 repositories.bzl diff --git a/.bazelversion b/.bazelversion index 6b0e58e7..bf035f2b 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.4.1 \ No newline at end of file +8.0.0rc2 diff --git a/BUILD.bazel b/BUILD.bazel index 5a842aa4..9c2f6f46 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,21 +1,11 @@ -load("@bazel_gazelle//:def.bzl", "gazelle") -load("@io_bazel_rules_go//go:def.bzl", "TOOLS_NOGO", "nogo") +load("@gazelle//:def.bzl", "gazelle") +load("@rules_go//go:def.bzl", "nogo") # gazelle:prefix github.com/loeffel-io/ls-lint/v2 # gazelle:exclude vendor # gazelle:exclude .idea gazelle(name = "gazelle") -gazelle( - name = "gazelle_update_repos", - args = [ - "--from_file=go.mod", - "--to_macro=repositories.bzl%go_repositories", - "--prune", - ], - command = "update-repos", -) - gazelle( name = "gazelle_fix_diff", command = "fix", @@ -34,7 +24,7 @@ nogo( name = "nogo", config = ":nogo.json", visibility = ["//visibility:public"], - deps = TOOLS_NOGO + [], + deps = [], # TOOLS_NOGO: https://github.com/bazel-contrib/rules_go/issues/3924 ) exports_files( diff --git a/LICENSE b/LICENSE index 8cb622c4..0dde7a9f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020-2024 Lucas Löffel +Copyright (c) 2020-2025 Lucas Löffel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/MODULE.bazel b/MODULE.bazel index 00bb1836..3a764ff2 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,90 @@ -############################################################################### -# Bazel now uses Bzlmod by default to manage external dependencies. -# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. -# -# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 -############################################################################### +bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "rules_go", version = "0.50.1") +bazel_dep(name = "gazelle", version = "0.40.0") +bazel_dep(name = "rules_pkg", version = "1.0.1") +bazel_dep(name = "aspect_bazel_lib", version = "2.9.4") +bazel_dep(name = "aspect_rules_js", version = "2.1.0") + +#################################################################### +# rules_go ######################################################### +#################################################################### + +go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") +go_sdk.download(version = "1.23.3") +go_sdk.nogo(nogo = "//:nogo") + +#################################################################### +# gazelle ########################################################## +# upgrade with bazel run @rules_go//go mod tidy && bazel mod tidy ## +#################################################################### + +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") +go_deps.from_file(go_mod = "//:go.mod") +use_repo( + go_deps, + "com_github_bmatcuk_doublestar_v4", + "in_gopkg_yaml_v3", + "org_golang_x_sync", +) + +#################################################################### +# rules_js ######################################################### +#################################################################### + +npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True) +npm.npm_translate_lock( + name = "npm", + npmrc = "//deployments/npm:.npmrc", + pnpm_lock = "//deployments/npm:pnpm-lock.yaml", +) +use_repo(npm, "npm") + +#################################################################### +# github cli ####################################################### +#################################################################### + +http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "com_github_cli_cli_darwin_arm64", + build_file_content = """exports_files(glob(["bin/*"]))""", + sha256 = "fdb77f31b8a6dd23c3fd858758d692a45f7fc76383e37d475bdcae038df92afc", + strip_prefix = "gh_2.62.0_macOS_arm64", + urls = [ + "https://github.com/cli/cli/releases/download/v2.62.0/gh_2.62.0_macOS_arm64.zip", + ], +) + +http_archive( + name = "com_github_cli_cli_linux_amd64", + build_file_content = """exports_files(glob(["bin/*"]))""", + sha256 = "41c8b0698ad3003cb5c44bde672a1ffd5f818595abd80162fbf8cc999418446a", + strip_prefix = "gh_2.62.0_linux_amd64", + urls = [ + "https://github.com/cli/cli/releases/download/v2.62.0/gh_2.62.0_linux_amd64.tar.gz", + ], +) + +#################################################################### +# coreutils (sha256) ############################################### +#################################################################### + +http_archive( + name = "com_github_uutils_coreutils_darwin_arm64", + build_file_content = """exports_files(["coreutils"])""", + sha256 = "bbd9b97fc38b9e8841feb93b5684f3587afb3d651a1cc91e46d00b1b0bcf28f6", + strip_prefix = "coreutils-0.0.28-aarch64-apple-darwin", + urls = [ + "https://github.com/uutils/coreutils/releases/download/0.0.28/coreutils-0.0.28-aarch64-apple-darwin.tar.gz", + ], +) + +http_archive( + name = "com_github_uutils_coreutils_linux_amd64", + build_file_content = """exports_files(["coreutils"])""", + sha256 = "e22a4a9179bbde667865917dc1399e4686a18159da35be6c1b78582c52a373a2", + strip_prefix = "coreutils-0.0.28-x86_64-unknown-linux-gnu", + urls = [ + "https://github.com/uutils/coreutils/releases/download/0.0.28/coreutils-0.0.28-x86_64-unknown-linux-gnu.tar.gz", + ], +) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index d62a47c0..0d670f01 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,88 +1,616 @@ { - "lockFileVersion": 11, + "lockFileVersion": 12, "registryFileHashes": { "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/source.json": "7e3a9adf473e9af076ae485ed649d5641ad50ec5c11718103f34de03170d94ad", - "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", - "https://bcr.bazel.build/modules/apple_support/1.5.0/source.json": "eb98a7627c0bc486b57f598ad8da50f6625d974c8f723e9ea71bd39f709c9862", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.7.7/MODULE.bazel": "491f8681205e31bb57892d67442ce448cda4f472a8e6b3dc062865e29a64f89c", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.9.4/MODULE.bazel": "ccc41028429f894b02fde7ef67d416cba3ba5084ed9ddb9bb6107aa82d118776", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.9.4/source.json": "9e20ebe57de2e7657a188af6e132a9562fa26c201b2d999bc0a8981e8f3b6c36", + "https://bcr.bazel.build/modules/aspect_rules_js/2.1.0/MODULE.bazel": "f747a24e13bc3c35c712580fc4e30186c54d80d21997b9503e29705e4d864533", + "https://bcr.bazel.build/modules/aspect_rules_js/2.1.0/source.json": "3a43843c6bd0ac65d118e72f504ff553a1ba1e65fec91938e5546effb4245104", + "https://bcr.bazel.build/modules/bazel_features/1.1.0/MODULE.bazel": "cfd42ff3b815a5f39554d97182657f8c4b9719568eb7fded2b9135f084bf760b", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", + "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", + "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/source.json": "cde886d88c8164b50b9b97dba7c0a64ca24d257b72ca3a2fcb06bee1fdb47ee4", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", - "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/source.json": "f121b43eeefc7c29efbd51b83d08631e2347297c95aac9764a701f2a6a2bb953", "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/gazelle/0.32.0/MODULE.bazel": "b499f58a5d0d3537f3cf5b76d8ada18242f64ec474d8391247438bf04f58c7b8", + "https://bcr.bazel.build/modules/gazelle/0.33.0/MODULE.bazel": "a13a0f279b462b784fb8dd52a4074526c4a2afe70e114c7d09066097a46b3350", + "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel": "abdd8ce4d70978933209db92e436deb3a8b737859e9354fb5fd11fb5c2004c8a", + "https://bcr.bazel.build/modules/gazelle/0.36.0/MODULE.bazel": "e375d5d6e9a6ca59b0cb38b0540bc9a05b6aa926d322f2de268ad267a2ee74c0", + "https://bcr.bazel.build/modules/gazelle/0.40.0/MODULE.bazel": "42ba5378ebe845fca43989a53186ab436d956db498acde790685fe0e8f9c6146", + "https://bcr.bazel.build/modules/gazelle/0.40.0/source.json": "1e5ef6e4d8b9b6836d93273c781e78ff829ea2e077afef7a57298040fa4f010a", + "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", - "https://bcr.bazel.build/modules/googletest/1.11.0/source.json": "c73d9ef4268c91bd0c1cd88f1f9dfa08e814b1dbe89b5f594a9f08ba0244d206", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/source.json": "41e9e129f80d8c8bf103a7acc337b76e54fad1214ac0a7084bf24f4cd924b8b4", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5", "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", - "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", - "https://bcr.bazel.build/modules/platforms/0.0.9/source.json": "cd74d854bf16a9e002fb2ca7b1a421f4403cda29f824a765acd3a8c56f8d43e6", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", - "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b", + "https://bcr.bazel.build/modules/protobuf/23.1/MODULE.bazel": "88b393b3eb4101d18129e5db51847cd40a5517a53e81216144a8c32dfeeca52a", + "https://bcr.bazel.build/modules/protobuf/24.4/MODULE.bazel": "7bc7ce5f2abf36b3b7b7c8218d3acdebb9426aeb35c2257c96445756f970eb12", + "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/source.json": "52101bfd37e38f0d159dee47b71ccbd1f22f7a32192cef5ef2533bb6212f410f", "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/protobuf/3.19.2/MODULE.bazel": "532ffe5f2186b69fdde039efe6df13ba726ff338c6bc82275ad433013fa10573", "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/source.json": "be4789e951dd5301282729fe3d4938995dc4c1a81c2ff150afc9f1b0504c6022", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2023-09-01/source.json": "e044ce89c2883cd957a2969a43e79f7752f9656f6b20050b62f90ede21ec6eb4", + "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e", "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/source.json": "506daed7caa38451517166af246c11650b21a7244c2b79f2cd43a27fae792a06", "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", - "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e", + "https://bcr.bazel.build/modules/rules_go/0.41.0/MODULE.bazel": "55861d8e8bb0e62cbd2896f60ff303f62ffcb0eddb74ecb0e5c0cbe36fc292c8", + "https://bcr.bazel.build/modules/rules_go/0.42.0/MODULE.bazel": "8cfa875b9aa8c6fce2b2e5925e73c1388173ea3c32a0db4d2b4804b453c14270", + "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel": "3477df8bdcc49e698b9d25f734c4f3a9f5931ff34ee48a2c662be168f5f2d3fd", + "https://bcr.bazel.build/modules/rules_go/0.50.1/MODULE.bazel": "b91a308dc5782bb0a8021ad4330c81fea5bda77f96b9e4c117b9b9c8f6665ee0", + "https://bcr.bazel.build/modules/rules_go/0.50.1/source.json": "205765fd30216c70321f84c9a967267684bdc74350af3f3c46c857d9f80a4fa2", "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", - "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", - "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d", + "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.3.0/MODULE.bazel": "a97c7678c19f236a956ad260d59c86e10a463badb7eb2eda787490f4c969b963", + "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", + "https://bcr.bazel.build/modules/rules_java/7.1.0/MODULE.bazel": "30d9135a2b6561c761bd67bd4990da591e6bdc128790ce3e7afd6a3558b2fb64", + "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", + "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.2.0/MODULE.bazel": "6ed551110d53e66eca041a9e41835a4e66ad9c988ae49897dd0c66d87e107dcc", + "https://bcr.bazel.build/modules/rules_java/8.2.0/source.json": "9a10ea55c608da3148fe642c201bc8a12df70af5b3131835cec7b004fec053d1", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", - "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35", + "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", + "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", - "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", + "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", + "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", + "https://bcr.bazel.build/modules/rules_nodejs/6.3.0/MODULE.bazel": "45345e4aba35dd6e4701c1eebf5a4e67af4ed708def9ebcdc6027585b34ee52d", + "https://bcr.bazel.build/modules/rules_nodejs/6.3.0/source.json": "1254ffd8d0d908a19c67add7fb5e2a1f604df133bc5d206425264293e2e537fc", "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/source.json": "d57902c052424dfda0e71646cb12668d39c4620ee0544294d9d941e7d12bc3a9", + "https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483", + "https://bcr.bazel.build/modules/rules_proto/6.0.0/MODULE.bazel": "b531d7f09f58dce456cd61b4579ce8c86b38544da75184eadaf0a7cb7966453f", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/source.json": "17a2e195f56cb28d6bbf763e49973d13890487c6945311ed141e196fb660426d", "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", - "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7", - "https://bcr.bazel.build/modules/rules_python/0.22.1/source.json": "57226905e783bae7c37c2dd662be078728e48fa28ee4324a7eabcafb5a43d014", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", + "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", + "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", + "https://bcr.bazel.build/modules/rules_python/0.36.0/MODULE.bazel": "a4ce1ccea92b9106c7d16ab9ee51c6183107e78ba4a37aa65055227b80cd480c", + "https://bcr.bazel.build/modules/rules_python/0.36.0/source.json": "b79cbb7b2ae1751949e2f6ee6692822e4ffd13ca1e959ce99abec4ac7666162a", "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/source.json": "7f27af3c28037d9701487c4744b5448d26537cc66cdef0d8df7ae85411f8de95", "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", - "https://bcr.bazel.build/modules/stardoc/0.5.1/source.json": "a96f95e02123320aa015b956f29c00cb818fa891ef823d55148e1a362caacf29", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.5.4/MODULE.bazel": "6569966df04610b8520957cb8e97cf2e9faac2c0309657c537ab51c16c18a2a4", + "https://bcr.bazel.build/modules/stardoc/0.6.2/MODULE.bazel": "7060193196395f5dd668eda046ccbeacebfd98efc77fed418dbe2b82ffaa39fd", + "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", + "https://bcr.bazel.build/modules/stardoc/0.7.0/source.json": "e3c524bf2ef20992539ce2bc4a2243f4853130209ee831689983e28d05769099", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", + "https://bcr.bazel.build/modules/upb/0.0.0-20230516-61a97ef/MODULE.bazel": "c0df5e35ad55e264160417fd0875932ee3c9dda63d9fccace35ac62f45e1b6f9", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d" + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d", + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198" }, "selectedYankedVersions": {}, "moduleExtensions": { - "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { + "@@aspect_bazel_lib+//lib:extensions.bzl%toolchains": { "general": { - "bzlTransitiveDigest": "PjIds3feoYE8SGbbIq2SFTZy3zmxeO2tQevJZNDo7iY=", - "usagesDigest": "+hz7IHWN6A1oVJJWNDB6yZRG+RYhF76wAYItpAeIUIg=", + "bzlTransitiveDigest": "I5Dn8KaM+QmZIvJc+N3i0dYz3X84t93U2VDZwDhbBYw=", + "usagesDigest": "YYPqHeJhWOHJ+KijY0m1OXK4GOMb/VlvjAzRdUPiSTA=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "local_config_apple_cc_toolchains": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf_toolchains", + "copy_directory_darwin_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", + "ruleClassName": "copy_directory_platform_repo", + "attributes": { + "platform": "darwin_amd64" + } + }, + "copy_directory_darwin_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", + "ruleClassName": "copy_directory_platform_repo", + "attributes": { + "platform": "darwin_arm64" + } + }, + "copy_directory_freebsd_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", + "ruleClassName": "copy_directory_platform_repo", + "attributes": { + "platform": "freebsd_amd64" + } + }, + "copy_directory_linux_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", + "ruleClassName": "copy_directory_platform_repo", + "attributes": { + "platform": "linux_amd64" + } + }, + "copy_directory_linux_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", + "ruleClassName": "copy_directory_platform_repo", + "attributes": { + "platform": "linux_arm64" + } + }, + "copy_directory_windows_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", + "ruleClassName": "copy_directory_platform_repo", + "attributes": { + "platform": "windows_amd64" + } + }, + "copy_directory_toolchains": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", + "ruleClassName": "copy_directory_toolchains_repo", + "attributes": { + "user_repository_name": "copy_directory" + } + }, + "copy_to_directory_darwin_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", + "ruleClassName": "copy_to_directory_platform_repo", + "attributes": { + "platform": "darwin_amd64" + } + }, + "copy_to_directory_darwin_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", + "ruleClassName": "copy_to_directory_platform_repo", + "attributes": { + "platform": "darwin_arm64" + } + }, + "copy_to_directory_freebsd_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", + "ruleClassName": "copy_to_directory_platform_repo", + "attributes": { + "platform": "freebsd_amd64" + } + }, + "copy_to_directory_linux_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", + "ruleClassName": "copy_to_directory_platform_repo", + "attributes": { + "platform": "linux_amd64" + } + }, + "copy_to_directory_linux_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", + "ruleClassName": "copy_to_directory_platform_repo", + "attributes": { + "platform": "linux_arm64" + } + }, + "copy_to_directory_windows_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", + "ruleClassName": "copy_to_directory_platform_repo", + "attributes": { + "platform": "windows_amd64" + } + }, + "copy_to_directory_toolchains": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", + "ruleClassName": "copy_to_directory_toolchains_repo", + "attributes": { + "user_repository_name": "copy_to_directory" + } + }, + "jq_darwin_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", + "ruleClassName": "jq_platform_repo", + "attributes": { + "platform": "darwin_amd64", + "version": "1.7" + } + }, + "jq_darwin_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", + "ruleClassName": "jq_platform_repo", + "attributes": { + "platform": "darwin_arm64", + "version": "1.7" + } + }, + "jq_linux_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", + "ruleClassName": "jq_platform_repo", + "attributes": { + "platform": "linux_amd64", + "version": "1.7" + } + }, + "jq_linux_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", + "ruleClassName": "jq_platform_repo", + "attributes": { + "platform": "linux_arm64", + "version": "1.7" + } + }, + "jq_windows_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", + "ruleClassName": "jq_platform_repo", + "attributes": { + "platform": "windows_amd64", + "version": "1.7" + } + }, + "jq": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", + "ruleClassName": "jq_host_alias_repo", "attributes": {} }, - "local_config_apple_cc": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf", + "jq_toolchains": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", + "ruleClassName": "jq_toolchains_repo", + "attributes": { + "user_repository_name": "jq" + } + }, + "yq_darwin_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", + "ruleClassName": "yq_platform_repo", + "attributes": { + "platform": "darwin_amd64", + "version": "4.25.2" + } + }, + "yq_darwin_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", + "ruleClassName": "yq_platform_repo", + "attributes": { + "platform": "darwin_arm64", + "version": "4.25.2" + } + }, + "yq_linux_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", + "ruleClassName": "yq_platform_repo", + "attributes": { + "platform": "linux_amd64", + "version": "4.25.2" + } + }, + "yq_linux_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", + "ruleClassName": "yq_platform_repo", + "attributes": { + "platform": "linux_arm64", + "version": "4.25.2" + } + }, + "yq_linux_s390x": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", + "ruleClassName": "yq_platform_repo", + "attributes": { + "platform": "linux_s390x", + "version": "4.25.2" + } + }, + "yq_linux_ppc64le": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", + "ruleClassName": "yq_platform_repo", + "attributes": { + "platform": "linux_ppc64le", + "version": "4.25.2" + } + }, + "yq_windows_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", + "ruleClassName": "yq_platform_repo", + "attributes": { + "platform": "windows_amd64", + "version": "4.25.2" + } + }, + "yq": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", + "ruleClassName": "yq_host_alias_repo", "attributes": {} + }, + "yq_toolchains": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", + "ruleClassName": "yq_toolchains_repo", + "attributes": { + "user_repository_name": "yq" + } + }, + "coreutils_darwin_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", + "ruleClassName": "coreutils_platform_repo", + "attributes": { + "platform": "darwin_amd64", + "version": "0.0.27" + } + }, + "coreutils_darwin_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", + "ruleClassName": "coreutils_platform_repo", + "attributes": { + "platform": "darwin_arm64", + "version": "0.0.27" + } + }, + "coreutils_linux_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", + "ruleClassName": "coreutils_platform_repo", + "attributes": { + "platform": "linux_amd64", + "version": "0.0.27" + } + }, + "coreutils_linux_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", + "ruleClassName": "coreutils_platform_repo", + "attributes": { + "platform": "linux_arm64", + "version": "0.0.27" + } + }, + "coreutils_windows_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", + "ruleClassName": "coreutils_platform_repo", + "attributes": { + "platform": "windows_amd64", + "version": "0.0.27" + } + }, + "coreutils_toolchains": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", + "ruleClassName": "coreutils_toolchains_repo", + "attributes": { + "user_repository_name": "coreutils" + } + }, + "bsd_tar_darwin_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", + "ruleClassName": "bsdtar_binary_repo", + "attributes": { + "platform": "darwin_amd64" + } + }, + "bsd_tar_darwin_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", + "ruleClassName": "bsdtar_binary_repo", + "attributes": { + "platform": "darwin_arm64" + } + }, + "bsd_tar_linux_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", + "ruleClassName": "bsdtar_binary_repo", + "attributes": { + "platform": "linux_amd64" + } + }, + "bsd_tar_linux_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", + "ruleClassName": "bsdtar_binary_repo", + "attributes": { + "platform": "linux_arm64" + } + }, + "bsd_tar_windows_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", + "ruleClassName": "bsdtar_binary_repo", + "attributes": { + "platform": "windows_amd64" + } + }, + "bsd_tar_toolchains": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", + "ruleClassName": "tar_toolchains_repo", + "attributes": { + "user_repository_name": "bsd_tar" + } + }, + "zstd_darwin_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", + "ruleClassName": "zstd_binary_repo", + "attributes": { + "platform": "darwin_amd64" + } + }, + "zstd_darwin_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", + "ruleClassName": "zstd_binary_repo", + "attributes": { + "platform": "darwin_arm64" + } + }, + "zstd_linux_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", + "ruleClassName": "zstd_binary_repo", + "attributes": { + "platform": "linux_amd64" + } + }, + "zstd_linux_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", + "ruleClassName": "zstd_binary_repo", + "attributes": { + "platform": "linux_arm64" + } + }, + "zstd_toolchains": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", + "ruleClassName": "zstd_toolchains_repo", + "attributes": { + "user_repository_name": "zstd" + } + }, + "expand_template_darwin_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", + "ruleClassName": "expand_template_platform_repo", + "attributes": { + "platform": "darwin_amd64" + } + }, + "expand_template_darwin_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", + "ruleClassName": "expand_template_platform_repo", + "attributes": { + "platform": "darwin_arm64" + } + }, + "expand_template_freebsd_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", + "ruleClassName": "expand_template_platform_repo", + "attributes": { + "platform": "freebsd_amd64" + } + }, + "expand_template_linux_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", + "ruleClassName": "expand_template_platform_repo", + "attributes": { + "platform": "linux_amd64" + } + }, + "expand_template_linux_arm64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", + "ruleClassName": "expand_template_platform_repo", + "attributes": { + "platform": "linux_arm64" + } + }, + "expand_template_windows_amd64": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", + "ruleClassName": "expand_template_platform_repo", + "attributes": { + "platform": "windows_amd64" + } + }, + "expand_template_toolchains": { + "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", + "ruleClassName": "expand_template_toolchains_repo", + "attributes": { + "user_repository_name": "expand_template" + } + }, + "bats_support": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "7815237aafeb42ddcc1b8c698fc5808026d33317d8701d5ec2396e9634e2918f", + "urls": [ + "https://github.com/bats-core/bats-support/archive/v0.3.0.tar.gz" + ], + "strip_prefix": "bats-support-0.3.0", + "build_file_content": "load(\"@aspect_bazel_lib//lib:copy_to_directory.bzl\", \"copy_to_directory\")\n\ncopy_to_directory(\n name = \"support\",\n hardlink = \"on\",\n srcs = glob([\n \"src/**\",\n \"load.bash\",\n ]),\n out = \"bats-support\",\n visibility = [\"//visibility:public\"]\n)\n" + } + }, + "bats_assert": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "98ca3b685f8b8993e48ec057565e6e2abcc541034ed5b0e81f191505682037fd", + "urls": [ + "https://github.com/bats-core/bats-assert/archive/v2.1.0.tar.gz" + ], + "strip_prefix": "bats-assert-2.1.0", + "build_file_content": "load(\"@aspect_bazel_lib//lib:copy_to_directory.bzl\", \"copy_to_directory\")\n\ncopy_to_directory(\n name = \"assert\",\n hardlink = \"on\",\n srcs = glob([\n \"src/**\",\n \"load.bash\",\n ]),\n out = \"bats-assert\",\n visibility = [\"//visibility:public\"]\n)\n" + } + }, + "bats_file": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "9b69043241f3af1c2d251f89b4fcafa5df3f05e97b89db18d7c9bdf5731bb27a", + "urls": [ + "https://github.com/bats-core/bats-file/archive/v0.4.0.tar.gz" + ], + "strip_prefix": "bats-file-0.4.0", + "build_file_content": "load(\"@aspect_bazel_lib//lib:copy_to_directory.bzl\", \"copy_to_directory\")\n\ncopy_to_directory(\n name = \"file\",\n hardlink = \"on\",\n srcs = glob([\n \"src/**\",\n \"load.bash\",\n ]),\n out = \"bats-file\",\n visibility = [\"//visibility:public\"]\n)\n" + } + }, + "bats_toolchains": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "a1a9f7875aa4b6a9480ca384d5865f1ccf1b0b1faead6b47aa47d79709a5c5fd", + "urls": [ + "https://github.com/bats-core/bats-core/archive/v1.10.0.tar.gz" + ], + "strip_prefix": "bats-core-1.10.0", + "build_file_content": "load(\"@local_config_platform//:constraints.bzl\", \"HOST_CONSTRAINTS\")\nload(\"@aspect_bazel_lib//lib/private:bats_toolchain.bzl\", \"bats_toolchain\")\nload(\"@aspect_bazel_lib//lib:copy_to_directory.bzl\", \"copy_to_directory\")\n\ncopy_to_directory(\n name = \"core\",\n hardlink = \"on\",\n srcs = glob([\n \"lib/**\",\n \"libexec/**\"\n ]) + [\"bin/bats\"],\n out = \"bats-core\",\n)\n\nbats_toolchain(\n name = \"toolchain\",\n core = \":core\",\n libraries = [\"@bats_support//:support\", \"@bats_assert//:assert\", \"@bats_file//:file\"]\n)\n\ntoolchain(\n name = \"bats_toolchain\",\n exec_compatible_with = HOST_CONSTRAINTS,\n toolchain = \":toolchain\",\n toolchain_type = \"@aspect_bazel_lib//lib:bats_toolchain_type\",\n)\n" + } } }, "recordedRepoMappingEntries": [ [ - "apple_support~", + "aspect_bazel_lib+", + "aspect_bazel_lib", + "aspect_bazel_lib+" + ], + [ + "aspect_bazel_lib+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "aspect_bazel_lib+", "bazel_tools", "bazel_tools" ] @@ -92,7 +620,7 @@ "@@platforms//host:extension.bzl%host_platform": { "general": { "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", - "usagesDigest": "pCYpDQmqMbmiiPI1p2Kd3VLm5T48rRAht5WdW0X2GlA=", + "usagesDigest": "8W6Zg78qF8FKyH5W6tdCEg4ggAxf1blvO14DM0+KEnM=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -105,6 +633,206 @@ }, "recordedRepoMappingEntries": [] } + }, + "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { + "general": { + "bzlTransitiveDigest": "Nw+JSQUn0q8PZ9L+AACqdvNxzdn8VPWq4KgCeLdtYg0=", + "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "com_github_jetbrains_kotlin_git": { + "bzlFile": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl", + "ruleClassName": "kotlin_compiler_git_repository", + "attributes": { + "urls": [ + "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" + ], + "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88" + } + }, + "com_github_jetbrains_kotlin": { + "bzlFile": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl", + "ruleClassName": "kotlin_capabilities_repository", + "attributes": { + "git_repository_name": "com_github_jetbrains_kotlin_git", + "compiler_version": "1.9.23" + } + }, + "com_github_google_ksp": { + "bzlFile": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl", + "ruleClassName": "ksp_compiler_plugin_repository", + "attributes": { + "urls": [ + "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" + ], + "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d", + "strip_version": "1.9.23-1.0.20" + } + }, + "com_github_pinterest_ktlint": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", + "urls": [ + "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint" + ], + "executable": true + } + }, + "rules_android": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + "strip_prefix": "rules_android-0.1.1", + "urls": [ + "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_kotlin+", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_nodejs+//nodejs:extensions.bzl%node": { + "general": { + "bzlTransitiveDigest": "SqbzUarOVzAfK28Ca5+NIU3LUwnW/b3h0xXBUS97oyI=", + "usagesDigest": "34/6ou8eW2MB82HSiYBcfVzZkGk1rL1teO3wuFqFAe0=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "nodejs_linux_amd64": { + "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", + "ruleClassName": "_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "18.20.4", + "include_headers": false, + "platform": "linux_amd64" + } + }, + "nodejs_linux_arm64": { + "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", + "ruleClassName": "_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "18.20.4", + "include_headers": false, + "platform": "linux_arm64" + } + }, + "nodejs_linux_s390x": { + "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", + "ruleClassName": "_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "18.20.4", + "include_headers": false, + "platform": "linux_s390x" + } + }, + "nodejs_linux_ppc64le": { + "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", + "ruleClassName": "_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "18.20.4", + "include_headers": false, + "platform": "linux_ppc64le" + } + }, + "nodejs_darwin_amd64": { + "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", + "ruleClassName": "_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "18.20.4", + "include_headers": false, + "platform": "darwin_amd64" + } + }, + "nodejs_darwin_arm64": { + "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", + "ruleClassName": "_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "18.20.4", + "include_headers": false, + "platform": "darwin_arm64" + } + }, + "nodejs_windows_amd64": { + "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", + "ruleClassName": "_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "18.20.4", + "include_headers": false, + "platform": "windows_amd64" + } + }, + "nodejs": { + "bzlFile": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl", + "ruleClassName": "nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "nodejs" + } + }, + "nodejs_host": { + "bzlFile": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl", + "ruleClassName": "nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "nodejs" + } + }, + "nodejs_toolchains": { + "bzlFile": "@@rules_nodejs+//nodejs/private:nodejs_toolchains_repo.bzl", + "ruleClassName": "nodejs_toolchains_repo", + "attributes": { + "user_node_repository_name": "nodejs" + } + } + }, + "recordedRepoMappingEntries": [] + } } } } diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 563285b7..00000000 --- a/WORKSPACE +++ /dev/null @@ -1,153 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -############################################################ -# http archives ############################################ -############################################################ - -http_archive( - name = "io_bazel_rules_go", - sha256 = "f4a9314518ca6acfa16cc4ab43b0b8ce1e4ea64b81c38d8a3772883f153346b8", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", - ], -) - -http_archive( - name = "bazel_gazelle", - integrity = "sha256-LHVFzJFKQR5cFcPVWgpe00+/9i3vDh8Ktu0UvaIiw8w=", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.39.0/bazel-gazelle-v0.39.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.39.0/bazel-gazelle-v0.39.0.tar.gz", - ], -) - -http_archive( - name = "rules_pkg", - sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", - urls = [ - "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", - ], -) - -http_archive( - name = "aspect_rules_js", - sha256 = "2cfb3875e1231cefd3fada6774f2c0c5a99db0070e0e48ea398acbff7c6c765b", - strip_prefix = "rules_js-1.42.3", - url = "https://github.com/aspect-build/rules_js/releases/download/v1.42.3/rules_js-v1.42.3.tar.gz", -) - -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") - -############################################################ -# custom repositories ###################################### -############################################################ - -load("//:repositories.bzl", "go_repositories") - -# gazelle:repository_macro repositories.bzl%go_repositories -go_repositories() - -############################################################ -# go ####################################################### -############################################################ - -go_rules_dependencies() - -go_register_toolchains(version = "1.22.5") - -############################################################ -# gazelle ################################################## -############################################################ - -gazelle_dependencies() - -############################################################ -# rules_pkg ################################################ -############################################################ - -load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") - -rules_pkg_dependencies() - -############################################################ -# rules_js ################################################# -############################################################ - -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") - -rules_js_dependencies() - -load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") - -nodejs_register_toolchains( - name = "nodejs", - node_version = DEFAULT_NODE_VERSION, -) - -load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock", "pnpm_repository") - -npm_translate_lock( - name = "npm", - npmrc = "//deployments/npm:.npmrc", - pnpm_lock = "//deployments/npm:pnpm-lock.yaml", -) - -load("@npm//:repositories.bzl", "npm_repositories") - -npm_repositories() - -pnpm_repository(name = "pnpm") - -load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains") - -register_jq_toolchains() - -############################################################ -# github cli ############################################### -############################################################ - -http_archive( - name = "com_github_cli_cli_darwin_arm64", - build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "fdb77f31b8a6dd23c3fd858758d692a45f7fc76383e37d475bdcae038df92afc", - strip_prefix = "gh_2.62.0_macOS_arm64", - urls = [ - "https://github.com/cli/cli/releases/download/v2.62.0/gh_2.62.0_macOS_arm64.zip", - ], -) - -http_archive( - name = "com_github_cli_cli_linux_amd64", - build_file_content = """exports_files(glob(["bin/*"]))""", - sha256 = "41c8b0698ad3003cb5c44bde672a1ffd5f818595abd80162fbf8cc999418446a", - strip_prefix = "gh_2.62.0_linux_amd64", - urls = [ - "https://github.com/cli/cli/releases/download/v2.62.0/gh_2.62.0_linux_amd64.tar.gz", - ], -) - -############################################################ -# coreutils (sha256) ####################################### -############################################################ - -http_archive( - name = "com_github_uutils_coreutils_darwin_arm64", - build_file_content = """exports_files(["coreutils"])""", - sha256 = "bbd9b97fc38b9e8841feb93b5684f3587afb3d651a1cc91e46d00b1b0bcf28f6", - strip_prefix = "coreutils-0.0.28-aarch64-apple-darwin", - urls = [ - "https://github.com/uutils/coreutils/releases/download/0.0.28/coreutils-0.0.28-aarch64-apple-darwin.tar.gz", # only amd64 - ], -) - -http_archive( - name = "com_github_uutils_coreutils_linux_amd64", - build_file_content = """exports_files(["coreutils"])""", - sha256 = "e22a4a9179bbde667865917dc1399e4686a18159da35be6c1b78582c52a373a2", - strip_prefix = "coreutils-0.0.28-x86_64-unknown-linux-gnu", - urls = [ - "https://github.com/uutils/coreutils/releases/download/0.0.28/coreutils-0.0.28-x86_64-unknown-linux-gnu.tar.gz", - ], -) diff --git a/cmd/ls_lint/BUILD.bazel b/cmd/ls_lint/BUILD.bazel index 84ca2c91..3311a3b5 100644 --- a/cmd/ls_lint/BUILD.bazel +++ b/cmd/ls_lint/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_binary", "go_library") load("@rules_pkg//pkg:tar.bzl", "pkg_tar") load(":target.bzl", "targets") @@ -21,6 +21,7 @@ go_binary( name = "ls-lint", embed = [":ls_lint_lib"], pure = "on", + static = "on", visibility = ["//visibility:public"], x_defs = {"Version": "{STABLE_GIT_TAG}"}, ) @@ -32,6 +33,7 @@ go_binary( goarch = goarch, goos = goos, pure = "on", + static = "on", visibility = ["//visibility:public"], x_defs = {"Version": "{STABLE_GIT_TAG}"}, ) diff --git a/go.sum b/go.sum index 50bed50b..c7482ee7 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,5 @@ -github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= -github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/internal/config/BUILD.bazel b/internal/config/BUILD.bazel index 8a170b2c..d86febf9 100644 --- a/internal/config/BUILD.bazel +++ b/internal/config/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "config", diff --git a/internal/debug/BUILD.bazel b/internal/debug/BUILD.bazel index 3ab122cb..ca6c52fa 100644 --- a/internal/debug/BUILD.bazel +++ b/internal/debug/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "debug", diff --git a/internal/flag/BUILD.bazel b/internal/flag/BUILD.bazel index 33619820..b8589e55 100644 --- a/internal/flag/BUILD.bazel +++ b/internal/flag/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "flag", diff --git a/internal/glob/BUILD.bazel b/internal/glob/BUILD.bazel index f282b30a..faf8ac2c 100644 --- a/internal/glob/BUILD.bazel +++ b/internal/glob/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "glob", diff --git a/internal/linter/BUILD.bazel b/internal/linter/BUILD.bazel index a95909d6..355f9225 100644 --- a/internal/linter/BUILD.bazel +++ b/internal/linter/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "linter", diff --git a/internal/linter/linter.go b/internal/linter/linter.go index 4f5c68e7..898631fd 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -2,17 +2,18 @@ package linter import ( "fmt" - "github.com/loeffel-io/ls-lint/v2/internal/config" - "github.com/loeffel-io/ls-lint/v2/internal/debug" - "github.com/loeffel-io/ls-lint/v2/internal/glob" - "github.com/loeffel-io/ls-lint/v2/internal/rule" - "golang.org/x/sync/errgroup" "io/fs" "math" "path/filepath" "strings" "sync" "time" + + "github.com/loeffel-io/ls-lint/v2/internal/config" + "github.com/loeffel-io/ls-lint/v2/internal/debug" + "github.com/loeffel-io/ls-lint/v2/internal/glob" + "github.com/loeffel-io/ls-lint/v2/internal/rule" + "golang.org/x/sync/errgroup" ) const ( @@ -66,11 +67,11 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate return indexDir, dir, nil } - var g = new(errgroup.Group) + g := new(errgroup.Group) var rulesNonExclusiveCount int8 var rulesNonExclusiveError int8 - var rulesMutex = new(sync.Mutex) + rulesMutex := new(sync.Mutex) var pathDir string if pathDir = path; pathDir == "." { @@ -94,7 +95,6 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate } valid, err := ruleDir.Validate(basename, ruleDir.GetName() != "exists") - if err != nil { return err } @@ -132,11 +132,11 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate func (linter *Linter) validateFile(index config.RuleIndex, path string, validate bool) (string, string, error) { var ext string - var g = new(errgroup.Group) + g := new(errgroup.Group) var rulesNonExclusiveCount int8 var rulesNonExclusiveError int8 - var rulesMutex = new(sync.Mutex) + rulesMutex := new(sync.Mutex) exts := strings.Split(filepath.Base(path), extSep)[1:] indexDir, rules := linter.config.GetConfig(index, path) @@ -146,8 +146,8 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate pathDir = "" } - var n = len(exts) - var maxCombinations = int(math.Pow(2, float64(n))) // 2^N combinations + n := len(exts) + maxCombinations := int(math.Pow(2, float64(n))) // 2^N combinations var withoutExt string for i := 0; i < maxCombinations; i++ { @@ -178,7 +178,6 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate } valid, err := ruleFile.Validate(withoutExt, ruleFile.GetName() != "exists") - if err != nil { return err } @@ -237,7 +236,7 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]struct{}, debug boo } // glob ignore index - var ignoreIndex = linter.config.GetIgnoreIndex() + ignoreIndex := linter.config.GetIgnoreIndex() if err = glob.IgnoreIndex(filesystem, ignoreIndex, true); err != nil { return err } @@ -253,7 +252,7 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]struct{}, debug boo } for ext, rules := range pathIndex { - var tmpRules = make([]string, 0) + tmpRules := make([]string, 0) for _, tmpRule := range rules { if len(tmpRule.GetParameters()) > 0 { tmpRules = append(tmpRules, fmt.Sprintf("%s:%s", tmpRule.GetName(), strings.Join(tmpRule.GetParameters(), ","))) @@ -312,7 +311,7 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]struct{}, debug boo } var indexDir, ext string - var validate = len(paths) == 0 + validate := len(paths) == 0 if _, ok := paths[path]; !validate { validate = ok } diff --git a/internal/rule/BUILD.bazel b/internal/rule/BUILD.bazel index 5cac7909..261b8dab 100644 --- a/internal/rule/BUILD.bazel +++ b/internal/rule/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "rule", diff --git a/nogo.json b/nogo.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/nogo.json @@ -0,0 +1 @@ +{} diff --git a/repositories.bzl b/repositories.bzl deleted file mode 100644 index f3d0d426..00000000 --- a/repositories.bzl +++ /dev/null @@ -1,27 +0,0 @@ -load("@bazel_gazelle//:deps.bzl", "go_repository") - -def go_repositories(): - go_repository( - name = "com_github_bmatcuk_doublestar_v4", - importpath = "github.com/bmatcuk/doublestar/v4", - sum = "h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q=", - version = "v4.7.1", - ) - go_repository( - name = "in_gopkg_check_v1", - importpath = "gopkg.in/check.v1", - sum = "h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=", - version = "v0.0.0-20161208181325-20d25e280405", - ) - go_repository( - name = "in_gopkg_yaml_v3", - importpath = "gopkg.in/yaml.v3", - sum = "h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=", - version = "v3.0.1", - ) - go_repository( - name = "org_golang_x_sync", - importpath = "golang.org/x/sync", - sum = "h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=", - version = "v0.9.0", - ) From e6b6316a875cb1b5ed45b97267b814a347c83bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 11:19:47 +0100 Subject: [PATCH 078/117] chore: gofmt --- cmd/ls_lint/main.go | 39 ++++++++++++------------ internal/config/config.go | 17 ++++++----- internal/config/config_test.go | 15 ++++----- internal/glob/glob.go | 5 +-- internal/linter/linter_test.go | 17 ++++++----- internal/rule/camelcase_test.go | 6 ++-- internal/rule/exists.go | 4 +-- internal/rule/exists_test.go | 12 ++++---- internal/rule/kebabcase_test.go | 6 ++-- internal/rule/lowercase_test.go | 6 ++-- internal/rule/pascalcase_test.go | 6 ++-- internal/rule/regex.go | 2 +- internal/rule/regex_test.go | 6 ++-- internal/rule/screamingsnakecase_test.go | 6 ++-- internal/rule/snakecase_test.go | 6 ++-- 15 files changed, 80 insertions(+), 73 deletions(-) diff --git a/cmd/ls_lint/main.go b/cmd/ls_lint/main.go index b8513064..4053511f 100644 --- a/cmd/ls_lint/main.go +++ b/cmd/ls_lint/main.go @@ -4,32 +4,33 @@ import ( "encoding/json" "flag" "fmt" - "github.com/loeffel-io/ls-lint/v2/internal/config" - "github.com/loeffel-io/ls-lint/v2/internal/debug" - _flag "github.com/loeffel-io/ls-lint/v2/internal/flag" - "github.com/loeffel-io/ls-lint/v2/internal/linter" - "github.com/loeffel-io/ls-lint/v2/internal/rule" - "gopkg.in/yaml.v3" "log" "maps" "os" "runtime" "slices" "strings" + + "github.com/loeffel-io/ls-lint/v2/internal/config" + "github.com/loeffel-io/ls-lint/v2/internal/debug" + _flag "github.com/loeffel-io/ls-lint/v2/internal/flag" + "github.com/loeffel-io/ls-lint/v2/internal/linter" + "github.com/loeffel-io/ls-lint/v2/internal/rule" + "gopkg.in/yaml.v3" ) var Version = "dev" func main() { var err error - var exitCode = 0 - var writer = os.Stdout - var flags = flag.NewFlagSet(os.Args[0], flag.ExitOnError) - var flagWorkdir = flags.String("workdir", ".", "change working directory before executing the given subcommand") - var flagErrorOutputFormat = flags.String("error-output-format", "text", "use a specific error output format (text, json)") - var flagWarn = flags.Bool("warn", false, "write lint errors to stdout instead of stderr (exit 0)") - var flagDebug = flags.Bool("debug", false, "write debug informations to stdout") - var flagVersion = flags.Bool("version", false, "prints version information for ls-lint") + exitCode := 0 + writer := os.Stdout + flags := flag.NewFlagSet(os.Args[0], flag.ExitOnError) + flagWorkdir := flags.String("workdir", ".", "change working directory before executing the given subcommand") + flagErrorOutputFormat := flags.String("error-output-format", "text", "use a specific error output format (text, json)") + flagWarn := flags.Bool("warn", false, "write lint errors to stdout instead of stderr (exit 0)") + flagDebug := flags.Bool("debug", false, "write debug informations to stdout") + flagVersion := flags.Bool("version", false, "prints version information for ls-lint") var flagConfig _flag.Config flags.Var(&flagConfig, "config", "ls-lint config file path(s)") @@ -59,7 +60,7 @@ func main() { flagConfig = _flag.Config{".ls-lint.yml"} } - var filesystem = os.DirFS(*flagWorkdir) + filesystem := os.DirFS(*flagWorkdir) var paths map[string]struct{} if len(flags.Args()[0:]) > 0 { paths = make(map[string]struct{}, len(flags.Args()[0:])) @@ -68,9 +69,9 @@ func main() { } } - var lslintConfig = config.NewConfig(make(config.Ls), make([]string, 0)) + lslintConfig := config.NewConfig(make(config.Ls), make([]string, 0)) for _, c := range flagConfig { - var tmpLslintConfig = config.NewConfig(nil, nil) + tmpLslintConfig := config.NewConfig(nil, nil) var tmpConfigBytes []byte if tmpConfigBytes, err = os.ReadFile(c); err != nil { @@ -87,7 +88,7 @@ func main() { lslintConfig.Ignore = slices.Compact(lslintConfig.Ignore) } - var lslintLinter = linter.NewLinter( + lslintLinter := linter.NewLinter( ".", lslintConfig, debug.NewStatistic(), @@ -111,7 +112,7 @@ func main() { switch *flagErrorOutputFormat { case "json": - var errIndex = make(map[string]map[string][]string, len(lslintLinter.GetErrors())) + errIndex := make(map[string]map[string][]string, len(lslintLinter.GetErrors())) for _, ruleErr := range lslintLinter.GetErrors() { path := ruleErr.GetPath() if path == "" { diff --git a/internal/config/config.go b/internal/config/config.go index b790e4a0..410bc138 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -2,14 +2,17 @@ package config import ( "fmt" - "github.com/loeffel-io/ls-lint/v2/internal/rule" "reflect" "strings" "sync" + + "github.com/loeffel-io/ls-lint/v2/internal/rule" ) -type Ls map[string]interface{} -type RuleIndex map[string]map[string][]rule.Rule +type ( + Ls map[string]interface{} + RuleIndex map[string]map[string][]rule.Rule +) const ( sep = string('/') @@ -45,7 +48,7 @@ func (config *Config) GetIgnore() []string { } func (config *Config) GetIgnoreIndex() map[string]bool { - var ignoreIndex = make(map[string]bool) + ignoreIndex := make(map[string]bool) for _, path := range config.GetIgnore() { ignoreIndex[path] = true @@ -73,7 +76,7 @@ func (config *Config) GetConfig(index RuleIndex, path string) (string, map[strin dirs := strings.Split(path, sep) for i := len(dirs); i >= 0; i-- { - var dir = strings.Join(dirs[:i], sep) + dir := strings.Join(dirs[:i], sep) if find, exists := index[dir]; exists { return dir, find } @@ -83,7 +86,7 @@ func (config *Config) GetConfig(index RuleIndex, path string) (string, map[strin } func (config *Config) GetIndex(list Ls) (RuleIndex, error) { - var index = make(RuleIndex) + index := make(RuleIndex) if err := config.walkIndex(index, "", list); err != nil { return nil, err @@ -109,7 +112,7 @@ func (config *Config) walkIndex(index RuleIndex, key string, list Ls) error { return err } case false: - var keyCombination = fmt.Sprintf("%s%s%s", key, sep, k) + keyCombination := fmt.Sprintf("%s%s%s", key, sep, k) if err := config.walkIndex(index, keyCombination, v.(Ls)); err != nil { return err } diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 0fc3f52d..02d9b9e1 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -1,14 +1,15 @@ package config import ( - "github.com/loeffel-io/ls-lint/v2/internal/rule" "reflect" "testing" + + "github.com/loeffel-io/ls-lint/v2/internal/rule" ) func TestGetConfig(t *testing.T) { - var config = new(Config) - var indexMock = map[string]map[string][]rule.Rule{ + config := new(Config) + indexMock := map[string]map[string][]rule.Rule{ ".": { ".dir": []rule.Rule{rule.RulesIndex["lowercase"]}, }, @@ -16,9 +17,9 @@ func TestGetConfig(t *testing.T) { ".dir": []rule.Rule{rule.RulesIndex["camelcase"]}, }, } - var indexMockEmpty = make(RuleIndex) + indexMockEmpty := make(RuleIndex) - var tests = []*struct { + tests := []*struct { config *Config index RuleIndex path string @@ -48,7 +49,7 @@ func TestGetConfig(t *testing.T) { }, } - var i = 0 + i := 0 for _, test := range tests { _, res := test.config.GetConfig(test.index, test.path) @@ -86,7 +87,7 @@ func TestShouldIgnore(t *testing.T) { }, } - var i = 0 + i := 0 for _, test := range tests { res := test.lslintConfig.ShouldIgnore(test.ignoreIndex, test.path) diff --git a/internal/glob/glob.go b/internal/glob/glob.go index b81cb0c0..abb2598f 100644 --- a/internal/glob/glob.go +++ b/internal/glob/glob.go @@ -1,11 +1,12 @@ package glob import ( + "io/fs" + "strings" + "github.com/bmatcuk/doublestar/v4" "github.com/loeffel-io/ls-lint/v2/internal/config" "github.com/loeffel-io/ls-lint/v2/internal/rule" - "io/fs" - "strings" ) func Index(filesystem fs.FS, index config.RuleIndex, files bool) (err error) { diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index 6f53c3ca..cea37e46 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -4,9 +4,6 @@ import ( "cmp" "errors" "fmt" - "github.com/loeffel-io/ls-lint/v2/internal/config" - "github.com/loeffel-io/ls-lint/v2/internal/debug" - "github.com/loeffel-io/ls-lint/v2/internal/rule" "io/fs" "reflect" "slices" @@ -15,12 +12,16 @@ import ( "testing" "testing/fstest" "time" + + "github.com/loeffel-io/ls-lint/v2/internal/config" + "github.com/loeffel-io/ls-lint/v2/internal/debug" + "github.com/loeffel-io/ls-lint/v2/internal/rule" ) func TestLinter_Run(t *testing.T) { - var start = time.Now() + start := time.Now() - var tests = []*struct { + tests := []*struct { description string filesystem fs.FS paths map[string]struct{} @@ -719,11 +720,11 @@ func TestLinter_Run(t *testing.T) { }, } - var i = 0 + i := 0 for _, test := range tests { fmt.Printf("Run test %d (%s)\n", i, test.description) - var err = test.linter.Run(test.filesystem, test.paths, true) + err := test.linter.Run(test.filesystem, test.paths, true) if !errors.Is(err, test.expectedErr) { t.Errorf("Test %d (%s) failed with unmatched error value - %v", i, test.description, err) @@ -735,7 +736,7 @@ func TestLinter_Run(t *testing.T) { return } - var equalErrorsErr = fmt.Errorf("Test %d (%s) failed with unmatched linter errors value\nexpected: %+v\nactual: %+v", i, test.description, test.expectedErrors, test.linter.GetErrors()) + equalErrorsErr := fmt.Errorf("Test %d (%s) failed with unmatched linter errors value\nexpected: %+v\nactual: %+v", i, test.description, test.expectedErrors, test.linter.GetErrors()) if len(test.linter.GetErrors()) != len(test.expectedErrors) { t.Error(equalErrorsErr) return diff --git a/internal/rule/camelcase_test.go b/internal/rule/camelcase_test.go index 040f9286..f39b46e0 100644 --- a/internal/rule/camelcase_test.go +++ b/internal/rule/camelcase_test.go @@ -6,9 +6,9 @@ import ( ) func TestCamelCase(t *testing.T) { - var rule = new(CamelCase).Init() + rule := new(CamelCase).Init() - var tests = []*ruleTest{ + tests := []*ruleTest{ {value: "camel", expected: true, err: nil}, {value: "camelcase", expected: true, err: nil}, {value: "camelCase", expected: true, err: nil}, @@ -24,7 +24,7 @@ func TestCamelCase(t *testing.T) { {value: "camel.case", expected: false, err: nil}, } - var i = 0 + i := 0 for _, test := range tests { res, err := rule.Validate(test.value, true) diff --git a/internal/rule/exists.go b/internal/rule/exists.go index 7841175a..1a26c9ff 100644 --- a/internal/rule/exists.go +++ b/internal/rule/exists.go @@ -54,7 +54,7 @@ func (rule *Exists) SetParameters(params []string) error { } // exists:1 - var split = strings.Split(params[0], "-") + split := strings.Split(params[0], "-") if len(split) == 1 { var value int64 var err error @@ -150,7 +150,7 @@ func (rule *Exists) Copy() Rule { rule.RLock() defer rule.RUnlock() - var c = new(Exists) + c := new(Exists) c.Init() c.min = rule.min c.max = rule.max diff --git a/internal/rule/exists_test.go b/internal/rule/exists_test.go index 356548b0..88a175b9 100644 --- a/internal/rule/exists_test.go +++ b/internal/rule/exists_test.go @@ -9,7 +9,7 @@ import ( ) func TestExists_GetParameters(t *testing.T) { - var tests = []*struct { + tests := []*struct { params []string expected []string err error @@ -23,9 +23,9 @@ func TestExists_GetParameters(t *testing.T) { {params: []string{"1-2342323423234"}, expected: []string{"0"}, err: strconv.ErrRange}, } - var i = 0 + i := 0 for _, test := range tests { - var rule = new(Exists).Init() + rule := new(Exists).Init() err := rule.SetParameters(test.params) if !errors.Is(err, test.err) { @@ -44,7 +44,7 @@ func TestExists_GetParameters(t *testing.T) { } func TestExists_Validate(t *testing.T) { - var tests = []*struct { + tests := []*struct { rule *Exists fail bool count uint16 @@ -57,9 +57,9 @@ func TestExists_Validate(t *testing.T) { {rule: &Exists{name: "exists", exclusive: true, min: 3, max: 6, count: 6, RWMutex: new(sync.RWMutex)}, fail: false, count: 7, valid: true, err: nil}, } - var i = 0 + i := 0 for _, test := range tests { - var valid, err = test.rule.Validate("", test.fail) + valid, err := test.rule.Validate("", test.fail) if !errors.Is(err, test.err) { t.Errorf("Test %d failed with unmatched error - %e", i, err) diff --git a/internal/rule/kebabcase_test.go b/internal/rule/kebabcase_test.go index aa3aae20..200159e5 100644 --- a/internal/rule/kebabcase_test.go +++ b/internal/rule/kebabcase_test.go @@ -6,9 +6,9 @@ import ( ) func TestKebabCase(t *testing.T) { - var rule = new(KebabCase).Init() + rule := new(KebabCase).Init() - var tests = []*ruleTest{ + tests := []*ruleTest{ {value: "kebab", expected: true, err: nil}, {value: "kebabcase", expected: true, err: nil}, {value: "kebabCase", expected: false, err: nil}, @@ -22,7 +22,7 @@ func TestKebabCase(t *testing.T) { {value: "kebab_test", expected: false, err: nil}, } - var i = 0 + i := 0 for _, test := range tests { res, err := rule.Validate(test.value, true) diff --git a/internal/rule/lowercase_test.go b/internal/rule/lowercase_test.go index e41f07ad..286ee43f 100644 --- a/internal/rule/lowercase_test.go +++ b/internal/rule/lowercase_test.go @@ -6,15 +6,15 @@ import ( ) func TestLowercase(t *testing.T) { - var rule = new(Lowercase).Init() + rule := new(Lowercase).Init() - var tests = []*ruleTest{ + tests := []*ruleTest{ {value: "abC", expected: false, err: nil}, {value: "abc", expected: true, err: nil}, {value: "abc-1", expected: true, err: nil}, } - var i = 0 + i := 0 for _, test := range tests { res, err := rule.Validate(test.value, true) diff --git a/internal/rule/pascalcase_test.go b/internal/rule/pascalcase_test.go index 84c7ca84..4a95f94c 100644 --- a/internal/rule/pascalcase_test.go +++ b/internal/rule/pascalcase_test.go @@ -6,9 +6,9 @@ import ( ) func TestPascalCase(t *testing.T) { - var rule = new(PascalCase).Init() + rule := new(PascalCase).Init() - var tests = []*ruleTest{ + tests := []*ruleTest{ {value: "pascal", expected: false, err: nil}, {value: "pascalcase", expected: false, err: nil}, {value: "pascalCase", expected: false, err: nil}, @@ -23,7 +23,7 @@ func TestPascalCase(t *testing.T) { {value: "pascal-case", expected: false, err: nil}, } - var i = 0 + i := 0 for _, test := range tests { res, err := rule.Validate(test.value, true) diff --git a/internal/rule/regex.go b/internal/rule/regex.go index 435bc601..dc8c5e64 100644 --- a/internal/rule/regex.go +++ b/internal/rule/regex.go @@ -76,7 +76,7 @@ func (rule *Regex) Copy() Rule { rule.RLock() defer rule.RUnlock() - var c = new(Regex) + c := new(Regex) c.Init() c.regexPattern = rule.regexPattern diff --git a/internal/rule/regex_test.go b/internal/rule/regex_test.go index 2f66bc86..71e21297 100644 --- a/internal/rule/regex_test.go +++ b/internal/rule/regex_test.go @@ -6,7 +6,7 @@ import ( ) func TestRegex(t *testing.T) { - var tests = []*struct { + tests := []*struct { params []string value string expected bool @@ -19,9 +19,9 @@ func TestRegex(t *testing.T) { {params: []string{"[a-z\\-]+"}, value: "google.test", expected: false, err: nil}, } - var i = 0 + i := 0 for _, test := range tests { - var rule = new(Regex).Init() + rule := new(Regex).Init() // parameters err := rule.SetParameters(test.params) diff --git a/internal/rule/screamingsnakecase_test.go b/internal/rule/screamingsnakecase_test.go index 13a30b6c..6bb54f4e 100644 --- a/internal/rule/screamingsnakecase_test.go +++ b/internal/rule/screamingsnakecase_test.go @@ -6,9 +6,9 @@ import ( ) func TestScreamingSnakeCase(t *testing.T) { - var rule = new(ScreamingSnakeCase).Init() + rule := new(ScreamingSnakeCase).Init() - var tests = []*ruleTest{ + tests := []*ruleTest{ {value: "SNEAK", expected: true, err: nil}, {value: "SNEAKCASE", expected: true, err: nil}, {value: "SNEAKCase", expected: false, err: nil}, @@ -24,7 +24,7 @@ func TestScreamingSnakeCase(t *testing.T) { {value: "SNAKE-CASE-TEST", expected: false, err: nil}, } - var i = 0 + i := 0 for _, test := range tests { res, err := rule.Validate(test.value, true) diff --git a/internal/rule/snakecase_test.go b/internal/rule/snakecase_test.go index 2fdee8b7..636fcc23 100644 --- a/internal/rule/snakecase_test.go +++ b/internal/rule/snakecase_test.go @@ -6,9 +6,9 @@ import ( ) func TestSnakeCase(t *testing.T) { - var rule = new(SnakeCase).Init() + rule := new(SnakeCase).Init() - var tests = []*ruleTest{ + tests := []*ruleTest{ {value: "sneak", expected: true, err: nil}, {value: "sneakcase", expected: true, err: nil}, {value: "sneakCase", expected: false, err: nil}, @@ -22,7 +22,7 @@ func TestSnakeCase(t *testing.T) { {value: "snake-case-test", expected: false, err: nil}, } - var i = 0 + i := 0 for _, test := range tests { res, err := rule.Validate(test.value, true) From b88410d463946a1a1e9bc5e61166913041c8bcda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 11:22:45 +0100 Subject: [PATCH 079/117] chore: gazelle fix --- .github/workflows/bazel.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 02c95dfc..a3f261fd 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -15,6 +15,7 @@ jobs: - uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} + - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //:gazelle_fix_diff - run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} @@ -38,4 +39,4 @@ jobs: with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/github:ls_lint_publish - - run: NPM_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint.publish \ No newline at end of file + - run: NPM_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint.publish From 00fcd7639072d5781561a26179e1a56c733e7dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 11:26:54 +0100 Subject: [PATCH 080/117] test: non-root --- .github/workflows/bazel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index a3f261fd..4ac8039b 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest container: image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a - options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user + # options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest container: image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a - options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user + # options: --user nonroot # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: GH_TOKEN: ${{ github.token }} STABLE_GIT_TAG: ${{ github.ref_name }} From 0794a04fa8e11d256310c80d260959e205a6044e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 11:42:07 +0100 Subject: [PATCH 081/117] test: bazel user --- .github/workflows/bazel.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 4ac8039b..b17cc117 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -5,10 +5,11 @@ jobs: runs-on: ubuntu-latest container: image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a - # options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user + options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel + BUILD_USER: nonroot # bazel user steps: - run: set -eu - uses: actions/checkout@v4 @@ -26,12 +27,13 @@ jobs: runs-on: ubuntu-latest container: image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a - # options: --user nonroot # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user + options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: GH_TOKEN: ${{ github.token }} STABLE_GIT_TAG: ${{ github.ref_name }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel + BUILD_USER: nonroot steps: - run: set -eu - uses: actions/checkout@v4 From d90932bef42e765d1834278e279915cc3a904dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 11:54:36 +0100 Subject: [PATCH 082/117] test: user --- .github/workflows/bazel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index b17cc117..6e1c690c 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -9,7 +9,7 @@ jobs: env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel - BUILD_USER: nonroot # bazel user + BUILD_USER: non-root # bazel user steps: - run: set -eu - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: STABLE_GIT_TAG: ${{ github.ref_name }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel - BUILD_USER: nonroot + BUILD_USER: non-root steps: - run: set -eu - uses: actions/checkout@v4 From c42d46d2a911cfe22ba44b97c3cffe09b5b9c78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 11:55:30 +0100 Subject: [PATCH 083/117] test: user --- .github/workflows/bazel.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 6e1c690c..55f3db27 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -9,13 +9,13 @@ jobs: env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel - BUILD_USER: non-root # bazel user steps: - run: set -eu - uses: actions/checkout@v4 - uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} + - run: sed 's/:.*//g' /etc/passwd - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //:gazelle_fix_diff - run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... @@ -33,7 +33,6 @@ jobs: STABLE_GIT_TAG: ${{ github.ref_name }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel - BUILD_USER: non-root steps: - run: set -eu - uses: actions/checkout@v4 From 19905cf400cd1a12e2f7f37e73427aeafb559cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 12:17:12 +0100 Subject: [PATCH 084/117] test: root --- .github/workflows/bazel.yml | 1 - MODULE.bazel | 24 ++++++++++++++++++------ MODULE.bazel.lock | 24 +++++++++++++++++++----- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 55f3db27..a3f261fd 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -15,7 +15,6 @@ jobs: - uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - - run: sed 's/:.*//g' /etc/passwd - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //:gazelle_fix_diff - run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... diff --git a/MODULE.bazel b/MODULE.bazel index 3a764ff2..2235baa4 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,9 +1,9 @@ -bazel_dep(name = "platforms", version = "0.0.10") -bazel_dep(name = "rules_go", version = "0.50.1") -bazel_dep(name = "gazelle", version = "0.40.0") -bazel_dep(name = "rules_pkg", version = "1.0.1") -bazel_dep(name = "aspect_bazel_lib", version = "2.9.4") -bazel_dep(name = "aspect_rules_js", version = "2.1.0") +bazel_dep(name = "platforms", version = "0.0.10", dev_dependency = True) +bazel_dep(name = "rules_go", version = "0.50.1", dev_dependency = True) +bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True) +bazel_dep(name = "rules_pkg", version = "1.0.1", dev_dependency = True) +bazel_dep(name = "aspect_bazel_lib", version = "2.9.4", dev_dependency = True) +bazel_dep(name = "aspect_rules_js", version = "2.1.0", dev_dependency = True) #################################################################### # rules_go ######################################################### @@ -39,6 +39,18 @@ npm.npm_translate_lock( ) use_repo(npm, "npm") +#################################################################### +# rules_python ##################################################### +#################################################################### + +bazel_dep(name = "rules_python", version = "0.40.0") + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain( + ignore_root_user_error = True, + python_version = "3.13", +) + #################################################################### # github cli ####################################################### #################################################################### diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 0d670f01..2aac240b 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -21,7 +21,8 @@ "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", - "https://bcr.bazel.build/modules/bazel_features/1.18.0/source.json": "cde886d88c8164b50b9b97dba7c0a64ca24d257b72ca3a2fcb06bee1fdb47ee4", + "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", + "https://bcr.bazel.build/modules/bazel_features/1.19.0/source.json": "d7bf14517c1b25b9d9c580b0f8795fceeae08a7590f507b76aace528e941375d", "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", "https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", @@ -64,6 +65,7 @@ "https://bcr.bazel.build/modules/protobuf/23.1/MODULE.bazel": "88b393b3eb4101d18129e5db51847cd40a5517a53e81216144a8c32dfeeca52a", "https://bcr.bazel.build/modules/protobuf/24.4/MODULE.bazel": "7bc7ce5f2abf36b3b7b7c8218d3acdebb9426aeb35c2257c96445756f970eb12", "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", "https://bcr.bazel.build/modules/protobuf/29.0-rc2/source.json": "52101bfd37e38f0d159dee47b71ccbd1f22f7a32192cef5ef2533bb6212f410f", "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", @@ -78,7 +80,9 @@ "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", - "https://bcr.bazel.build/modules/rules_cc/0.0.13/source.json": "506daed7caa38451517166af246c11650b21a7244c2b79f2cd43a27fae792a06", + "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/source.json": "48e606af0e02a716974a8b74fba6988d9f0c93af9177e28cf474bfc5fa26ab10", "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", @@ -93,20 +97,26 @@ "https://bcr.bazel.build/modules/rules_go/0.50.1/source.json": "205765fd30216c70321f84c9a967267684bdc74350af3f3c46c857d9f80a4fa2", "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", "https://bcr.bazel.build/modules/rules_java/6.3.0/MODULE.bazel": "a97c7678c19f236a956ad260d59c86e10a463badb7eb2eda787490f4c969b963", + "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", "https://bcr.bazel.build/modules/rules_java/7.1.0/MODULE.bazel": "30d9135a2b6561c761bd67bd4990da591e6bdc128790ce3e7afd6a3558b2fb64", "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", "https://bcr.bazel.build/modules/rules_java/8.2.0/MODULE.bazel": "6ed551110d53e66eca041a9e41835a4e66ad9c988ae49897dd0c66d87e107dcc", "https://bcr.bazel.build/modules/rules_java/8.2.0/source.json": "9a10ea55c608da3148fe642c201bc8a12df70af5b3131835cec7b004fec053d1", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d", + "https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4", "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", "https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", @@ -123,23 +133,27 @@ "https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483", "https://bcr.bazel.build/modules/rules_proto/6.0.0/MODULE.bazel": "b531d7f09f58dce456cd61b4579ce8c86b38544da75184eadaf0a7cb7966453f", "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", - "https://bcr.bazel.build/modules/rules_proto/6.0.2/source.json": "17a2e195f56cb28d6bbf763e49973d13890487c6945311ed141e196fb660426d", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1", "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", "https://bcr.bazel.build/modules/rules_python/0.36.0/MODULE.bazel": "a4ce1ccea92b9106c7d16ab9ee51c6183107e78ba4a37aa65055227b80cd480c", - "https://bcr.bazel.build/modules/rules_python/0.36.0/source.json": "b79cbb7b2ae1751949e2f6ee6692822e4ffd13ca1e959ce99abec4ac7666162a", "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", + "https://bcr.bazel.build/modules/rules_python/0.40.0/source.json": "939d4bd2e3110f27bfb360292986bb79fd8dcefb874358ccd6cdaa7bda029320", "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", "https://bcr.bazel.build/modules/rules_shell/0.2.0/source.json": "7f27af3c28037d9701487c4744b5448d26537cc66cdef0d8df7ae85411f8de95", "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", "https://bcr.bazel.build/modules/stardoc/0.5.4/MODULE.bazel": "6569966df04610b8520957cb8e97cf2e9faac2c0309657c537ab51c16c18a2a4", + "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", "https://bcr.bazel.build/modules/stardoc/0.6.2/MODULE.bazel": "7060193196395f5dd668eda046ccbeacebfd98efc77fed418dbe2b82ffaa39fd", "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", - "https://bcr.bazel.build/modules/stardoc/0.7.0/source.json": "e3c524bf2ef20992539ce2bc4a2243f4853130209ee831689983e28d05769099", + "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", + "https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", "https://bcr.bazel.build/modules/upb/0.0.0-20230516-61a97ef/MODULE.bazel": "c0df5e35ad55e264160417fd0875932ee3c9dda63d9fccace35ac62f45e1b6f9", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", From e79a849cd1fcefa6dc06ceb23936409058766676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 12:22:56 +0100 Subject: [PATCH 085/117] chore: add python comment --- MODULE.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/MODULE.bazel b/MODULE.bazel index 2235baa4..d5bbaa13 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -41,6 +41,7 @@ use_repo(npm, "npm") #################################################################### # rules_python ##################################################### +# https://github.com/bazelbuild/rules_python/pull/713 ############## #################################################################### bazel_dep(name = "rules_python", version = "0.40.0") From 029646df2034b34767f6bd42b7c08a639db28b7a Mon Sep 17 00:00:00 2001 From: Robin Irmer Date: Tue, 19 Nov 2024 13:02:21 +0100 Subject: [PATCH 086/117] chore: add not_regex rule Signed-off-by: Robin Irmer --- internal/rule/BUILD.bazel | 2 + internal/rule/not_regex.go | 85 +++++++++++++++++++++++++++++++++ internal/rule/not_regex_test.go | 49 +++++++++++++++++++ internal/rule/rule.go | 2 + 4 files changed, 138 insertions(+) create mode 100644 internal/rule/not_regex.go create mode 100644 internal/rule/not_regex_test.go diff --git a/internal/rule/BUILD.bazel b/internal/rule/BUILD.bazel index 261b8dab..0e8019e5 100644 --- a/internal/rule/BUILD.bazel +++ b/internal/rule/BUILD.bazel @@ -8,6 +8,7 @@ go_library( "exists.go", "kebabcase.go", "lowercase.go", + "not_regex.go", "pascalcase.go", "regex.go", "rule.go", @@ -25,6 +26,7 @@ go_test( "exists_test.go", "kebabcase_test.go", "lowercase_test.go", + "not_regex_test.go", "pascalcase_test.go", "regex_test.go", "rule_test.go", diff --git a/internal/rule/not_regex.go b/internal/rule/not_regex.go new file mode 100644 index 00000000..94df8b4a --- /dev/null +++ b/internal/rule/not_regex.go @@ -0,0 +1,85 @@ +package rule + +import ( + "fmt" + "regexp" + "sync" +) + +type NotRegex struct { + name string + exclusive bool + regexPattern string + *sync.RWMutex +} + +func (rule *NotRegex) Init() Rule { + rule.name = "not_regex" + rule.exclusive = false + rule.RWMutex = new(sync.RWMutex) + + return rule +} + +func (rule *NotRegex) GetName() string { + rule.RLock() + defer rule.RUnlock() + + return rule.name +} + +// 0 = regex pattern +func (rule *NotRegex) SetParameters(params []string) error { + rule.Lock() + defer rule.Unlock() + + if len(params) == 0 { + return fmt.Errorf("regex pattern not exists") + } + + if params[0] == "" { + return fmt.Errorf("regex pattern is empty") + } + + rule.regexPattern = params[0] + return nil +} + +func (rule *NotRegex) GetParameters() []string { + return []string{rule.regexPattern} +} + +func (rule *NotRegex) GetExclusive() bool { + rule.RLock() + defer rule.RUnlock() + + return rule.exclusive +} + +// Validate checks if the full string does NOT match the regex +func (rule *NotRegex) Validate(value string, fail bool) (bool, error) { + match, err := regexp.MatchString(fmt.Sprintf("^%s$", rule.getRegexPattern()), value) + return !match, err +} + +func (rule *NotRegex) getRegexPattern() string { + rule.RLock() + defer rule.RUnlock() + + return rule.regexPattern +} + +func (rule *NotRegex) GetErrorMessage() string { + return fmt.Sprintf("%s:%s", rule.GetName(), rule.getRegexPattern()) +} + +func (rule *NotRegex) Copy() Rule { + rule.RLock() + defer rule.RUnlock() + + c := new(Regex) + c.Init() + c.regexPattern = rule.regexPattern + + return c +} diff --git a/internal/rule/not_regex_test.go b/internal/rule/not_regex_test.go new file mode 100644 index 00000000..ebdd24a6 --- /dev/null +++ b/internal/rule/not_regex_test.go @@ -0,0 +1,49 @@ +package rule + +import ( + "errors" + "testing" +) + +func TestNotRegex(t *testing.T) { + tests := []*struct { + params []string + value string + expected bool + err error + }{ + {params: []string{".+"}, value: "regex", expected: false, err: nil}, + {params: []string{"[0-9]+"}, value: "123", expected: false, err: nil}, + {params: []string{"[a-z]+"}, value: "123", expected: true, err: nil}, + {params: []string{"[a-z\\-]+"}, value: "google-test", expected: false, err: nil}, + {params: []string{"[a-z\\-]+"}, value: "google.test", expected: true, err: nil}, + } + + i := 0 + for _, test := range tests { + rule := new(NotRegex).Init() + + // parameters + err := rule.SetParameters(test.params) + + if !errors.Is(err, test.err) { + t.Errorf("Test %d failed with unmatched error - %e", i, err) + return + } + + // validate + res, err := rule.Validate(test.value, true) + + if err != nil && err != test.err { + t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) + return + } + + if res != test.expected { + t.Errorf("Test %d failed with unmatched return value - %+v", i, res) + return + } + + i++ + } +} diff --git a/internal/rule/rule.go b/internal/rule/rule.go index b3b3ceda..25e24747 100644 --- a/internal/rule/rule.go +++ b/internal/rule/rule.go @@ -3,6 +3,7 @@ package rule var RulesIndex = map[string]Rule{ "lowercase": new(Lowercase).Init(), "regex": new(Regex).Init(), + "not_regex": new(NotRegex).Init(), "exists": new(Exists).Init(), "camelcase": new(CamelCase).Init(), @@ -15,6 +16,7 @@ var RulesIndex = map[string]Rule{ var Rules = map[string]Rule{ "lowercase": RulesIndex["lowercase"], "regex": RulesIndex["regex"], + "not_regex": RulesIndex["not_regex"], "exists": RulesIndex["exists"], "camelcase": RulesIndex["camelcase"], From c55a1be1aab3d4facd5baf4cfb4b0e3b88ff0d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 13:24:46 +0100 Subject: [PATCH 087/117] test: pr builds --- .github/workflows/bazel.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index a3f261fd..0b5cfa8a 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -1,5 +1,10 @@ name: Bazel -on: [ push ] +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + jobs: build: runs-on: ubuntu-latest From ce5f7d8b7b213220813fc94ba692aa9710f24273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 13:41:07 +0100 Subject: [PATCH 088/117] chore: pr --- .github/workflows/bazel.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 0b5cfa8a..4aa44d01 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -1,9 +1,5 @@ name: Bazel -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [ push, pull_request ] jobs: build: @@ -17,7 +13,8 @@ jobs: steps: - run: set -eu - uses: actions/checkout@v4 - - uses: google-github-actions/auth@v2 + - if: github.event.pull_request.head.repo.full_name == github.repository # only run on prs from the same repo in case of forks to avoid leaking secrets + uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //:gazelle_fix_diff From 1b48104716dbd35b85c03731aaf13b7c1eb18e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 13:56:48 +0100 Subject: [PATCH 089/117] test: pr --- .github/workflows/bazel.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 4aa44d01..9d259fbb 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -3,18 +3,18 @@ on: [ push, pull_request ] jobs: build: + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest container: image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a - options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user + options: --user root env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel steps: - run: set -eu - uses: actions/checkout@v4 - - if: github.event.pull_request.head.repo.full_name == github.repository # only run on prs from the same repo in case of forks to avoid leaking secrets - uses: google-github-actions/auth@v2 + - uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //:gazelle_fix_diff @@ -22,6 +22,20 @@ jobs: - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} + build-no-cache: # unauthenticated contributors + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository + runs-on: ubuntu-latest + container: + image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a + options: --user root + steps: + - run: set -eu + - uses: actions/checkout@v4 + - run: bazel run //:gazelle_fix_diff + - run: bazel test //... + - run: bazel build //... + - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} + release: needs: build if: startsWith(github.ref, 'refs/tags/v') From 3de844cb2a868273d16bbceb269177a60da75035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 14:11:35 +0100 Subject: [PATCH 090/117] test: pr --- .github/workflows/bazel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 9d259fbb..de291620 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -3,7 +3,7 @@ on: [ push, pull_request ] jobs: build: - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository + if: github.event_name == 'push' runs-on: ubuntu-latest container: image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a @@ -23,7 +23,7 @@ jobs: - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} build-no-cache: # unauthenticated contributors - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository + if: github.event_name == 'pull_request' runs-on: ubuntu-latest container: image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a From 9495379c20686f851fdf0d47544cae8b309bcbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 14:13:07 +0100 Subject: [PATCH 091/117] test: pr --- .github/workflows/bazel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index de291620..9d259fbb 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -3,7 +3,7 @@ on: [ push, pull_request ] jobs: build: - if: github.event_name == 'push' + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest container: image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a @@ -23,7 +23,7 @@ jobs: - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} build-no-cache: # unauthenticated contributors - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest container: image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a From 278b5c5bbe702d92b6af2623724ba641fdef9014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 14:24:40 +0100 Subject: [PATCH 092/117] chore: hint --- .github/workflows/bazel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 9d259fbb..ff985bc8 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -22,7 +22,7 @@ jobs: - run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //... - run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD} - build-no-cache: # unauthenticated contributors + build-no-cache: # external pull requests if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest container: From 7e27976b0e58dc5b7034204358cec656cda918f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 14:32:11 +0100 Subject: [PATCH 093/117] feat: migrate ls-lint.yml --- .ls-lint.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.ls-lint.yml b/.ls-lint.yml index dd4de91a..f3bc71f3 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -1,12 +1,11 @@ ls: .dir: snake_case - .json: snake_case - .bzl: snake_case - .sh: snake_case + .*: snake_case + .*.*: snake_case + .png: kebab-case + .md: SCREAMING_SNAKE_CASE .bazel: SCREAMING_SNAKE_CASE - .go: snake_case - .yaml: snake_case - .js: snake_case + .bazel.lock: SCREAMING_SNAKE_CASE ignore: - .git @@ -15,4 +14,5 @@ ignore: - genhtml - bazel-* - gha-* - - deployments/npm/pnpm-lock.yaml \ No newline at end of file + - deployments/npm/pnpm-lock.yaml + - deployments/docker From 556af5cf5f50f2a0e3eca41fb7cbdb4c118dd87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 14:39:10 +0100 Subject: [PATCH 094/117] feat: migrate ls-lint.yml --- .ls-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ls-lint.yml b/.ls-lint.yml index f3bc71f3..c9800cc8 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -2,6 +2,7 @@ ls: .dir: snake_case .*: snake_case .*.*: snake_case + .*.*.*: exists:0 .png: kebab-case .md: SCREAMING_SNAKE_CASE .bazel: SCREAMING_SNAKE_CASE @@ -10,7 +11,6 @@ ls: ignore: - .git - .github - - .idea - genhtml - bazel-* - gha-* From 47b818044bf902df1cf29815bc36479b7c3e1ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 14:49:18 +0100 Subject: [PATCH 095/117] fix: npm publish --- deployments/npm/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/deployments/npm/BUILD.bazel b/deployments/npm/BUILD.bazel index 2f6425cb..7d9a7920 100644 --- a/deployments/npm/BUILD.bazel +++ b/deployments/npm/BUILD.bazel @@ -42,6 +42,7 @@ npm_package( ":package_files", ":package_files_bin", ], + publishable = True, args = [ "--tag beta", "--no-git-checks", From dbf926df67c3c0d351ec2ec8be343379d36b5940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 14:51:38 +0100 Subject: [PATCH 096/117] fix: gazelle --- deployments/npm/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/npm/BUILD.bazel b/deployments/npm/BUILD.bazel index 7d9a7920..8bc306a4 100644 --- a/deployments/npm/BUILD.bazel +++ b/deployments/npm/BUILD.bazel @@ -42,7 +42,6 @@ npm_package( ":package_files", ":package_files_bin", ], - publishable = True, args = [ "--tag beta", "--no-git-checks", @@ -52,4 +51,5 @@ npm_package( "deployments/npm/**", "**", # LICENSE + README.md ], + publishable = True, ) From 5b5a853ccc03a91c2a204f3501baa41037ca5461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 15:28:16 +0100 Subject: [PATCH 097/117] chore: bump action --- .github/workflows/github-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index deea7c05..e96edd04 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -5,4 +5,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ls-lint/action@v2.3.0-beta.1 \ No newline at end of file + - uses: ls-lint/action@v2.3.0-beta.2 From 2c8b91df8f2d97c9bb51a26b991ce00986647afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 16:01:52 +0100 Subject: [PATCH 098/117] fix: not_regex copy --- internal/rule/not_regex.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/rule/not_regex.go b/internal/rule/not_regex.go index 94df8b4a..32f10bac 100644 --- a/internal/rule/not_regex.go +++ b/internal/rule/not_regex.go @@ -34,11 +34,11 @@ func (rule *NotRegex) SetParameters(params []string) error { defer rule.Unlock() if len(params) == 0 { - return fmt.Errorf("regex pattern not exists") + return fmt.Errorf("not_regex pattern not exists") } if params[0] == "" { - return fmt.Errorf("regex pattern is empty") + return fmt.Errorf("not_regex pattern is empty") } rule.regexPattern = params[0] @@ -77,7 +77,7 @@ func (rule *NotRegex) Copy() Rule { rule.RLock() defer rule.RUnlock() - c := new(Regex) + c := new(NotRegex) c.Init() c.regexPattern = rule.regexPattern From e8309fee5f55a1fd05819b9925ae19969bfbd222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 16:08:02 +0100 Subject: [PATCH 099/117] chore: bump action --- .github/workflows/github-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index e96edd04..b5499267 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -5,4 +5,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ls-lint/action@v2.3.0-beta.2 + - uses: ls-lint/action@v2.3.0-beta.3 From 61ffb56356be7fe69919579b757a6abc0cb22b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Tue, 19 Nov 2024 16:21:41 +0100 Subject: [PATCH 100/117] feat: optimize ls-lint.yml --- .ls-lint.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.ls-lint.yml b/.ls-lint.yml index c9800cc8..ab6a3870 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -3,11 +3,22 @@ ls: .*: snake_case .*.*: snake_case .*.*.*: exists:0 - .png: kebab-case + .png: exists:0 + .jpg: exists:0 .md: SCREAMING_SNAKE_CASE .bazel: SCREAMING_SNAKE_CASE .bazel.lock: SCREAMING_SNAKE_CASE + examples/**: # allow only .yml files + .dir: snake_case + .*: exists:0 + .yml: kebab-case + + assets/**: # allow only .png files + .dir: snake_case + .*: exists:0 + .png: kebab-case + ignore: - .git - .github From bafbb09ff83c98b11833b13b422472d71a131586 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 11 Dec 2024 13:28:51 +0200 Subject: [PATCH 101/117] refactor: use increment instead of `+= 1` --- internal/linter/linter.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/linter/linter.go b/internal/linter/linter.go index 898631fd..9bcfaec0 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -101,9 +101,9 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate if !ruleDir.GetExclusive() { rulesMutex.Lock() - rulesNonExclusiveCount += 1 + rulesNonExclusiveCount++ if !valid { - rulesNonExclusiveError += 1 + rulesNonExclusiveError++ } rulesMutex.Unlock() } @@ -184,9 +184,9 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate if !ruleFile.GetExclusive() { rulesMutex.Lock() - rulesNonExclusiveCount += 1 + rulesNonExclusiveCount++ if !valid { - rulesNonExclusiveError += 1 + rulesNonExclusiveError++ } rulesMutex.Unlock() } From 32b3eb74e8fc028429930e72dd38678922a6b83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20L=C3=B6ffel?= Date: Fri, 21 Mar 2025 18:40:11 +0100 Subject: [PATCH 102/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38f8f9ca..88a973d5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ An extremely fast directory and filename linter - Bring some structure to your p [![Go Report Card](https://goreportcard.com/badge/github.com/loeffel-io/ls-lint)](https://goreportcard.com/report/github.com/loeffel-io/ls-lint) Version ![npm](https://img.shields.io/npm/dy/@ls-lint/ls-lint?label=npm%20downloads) -![npm](https://badgen.net/static/npm%20downloads%20total/6M+/green) +![npm](https://badgen.net/static/npm%20downloads%20total/7M+/green) License - Minimal setup with simple rules managed in one single or multiple `.ls-lint.yml` files From 6c04f304e481abe48038fe7182663b0ce7e37c39 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 19:10:33 +0000 Subject: [PATCH 103/117] chore(deps): update dependency platforms to v0.0.11 --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index d5bbaa13..c0ee2ad9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,4 +1,4 @@ -bazel_dep(name = "platforms", version = "0.0.10", dev_dependency = True) +bazel_dep(name = "platforms", version = "0.0.11", dev_dependency = True) bazel_dep(name = "rules_go", version = "0.50.1", dev_dependency = True) bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True) bazel_dep(name = "rules_pkg", version = "1.0.1", dev_dependency = True) From cc9c72eca81df799d4b7bb3ec77f7ab72cb3b512 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 16:14:06 +0000 Subject: [PATCH 104/117] chore(deps): update dependency rules_pkg to v1.1.0 --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index d5bbaa13..50aebbb5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,7 +1,7 @@ bazel_dep(name = "platforms", version = "0.0.10", dev_dependency = True) bazel_dep(name = "rules_go", version = "0.50.1", dev_dependency = True) bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True) -bazel_dep(name = "rules_pkg", version = "1.0.1", dev_dependency = True) +bazel_dep(name = "rules_pkg", version = "1.1.0", dev_dependency = True) bazel_dep(name = "aspect_bazel_lib", version = "2.9.4", dev_dependency = True) bazel_dep(name = "aspect_rules_js", version = "2.1.0", dev_dependency = True) From 7bb4d51909fbe9cc26396900574c25e9546e059c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 14:34:20 +0000 Subject: [PATCH 105/117] chore(deps): update dependency gazelle to v0.42.0 --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index 50aebbb5..23db4d5c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ bazel_dep(name = "platforms", version = "0.0.10", dev_dependency = True) bazel_dep(name = "rules_go", version = "0.50.1", dev_dependency = True) -bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True) +bazel_dep(name = "gazelle", version = "0.42.0", dev_dependency = True) bazel_dep(name = "rules_pkg", version = "1.1.0", dev_dependency = True) bazel_dep(name = "aspect_bazel_lib", version = "2.9.4", dev_dependency = True) bazel_dep(name = "aspect_rules_js", version = "2.1.0", dev_dependency = True) From 22c95d52a5ee3e3239c605eb0648399acd541760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Wed, 26 Mar 2025 15:39:35 +0100 Subject: [PATCH 106/117] chore: bump deps --- .bazelversion | 2 +- MODULE.bazel | 10 +- MODULE.bazel.lock | 582 +++++----------------------------------------- go.mod | 6 +- go.sum | 8 +- 5 files changed, 69 insertions(+), 539 deletions(-) diff --git a/.bazelversion b/.bazelversion index bf035f2b..0e791524 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -8.0.0rc2 +8.1.1 diff --git a/MODULE.bazel b/MODULE.bazel index 55191757..12753a74 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,16 +1,16 @@ bazel_dep(name = "platforms", version = "0.0.11", dev_dependency = True) -bazel_dep(name = "rules_go", version = "0.50.1", dev_dependency = True) +bazel_dep(name = "rules_go", version = "0.53.0", dev_dependency = True) bazel_dep(name = "gazelle", version = "0.42.0", dev_dependency = True) bazel_dep(name = "rules_pkg", version = "1.1.0", dev_dependency = True) -bazel_dep(name = "aspect_bazel_lib", version = "2.9.4", dev_dependency = True) -bazel_dep(name = "aspect_rules_js", version = "2.1.0", dev_dependency = True) +bazel_dep(name = "aspect_bazel_lib", version = "2.14.0", dev_dependency = True) +bazel_dep(name = "aspect_rules_js", version = "2.2.0", dev_dependency = True) #################################################################### # rules_go ######################################################### #################################################################### go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.23.3") +go_sdk.download(version = "1.24.1") go_sdk.nogo(nogo = "//:nogo") #################################################################### @@ -44,7 +44,7 @@ use_repo(npm, "npm") # https://github.com/bazelbuild/rules_python/pull/713 ############## #################################################################### -bazel_dep(name = "rules_python", version = "0.40.0") +bazel_dep(name = "rules_python", version = "1.2.0") python = use_extension("@rules_python//python/extensions:python.bzl", "python") python.toolchain( diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 2aac240b..e0b89f87 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,5 +1,5 @@ { - "lockFileVersion": 12, + "lockFileVersion": 18, "registryFileHashes": { "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", @@ -10,11 +10,11 @@ "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da", - "https://bcr.bazel.build/modules/aspect_bazel_lib/2.7.7/MODULE.bazel": "491f8681205e31bb57892d67442ce448cda4f472a8e6b3dc062865e29a64f89c", - "https://bcr.bazel.build/modules/aspect_bazel_lib/2.9.4/MODULE.bazel": "ccc41028429f894b02fde7ef67d416cba3ba5084ed9ddb9bb6107aa82d118776", - "https://bcr.bazel.build/modules/aspect_bazel_lib/2.9.4/source.json": "9e20ebe57de2e7657a188af6e132a9562fa26c201b2d999bc0a8981e8f3b6c36", - "https://bcr.bazel.build/modules/aspect_rules_js/2.1.0/MODULE.bazel": "f747a24e13bc3c35c712580fc4e30186c54d80d21997b9503e29705e4d864533", - "https://bcr.bazel.build/modules/aspect_rules_js/2.1.0/source.json": "3a43843c6bd0ac65d118e72f504ff553a1ba1e65fec91938e5546effb4245104", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/MODULE.bazel": "2b31ffcc9bdc8295b2167e07a757dbbc9ac8906e7028e5170a3708cecaac119f", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/source.json": "0cf1826853b0bef8b5cd19c0610d717500f5521aa2b38b72b2ec302ac5e7526c", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.8.1/MODULE.bazel": "812d2dd42f65dca362152101fbec418029cc8fd34cbad1a2fde905383d705838", + "https://bcr.bazel.build/modules/aspect_rules_js/2.2.0/MODULE.bazel": "9717953f83617605e390611bba3e1d5fbc327ded04cf0510df4dc393a0259900", + "https://bcr.bazel.build/modules/aspect_rules_js/2.2.0/source.json": "44f2c2ee7f6a32c3cf8a5cb370bdbb8b7f128ed9bff4f8df0e72c4a5e1a64bcc", "https://bcr.bazel.build/modules/bazel_features/1.1.0/MODULE.bazel": "cfd42ff3b815a5f39554d97182657f8c4b9719568eb7fded2b9135f084bf760b", "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", @@ -22,7 +22,8 @@ "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", - "https://bcr.bazel.build/modules/bazel_features/1.19.0/source.json": "d7bf14517c1b25b9d9c580b0f8795fceeae08a7590f507b76aace528e941375d", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/source.json": "3e8379efaaef53ce35b7b8ba419df829315a880cb0a030e5bb45c96d6d5ecb5f", "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", "https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", @@ -44,8 +45,8 @@ "https://bcr.bazel.build/modules/gazelle/0.33.0/MODULE.bazel": "a13a0f279b462b784fb8dd52a4074526c4a2afe70e114c7d09066097a46b3350", "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel": "abdd8ce4d70978933209db92e436deb3a8b737859e9354fb5fd11fb5c2004c8a", "https://bcr.bazel.build/modules/gazelle/0.36.0/MODULE.bazel": "e375d5d6e9a6ca59b0cb38b0540bc9a05b6aa926d322f2de268ad267a2ee74c0", - "https://bcr.bazel.build/modules/gazelle/0.40.0/MODULE.bazel": "42ba5378ebe845fca43989a53186ab436d956db498acde790685fe0e8f9c6146", - "https://bcr.bazel.build/modules/gazelle/0.40.0/source.json": "1e5ef6e4d8b9b6836d93273c781e78ff829ea2e077afef7a57298040fa4f010a", + "https://bcr.bazel.build/modules/gazelle/0.42.0/MODULE.bazel": "fa140a7c019f3a22779ba7c6132ffff9d2d10a51dba2f3304dee61523d11fef4", + "https://bcr.bazel.build/modules/gazelle/0.42.0/source.json": "eb6f7b0cb76c52d2679164910a01fa6ddcee409e6a7fee06e602ef259f65165c", "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", @@ -55,19 +56,20 @@ "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", - "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5", + "https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f", + "https://bcr.bazel.build/modules/platforms/0.0.11/source.json": "f7e188b79ebedebfe75e9e1d098b8845226c7992b307e28e1496f23112e8fc29", "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", - "https://bcr.bazel.build/modules/protobuf/23.1/MODULE.bazel": "88b393b3eb4101d18129e5db51847cd40a5517a53e81216144a8c32dfeeca52a", - "https://bcr.bazel.build/modules/protobuf/24.4/MODULE.bazel": "7bc7ce5f2abf36b3b7b7c8218d3acdebb9426aeb35c2257c96445756f970eb12", "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", - "https://bcr.bazel.build/modules/protobuf/29.0-rc2/source.json": "52101bfd37e38f0d159dee47b71ccbd1f22f7a32192cef5ef2533bb6212f410f", + "https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92", + "https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e", + "https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981", "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", "https://bcr.bazel.build/modules/protobuf/3.19.2/MODULE.bazel": "532ffe5f2186b69fdde039efe6df13ba726ff338c6bc82275ad433013fa10573", "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", @@ -82,7 +84,9 @@ "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", - "https://bcr.bazel.build/modules/rules_cc/0.0.15/source.json": "48e606af0e02a716974a8b74fba6988d9f0c93af9177e28cf474bfc5fa26ab10", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/source.json": "4db99b3f55c90ab28d14552aa0632533e3e8e5e9aea0f5c24ac0014282c2a7c5", "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", @@ -94,21 +98,23 @@ "https://bcr.bazel.build/modules/rules_go/0.42.0/MODULE.bazel": "8cfa875b9aa8c6fce2b2e5925e73c1388173ea3c32a0db4d2b4804b453c14270", "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel": "3477df8bdcc49e698b9d25f734c4f3a9f5931ff34ee48a2c662be168f5f2d3fd", "https://bcr.bazel.build/modules/rules_go/0.50.1/MODULE.bazel": "b91a308dc5782bb0a8021ad4330c81fea5bda77f96b9e4c117b9b9c8f6665ee0", - "https://bcr.bazel.build/modules/rules_go/0.50.1/source.json": "205765fd30216c70321f84c9a967267684bdc74350af3f3c46c857d9f80a4fa2", + "https://bcr.bazel.build/modules/rules_go/0.53.0/MODULE.bazel": "a4ed760d3ac0dbc0d7b967631a9a3fd9100d28f7d9fcf214b4df87d4bfff5f9a", + "https://bcr.bazel.build/modules/rules_go/0.53.0/source.json": "c6dc34fb5bb8838652221a167d8f35ca3c8fdcbff8568f13cc75719802f95cff", "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", "https://bcr.bazel.build/modules/rules_java/6.3.0/MODULE.bazel": "a97c7678c19f236a956ad260d59c86e10a463badb7eb2eda787490f4c969b963", "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", - "https://bcr.bazel.build/modules/rules_java/7.1.0/MODULE.bazel": "30d9135a2b6561c761bd67bd4990da591e6bdc128790ce3e7afd6a3558b2fb64", "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", - "https://bcr.bazel.build/modules/rules_java/8.2.0/MODULE.bazel": "6ed551110d53e66eca041a9e41835a4e66ad9c988ae49897dd0c66d87e107dcc", - "https://bcr.bazel.build/modules/rules_java/8.2.0/source.json": "9a10ea55c608da3148fe642c201bc8a12df70af5b3131835cec7b004fec053d1", + "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", + "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", + "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2", + "https://bcr.bazel.build/modules/rules_java/8.6.1/source.json": "f18d9ad3c4c54945bf422ad584fa6c5ca5b3116ff55a5b1bc77e5c1210be5960", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", @@ -127,10 +133,10 @@ "https://bcr.bazel.build/modules/rules_nodejs/6.3.0/source.json": "1254ffd8d0d908a19c67add7fb5e2a1f604df133bc5d206425264293e2e537fc", "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", - "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", + "https://bcr.bazel.build/modules/rules_pkg/1.1.0/MODULE.bazel": "9db8031e71b6ef32d1846106e10dd0ee2deac042bd9a2de22b4761b0c3036453", + "https://bcr.bazel.build/modules/rules_pkg/1.1.0/source.json": "fef768df13a92ce6067e1cd0cdc47560dace01354f1d921cfb1d632511f7d608", "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", - "https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483", "https://bcr.bazel.build/modules/rules_proto/6.0.0/MODULE.bazel": "b531d7f09f58dce456cd61b4579ce8c86b38544da75184eadaf0a7cb7966453f", "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", @@ -140,22 +146,23 @@ "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", - "https://bcr.bazel.build/modules/rules_python/0.36.0/MODULE.bazel": "a4ce1ccea92b9106c7d16ab9ee51c6183107e78ba4a37aa65055227b80cd480c", "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", - "https://bcr.bazel.build/modules/rules_python/0.40.0/source.json": "939d4bd2e3110f27bfb360292986bb79fd8dcefb874358ccd6cdaa7bda029320", + "https://bcr.bazel.build/modules/rules_python/1.0.0/MODULE.bazel": "898a3d999c22caa585eb062b600f88654bf92efb204fa346fb55f6f8edffca43", + "https://bcr.bazel.build/modules/rules_python/1.2.0/MODULE.bazel": "5aeeb48b2a6c19d668b48adf2b8a2b209a6310c230db0ce77450f148a89846e4", + "https://bcr.bazel.build/modules/rules_python/1.2.0/source.json": "5b7892685c9a843526fd5a31e7d7a93eb819c59fd7b7fc444b5b143558e1b073", "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", - "https://bcr.bazel.build/modules/rules_shell/0.2.0/source.json": "7f27af3c28037d9701487c4744b5448d26537cc66cdef0d8df7ae85411f8de95", + "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", + "https://bcr.bazel.build/modules/rules_shell/0.3.0/source.json": "c55ed591aa5009401ddf80ded9762ac32c358d2517ee7820be981e2de9756cf3", "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", - "https://bcr.bazel.build/modules/stardoc/0.5.4/MODULE.bazel": "6569966df04610b8520957cb8e97cf2e9faac2c0309657c537ab51c16c18a2a4", "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", "https://bcr.bazel.build/modules/stardoc/0.6.2/MODULE.bazel": "7060193196395f5dd668eda046ccbeacebfd98efc77fed418dbe2b82ffaa39fd", "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", - "https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01", + "https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5", + "https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", - "https://bcr.bazel.build/modules/upb/0.0.0-20230516-61a97ef/MODULE.bazel": "c0df5e35ad55e264160417fd0875932ee3c9dda63d9fccace35ac62f45e1b6f9", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", @@ -164,501 +171,38 @@ }, "selectedYankedVersions": {}, "moduleExtensions": { - "@@aspect_bazel_lib+//lib:extensions.bzl%toolchains": { + "@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": { "general": { - "bzlTransitiveDigest": "I5Dn8KaM+QmZIvJc+N3i0dYz3X84t93U2VDZwDhbBYw=", - "usagesDigest": "YYPqHeJhWOHJ+KijY0m1OXK4GOMb/VlvjAzRdUPiSTA=", + "bzlTransitiveDigest": "84xJEZ1jnXXwo8BXMprvBm++rRt4jsTu9liBxz0ivps=", + "usagesDigest": "jTQDdLDxsS43zuRmg1faAjIEPWdLAbDAowI1pInQSoo=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "copy_directory_darwin_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", - "ruleClassName": "copy_directory_platform_repo", - "attributes": { - "platform": "darwin_amd64" - } - }, - "copy_directory_darwin_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", - "ruleClassName": "copy_directory_platform_repo", - "attributes": { - "platform": "darwin_arm64" - } - }, - "copy_directory_freebsd_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", - "ruleClassName": "copy_directory_platform_repo", - "attributes": { - "platform": "freebsd_amd64" - } - }, - "copy_directory_linux_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", - "ruleClassName": "copy_directory_platform_repo", - "attributes": { - "platform": "linux_amd64" - } - }, - "copy_directory_linux_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", - "ruleClassName": "copy_directory_platform_repo", - "attributes": { - "platform": "linux_arm64" - } - }, - "copy_directory_windows_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", - "ruleClassName": "copy_directory_platform_repo", - "attributes": { - "platform": "windows_amd64" - } - }, - "copy_directory_toolchains": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_directory_toolchain.bzl", - "ruleClassName": "copy_directory_toolchains_repo", - "attributes": { - "user_repository_name": "copy_directory" - } - }, - "copy_to_directory_darwin_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", - "ruleClassName": "copy_to_directory_platform_repo", - "attributes": { - "platform": "darwin_amd64" - } - }, - "copy_to_directory_darwin_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", - "ruleClassName": "copy_to_directory_platform_repo", - "attributes": { - "platform": "darwin_arm64" - } - }, - "copy_to_directory_freebsd_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", - "ruleClassName": "copy_to_directory_platform_repo", - "attributes": { - "platform": "freebsd_amd64" - } - }, - "copy_to_directory_linux_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", - "ruleClassName": "copy_to_directory_platform_repo", - "attributes": { - "platform": "linux_amd64" - } - }, - "copy_to_directory_linux_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", - "ruleClassName": "copy_to_directory_platform_repo", - "attributes": { - "platform": "linux_arm64" - } - }, - "copy_to_directory_windows_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", - "ruleClassName": "copy_to_directory_platform_repo", - "attributes": { - "platform": "windows_amd64" - } - }, - "copy_to_directory_toolchains": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:copy_to_directory_toolchain.bzl", - "ruleClassName": "copy_to_directory_toolchains_repo", - "attributes": { - "user_repository_name": "copy_to_directory" - } - }, - "jq_darwin_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", - "ruleClassName": "jq_platform_repo", - "attributes": { - "platform": "darwin_amd64", - "version": "1.7" - } - }, - "jq_darwin_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", - "ruleClassName": "jq_platform_repo", - "attributes": { - "platform": "darwin_arm64", - "version": "1.7" - } - }, - "jq_linux_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", - "ruleClassName": "jq_platform_repo", - "attributes": { - "platform": "linux_amd64", - "version": "1.7" - } - }, - "jq_linux_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", - "ruleClassName": "jq_platform_repo", - "attributes": { - "platform": "linux_arm64", - "version": "1.7" - } - }, - "jq_windows_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", - "ruleClassName": "jq_platform_repo", - "attributes": { - "platform": "windows_amd64", - "version": "1.7" - } - }, - "jq": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", - "ruleClassName": "jq_host_alias_repo", - "attributes": {} - }, - "jq_toolchains": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:jq_toolchain.bzl", - "ruleClassName": "jq_toolchains_repo", - "attributes": { - "user_repository_name": "jq" - } - }, - "yq_darwin_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", - "ruleClassName": "yq_platform_repo", - "attributes": { - "platform": "darwin_amd64", - "version": "4.25.2" - } - }, - "yq_darwin_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", - "ruleClassName": "yq_platform_repo", - "attributes": { - "platform": "darwin_arm64", - "version": "4.25.2" - } - }, - "yq_linux_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", - "ruleClassName": "yq_platform_repo", - "attributes": { - "platform": "linux_amd64", - "version": "4.25.2" - } - }, - "yq_linux_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", - "ruleClassName": "yq_platform_repo", - "attributes": { - "platform": "linux_arm64", - "version": "4.25.2" - } - }, - "yq_linux_s390x": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", - "ruleClassName": "yq_platform_repo", - "attributes": { - "platform": "linux_s390x", - "version": "4.25.2" - } - }, - "yq_linux_ppc64le": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", - "ruleClassName": "yq_platform_repo", - "attributes": { - "platform": "linux_ppc64le", - "version": "4.25.2" - } - }, - "yq_windows_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", - "ruleClassName": "yq_platform_repo", - "attributes": { - "platform": "windows_amd64", - "version": "4.25.2" - } - }, - "yq": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", - "ruleClassName": "yq_host_alias_repo", + "compatibility_proxy": { + "repoRuleId": "@@rules_java+//java:rules_java_deps.bzl%_compatibility_proxy_repo_rule", "attributes": {} - }, - "yq_toolchains": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:yq_toolchain.bzl", - "ruleClassName": "yq_toolchains_repo", - "attributes": { - "user_repository_name": "yq" - } - }, - "coreutils_darwin_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", - "ruleClassName": "coreutils_platform_repo", - "attributes": { - "platform": "darwin_amd64", - "version": "0.0.27" - } - }, - "coreutils_darwin_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", - "ruleClassName": "coreutils_platform_repo", - "attributes": { - "platform": "darwin_arm64", - "version": "0.0.27" - } - }, - "coreutils_linux_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", - "ruleClassName": "coreutils_platform_repo", - "attributes": { - "platform": "linux_amd64", - "version": "0.0.27" - } - }, - "coreutils_linux_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", - "ruleClassName": "coreutils_platform_repo", - "attributes": { - "platform": "linux_arm64", - "version": "0.0.27" - } - }, - "coreutils_windows_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", - "ruleClassName": "coreutils_platform_repo", - "attributes": { - "platform": "windows_amd64", - "version": "0.0.27" - } - }, - "coreutils_toolchains": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:coreutils_toolchain.bzl", - "ruleClassName": "coreutils_toolchains_repo", - "attributes": { - "user_repository_name": "coreutils" - } - }, - "bsd_tar_darwin_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", - "ruleClassName": "bsdtar_binary_repo", - "attributes": { - "platform": "darwin_amd64" - } - }, - "bsd_tar_darwin_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", - "ruleClassName": "bsdtar_binary_repo", - "attributes": { - "platform": "darwin_arm64" - } - }, - "bsd_tar_linux_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", - "ruleClassName": "bsdtar_binary_repo", - "attributes": { - "platform": "linux_amd64" - } - }, - "bsd_tar_linux_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", - "ruleClassName": "bsdtar_binary_repo", - "attributes": { - "platform": "linux_arm64" - } - }, - "bsd_tar_windows_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", - "ruleClassName": "bsdtar_binary_repo", - "attributes": { - "platform": "windows_amd64" - } - }, - "bsd_tar_toolchains": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:tar_toolchain.bzl", - "ruleClassName": "tar_toolchains_repo", - "attributes": { - "user_repository_name": "bsd_tar" - } - }, - "zstd_darwin_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", - "ruleClassName": "zstd_binary_repo", - "attributes": { - "platform": "darwin_amd64" - } - }, - "zstd_darwin_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", - "ruleClassName": "zstd_binary_repo", - "attributes": { - "platform": "darwin_arm64" - } - }, - "zstd_linux_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", - "ruleClassName": "zstd_binary_repo", - "attributes": { - "platform": "linux_amd64" - } - }, - "zstd_linux_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", - "ruleClassName": "zstd_binary_repo", - "attributes": { - "platform": "linux_arm64" - } - }, - "zstd_toolchains": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:zstd_toolchain.bzl", - "ruleClassName": "zstd_toolchains_repo", - "attributes": { - "user_repository_name": "zstd" - } - }, - "expand_template_darwin_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", - "ruleClassName": "expand_template_platform_repo", - "attributes": { - "platform": "darwin_amd64" - } - }, - "expand_template_darwin_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", - "ruleClassName": "expand_template_platform_repo", - "attributes": { - "platform": "darwin_arm64" - } - }, - "expand_template_freebsd_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", - "ruleClassName": "expand_template_platform_repo", - "attributes": { - "platform": "freebsd_amd64" - } - }, - "expand_template_linux_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", - "ruleClassName": "expand_template_platform_repo", - "attributes": { - "platform": "linux_amd64" - } - }, - "expand_template_linux_arm64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", - "ruleClassName": "expand_template_platform_repo", - "attributes": { - "platform": "linux_arm64" - } - }, - "expand_template_windows_amd64": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", - "ruleClassName": "expand_template_platform_repo", - "attributes": { - "platform": "windows_amd64" - } - }, - "expand_template_toolchains": { - "bzlFile": "@@aspect_bazel_lib+//lib/private:expand_template_toolchain.bzl", - "ruleClassName": "expand_template_toolchains_repo", - "attributes": { - "user_repository_name": "expand_template" - } - }, - "bats_support": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "7815237aafeb42ddcc1b8c698fc5808026d33317d8701d5ec2396e9634e2918f", - "urls": [ - "https://github.com/bats-core/bats-support/archive/v0.3.0.tar.gz" - ], - "strip_prefix": "bats-support-0.3.0", - "build_file_content": "load(\"@aspect_bazel_lib//lib:copy_to_directory.bzl\", \"copy_to_directory\")\n\ncopy_to_directory(\n name = \"support\",\n hardlink = \"on\",\n srcs = glob([\n \"src/**\",\n \"load.bash\",\n ]),\n out = \"bats-support\",\n visibility = [\"//visibility:public\"]\n)\n" - } - }, - "bats_assert": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "98ca3b685f8b8993e48ec057565e6e2abcc541034ed5b0e81f191505682037fd", - "urls": [ - "https://github.com/bats-core/bats-assert/archive/v2.1.0.tar.gz" - ], - "strip_prefix": "bats-assert-2.1.0", - "build_file_content": "load(\"@aspect_bazel_lib//lib:copy_to_directory.bzl\", \"copy_to_directory\")\n\ncopy_to_directory(\n name = \"assert\",\n hardlink = \"on\",\n srcs = glob([\n \"src/**\",\n \"load.bash\",\n ]),\n out = \"bats-assert\",\n visibility = [\"//visibility:public\"]\n)\n" - } - }, - "bats_file": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "9b69043241f3af1c2d251f89b4fcafa5df3f05e97b89db18d7c9bdf5731bb27a", - "urls": [ - "https://github.com/bats-core/bats-file/archive/v0.4.0.tar.gz" - ], - "strip_prefix": "bats-file-0.4.0", - "build_file_content": "load(\"@aspect_bazel_lib//lib:copy_to_directory.bzl\", \"copy_to_directory\")\n\ncopy_to_directory(\n name = \"file\",\n hardlink = \"on\",\n srcs = glob([\n \"src/**\",\n \"load.bash\",\n ]),\n out = \"bats-file\",\n visibility = [\"//visibility:public\"]\n)\n" - } - }, - "bats_toolchains": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "a1a9f7875aa4b6a9480ca384d5865f1ccf1b0b1faead6b47aa47d79709a5c5fd", - "urls": [ - "https://github.com/bats-core/bats-core/archive/v1.10.0.tar.gz" - ], - "strip_prefix": "bats-core-1.10.0", - "build_file_content": "load(\"@local_config_platform//:constraints.bzl\", \"HOST_CONSTRAINTS\")\nload(\"@aspect_bazel_lib//lib/private:bats_toolchain.bzl\", \"bats_toolchain\")\nload(\"@aspect_bazel_lib//lib:copy_to_directory.bzl\", \"copy_to_directory\")\n\ncopy_to_directory(\n name = \"core\",\n hardlink = \"on\",\n srcs = glob([\n \"lib/**\",\n \"libexec/**\"\n ]) + [\"bin/bats\"],\n out = \"bats-core\",\n)\n\nbats_toolchain(\n name = \"toolchain\",\n core = \":core\",\n libraries = [\"@bats_support//:support\", \"@bats_assert//:assert\", \"@bats_file//:file\"]\n)\n\ntoolchain(\n name = \"bats_toolchain\",\n exec_compatible_with = HOST_CONSTRAINTS,\n toolchain = \":toolchain\",\n toolchain_type = \"@aspect_bazel_lib//lib:bats_toolchain_type\",\n)\n" - } } }, "recordedRepoMappingEntries": [ [ - "aspect_bazel_lib+", - "aspect_bazel_lib", - "aspect_bazel_lib+" - ], - [ - "aspect_bazel_lib+", - "bazel_skylib", - "bazel_skylib+" - ], - [ - "aspect_bazel_lib+", + "rules_java+", "bazel_tools", "bazel_tools" ] ] } }, - "@@platforms//host:extension.bzl%host_platform": { - "general": { - "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", - "usagesDigest": "8W6Zg78qF8FKyH5W6tdCEg4ggAxf1blvO14DM0+KEnM=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "host_platform": { - "bzlFile": "@@platforms//host:extension.bzl", - "ruleClassName": "host_platform_repo", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [] - } - }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { - "bzlTransitiveDigest": "Nw+JSQUn0q8PZ9L+AACqdvNxzdn8VPWq4KgCeLdtYg0=", + "bzlTransitiveDigest": "sFhcgPbDQehmbD1EOXzX4H1q/CD5df8zwG4kp4jbvr8=", "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { "com_github_jetbrains_kotlin_git": { - "bzlFile": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl", - "ruleClassName": "kotlin_compiler_git_repository", + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository", "attributes": { "urls": [ "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" @@ -667,16 +211,14 @@ } }, "com_github_jetbrains_kotlin": { - "bzlFile": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl", - "ruleClassName": "kotlin_capabilities_repository", + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository", "attributes": { "git_repository_name": "com_github_jetbrains_kotlin_git", "compiler_version": "1.9.23" } }, "com_github_google_ksp": { - "bzlFile": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl", - "ruleClassName": "ksp_compiler_plugin_repository", + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository", "attributes": { "urls": [ "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" @@ -686,8 +228,7 @@ } }, "com_github_pinterest_ktlint": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", "urls": [ @@ -697,8 +238,7 @@ } }, "rules_android": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", "strip_prefix": "rules_android-0.1.1", @@ -720,14 +260,13 @@ "@@rules_nodejs+//nodejs:extensions.bzl%node": { "general": { "bzlTransitiveDigest": "SqbzUarOVzAfK28Ca5+NIU3LUwnW/b3h0xXBUS97oyI=", - "usagesDigest": "34/6ou8eW2MB82HSiYBcfVzZkGk1rL1teO3wuFqFAe0=", + "usagesDigest": "WwsoV43ebIv5kLJEfLv2NARBDiqSvEinQyb9Rhj9V2Y=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { "nodejs_linux_amd64": { - "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", - "ruleClassName": "_nodejs_repositories", + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", "attributes": { "node_download_auth": {}, "node_repositories": {}, @@ -740,8 +279,7 @@ } }, "nodejs_linux_arm64": { - "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", - "ruleClassName": "_nodejs_repositories", + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", "attributes": { "node_download_auth": {}, "node_repositories": {}, @@ -754,8 +292,7 @@ } }, "nodejs_linux_s390x": { - "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", - "ruleClassName": "_nodejs_repositories", + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", "attributes": { "node_download_auth": {}, "node_repositories": {}, @@ -768,8 +305,7 @@ } }, "nodejs_linux_ppc64le": { - "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", - "ruleClassName": "_nodejs_repositories", + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", "attributes": { "node_download_auth": {}, "node_repositories": {}, @@ -782,8 +318,7 @@ } }, "nodejs_darwin_amd64": { - "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", - "ruleClassName": "_nodejs_repositories", + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", "attributes": { "node_download_auth": {}, "node_repositories": {}, @@ -796,8 +331,7 @@ } }, "nodejs_darwin_arm64": { - "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", - "ruleClassName": "_nodejs_repositories", + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", "attributes": { "node_download_auth": {}, "node_repositories": {}, @@ -810,8 +344,7 @@ } }, "nodejs_windows_amd64": { - "bzlFile": "@@rules_nodejs+//nodejs:repositories.bzl", - "ruleClassName": "_nodejs_repositories", + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", "attributes": { "node_download_auth": {}, "node_repositories": {}, @@ -824,22 +357,19 @@ } }, "nodejs": { - "bzlFile": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl", - "ruleClassName": "nodejs_repo_host_os_alias", + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", "attributes": { "user_node_repository_name": "nodejs" } }, "nodejs_host": { - "bzlFile": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl", - "ruleClassName": "nodejs_repo_host_os_alias", + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", "attributes": { "user_node_repository_name": "nodejs" } }, "nodejs_toolchains": { - "bzlFile": "@@rules_nodejs+//nodejs/private:nodejs_toolchains_repo.bzl", - "ruleClassName": "nodejs_toolchains_repo", + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_toolchains_repo.bzl%nodejs_toolchains_repo", "attributes": { "user_node_repository_name": "nodejs" } diff --git a/go.mod b/go.mod index fe30a4db..ac9e24a2 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/loeffel-io/ls-lint/v2 -go 1.23.3 +go 1.24 require ( - github.com/bmatcuk/doublestar/v4 v4.7.1 - golang.org/x/sync v0.9.0 + github.com/bmatcuk/doublestar/v4 v4.8.1 + golang.org/x/sync v0.12.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index c7482ee7..bc9b2b0c 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ -github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= -github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +github.com/bmatcuk/doublestar/v4 v4.8.1 h1:54Bopc5c2cAvhLRAzqOGCYHYyhcDHsFF4wWIR5wKP38= +github.com/bmatcuk/doublestar/v4 v4.8.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From 568ffa4388fe9d7e4912a75ef4115585f76d1a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Wed, 26 Mar 2025 15:41:41 +0100 Subject: [PATCH 107/117] chore: bump rules js --- MODULE.bazel | 2 +- MODULE.bazel.lock | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 12753a74..f93ba592 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -3,7 +3,7 @@ bazel_dep(name = "rules_go", version = "0.53.0", dev_dependency = True) bazel_dep(name = "gazelle", version = "0.42.0", dev_dependency = True) bazel_dep(name = "rules_pkg", version = "1.1.0", dev_dependency = True) bazel_dep(name = "aspect_bazel_lib", version = "2.14.0", dev_dependency = True) -bazel_dep(name = "aspect_rules_js", version = "2.2.0", dev_dependency = True) +bazel_dep(name = "aspect_rules_js", version = "2.3.3", dev_dependency = True) #################################################################### # rules_go ######################################################### diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index e0b89f87..0c5e4b1a 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -12,9 +12,8 @@ "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da", "https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/MODULE.bazel": "2b31ffcc9bdc8295b2167e07a757dbbc9ac8906e7028e5170a3708cecaac119f", "https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/source.json": "0cf1826853b0bef8b5cd19c0610d717500f5521aa2b38b72b2ec302ac5e7526c", - "https://bcr.bazel.build/modules/aspect_bazel_lib/2.8.1/MODULE.bazel": "812d2dd42f65dca362152101fbec418029cc8fd34cbad1a2fde905383d705838", - "https://bcr.bazel.build/modules/aspect_rules_js/2.2.0/MODULE.bazel": "9717953f83617605e390611bba3e1d5fbc327ded04cf0510df4dc393a0259900", - "https://bcr.bazel.build/modules/aspect_rules_js/2.2.0/source.json": "44f2c2ee7f6a32c3cf8a5cb370bdbb8b7f128ed9bff4f8df0e72c4a5e1a64bcc", + "https://bcr.bazel.build/modules/aspect_rules_js/2.3.3/MODULE.bazel": "7a09f106e5c52fc3594e3d55356e331dec05095bf50de529e0c33c4dbf3914ef", + "https://bcr.bazel.build/modules/aspect_rules_js/2.3.3/source.json": "8f254bddb19525f73a1a5fea22c762d18c829e89c5a5095d5ef44ed96a1ec4e9", "https://bcr.bazel.build/modules/bazel_features/1.1.0/MODULE.bazel": "cfd42ff3b815a5f39554d97182657f8c4b9719568eb7fded2b9135f084bf760b", "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", @@ -260,7 +259,7 @@ "@@rules_nodejs+//nodejs:extensions.bzl%node": { "general": { "bzlTransitiveDigest": "SqbzUarOVzAfK28Ca5+NIU3LUwnW/b3h0xXBUS97oyI=", - "usagesDigest": "WwsoV43ebIv5kLJEfLv2NARBDiqSvEinQyb9Rhj9V2Y=", + "usagesDigest": "F14xD97ukqt7Niw1r++eCv6qP/t/JtkUJkpqh2cf0Bk=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, From 5c0d10451b0a2ee1fa09e4794cff48fc7f65b2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Wed, 26 Mar 2025 15:42:54 +0100 Subject: [PATCH 108/117] chore: bump bazel docker image --- .github/workflows/bazel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index ff985bc8..216d8894 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -6,7 +6,7 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest container: - image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a + image: gcr.io/bazel-public/bazel@sha256:62d6f3299bef1495cb4744960e315a3dcf158a6330093b51a977431b512c78a4 options: --user root env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -26,7 +26,7 @@ jobs: if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest container: - image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a + image: gcr.io/bazel-public/bazel@sha256:62d6f3299bef1495cb4744960e315a3dcf158a6330093b51a977431b512c78a4 options: --user root steps: - run: set -eu @@ -41,7 +41,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest container: - image: gcr.io/bazel-public/bazel@sha256:35c128509642f76fede4ade16e8c829781048f6a62a7b2d9cfbabd45246af81a + image: gcr.io/bazel-public/bazel@sha256:62d6f3299bef1495cb4744960e315a3dcf158a6330093b51a977431b512c78a4 options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user env: GH_TOKEN: ${{ github.token }} From e3c95c624e800f95a02d0f95bba37b8aae2f8710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Wed, 26 Mar 2025 16:05:43 +0100 Subject: [PATCH 109/117] fix: do not delete unmatched patterns from the index --- internal/glob/glob.go | 2 +- internal/linter/linter_test.go | 11 +++++++++++ internal/rule/exists.go | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/internal/glob/glob.go b/internal/glob/glob.go index abb2598f..11cc65d3 100644 --- a/internal/glob/glob.go +++ b/internal/glob/glob.go @@ -22,7 +22,7 @@ func Index(filesystem fs.FS, index config.RuleIndex, files bool) (err error) { } if len(matches) == 0 { - delete(index, key) + // delete(index, key) // https://github.com/loeffel-io/ls-lint/issues/249 continue } diff --git a/internal/linter/linter_test.go b/internal/linter/linter_test.go index cea37e46..b44e3e2a 100644 --- a/internal/linter/linter_test.go +++ b/internal/linter/linter_test.go @@ -517,6 +517,9 @@ func TestLinter_Run(t *testing.T) { "not_exists": config.Ls{ ".dir": "exists:1", }, + "dir_not_exists/*/not_exists": config.Ls{ + ".dir": "exists", + }, "wildcards/**": config.Ls{ ".dir": "exists:1", ".*": "snake_case | exists:1", @@ -636,6 +639,14 @@ func TestLinter_Run(t *testing.T) { }, RWMutex: new(sync.RWMutex), }, + { + Path: "dir_not_exists/*/not_exists", + Ext: ".dir", + Rules: []rule.Rule{ + new(rule.Exists).Init(), + }, + RWMutex: new(sync.RWMutex), + }, }, }, { diff --git a/internal/rule/exists.go b/internal/rule/exists.go index 1a26c9ff..10dce723 100644 --- a/internal/rule/exists.go +++ b/internal/rule/exists.go @@ -140,10 +140,10 @@ func (rule *Exists) incrementCount() { func (rule *Exists) GetErrorMessage() string { if rule.getMin() == rule.getMax() { - return fmt.Sprintf("%s:%d (debug: %d)", rule.GetName(), rule.getMin(), rule.getCount()) + return fmt.Sprintf("%s:%d (found %d)", rule.GetName(), rule.getMin(), rule.getCount()) } - return fmt.Sprintf("%s:%d-%d (debug: %d)", rule.GetName(), rule.getMin(), rule.getMax(), rule.getCount()) + return fmt.Sprintf("%s:%d-%d (found %d)", rule.GetName(), rule.getMin(), rule.getMax(), rule.getCount()) } func (rule *Exists) Copy() Rule { From b7b34f6b16bf52063654ae3f7c8facc2ab2aadb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Wed, 26 Mar 2025 17:14:06 +0100 Subject: [PATCH 110/117] feat: regex negate --- internal/rule/BUILD.bazel | 2 - internal/rule/not_regex.go | 85 --------------------------------- internal/rule/not_regex_test.go | 49 ------------------- internal/rule/regex.go | 23 ++++++++- internal/rule/rule.go | 6 ++- 5 files changed, 25 insertions(+), 140 deletions(-) delete mode 100644 internal/rule/not_regex.go delete mode 100644 internal/rule/not_regex_test.go diff --git a/internal/rule/BUILD.bazel b/internal/rule/BUILD.bazel index 0e8019e5..261b8dab 100644 --- a/internal/rule/BUILD.bazel +++ b/internal/rule/BUILD.bazel @@ -8,7 +8,6 @@ go_library( "exists.go", "kebabcase.go", "lowercase.go", - "not_regex.go", "pascalcase.go", "regex.go", "rule.go", @@ -26,7 +25,6 @@ go_test( "exists_test.go", "kebabcase_test.go", "lowercase_test.go", - "not_regex_test.go", "pascalcase_test.go", "regex_test.go", "rule_test.go", diff --git a/internal/rule/not_regex.go b/internal/rule/not_regex.go deleted file mode 100644 index 32f10bac..00000000 --- a/internal/rule/not_regex.go +++ /dev/null @@ -1,85 +0,0 @@ -package rule - -import ( - "fmt" - "regexp" - "sync" -) - -type NotRegex struct { - name string - exclusive bool - regexPattern string - *sync.RWMutex -} - -func (rule *NotRegex) Init() Rule { - rule.name = "not_regex" - rule.exclusive = false - rule.RWMutex = new(sync.RWMutex) - - return rule -} - -func (rule *NotRegex) GetName() string { - rule.RLock() - defer rule.RUnlock() - - return rule.name -} - -// 0 = regex pattern -func (rule *NotRegex) SetParameters(params []string) error { - rule.Lock() - defer rule.Unlock() - - if len(params) == 0 { - return fmt.Errorf("not_regex pattern not exists") - } - - if params[0] == "" { - return fmt.Errorf("not_regex pattern is empty") - } - - rule.regexPattern = params[0] - return nil -} - -func (rule *NotRegex) GetParameters() []string { - return []string{rule.regexPattern} -} - -func (rule *NotRegex) GetExclusive() bool { - rule.RLock() - defer rule.RUnlock() - - return rule.exclusive -} - -// Validate checks if the full string does NOT match the regex -func (rule *NotRegex) Validate(value string, fail bool) (bool, error) { - match, err := regexp.MatchString(fmt.Sprintf("^%s$", rule.getRegexPattern()), value) - return !match, err -} - -func (rule *NotRegex) getRegexPattern() string { - rule.RLock() - defer rule.RUnlock() - - return rule.regexPattern -} - -func (rule *NotRegex) GetErrorMessage() string { - return fmt.Sprintf("%s:%s", rule.GetName(), rule.getRegexPattern()) -} - -func (rule *NotRegex) Copy() Rule { - rule.RLock() - defer rule.RUnlock() - - c := new(NotRegex) - c.Init() - c.regexPattern = rule.regexPattern - - return c -} diff --git a/internal/rule/not_regex_test.go b/internal/rule/not_regex_test.go deleted file mode 100644 index ebdd24a6..00000000 --- a/internal/rule/not_regex_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package rule - -import ( - "errors" - "testing" -) - -func TestNotRegex(t *testing.T) { - tests := []*struct { - params []string - value string - expected bool - err error - }{ - {params: []string{".+"}, value: "regex", expected: false, err: nil}, - {params: []string{"[0-9]+"}, value: "123", expected: false, err: nil}, - {params: []string{"[a-z]+"}, value: "123", expected: true, err: nil}, - {params: []string{"[a-z\\-]+"}, value: "google-test", expected: false, err: nil}, - {params: []string{"[a-z\\-]+"}, value: "google.test", expected: true, err: nil}, - } - - i := 0 - for _, test := range tests { - rule := new(NotRegex).Init() - - // parameters - err := rule.SetParameters(test.params) - - if !errors.Is(err, test.err) { - t.Errorf("Test %d failed with unmatched error - %e", i, err) - return - } - - // validate - res, err := rule.Validate(test.value, true) - - if err != nil && err != test.err { - t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) - return - } - - if res != test.expected { - t.Errorf("Test %d failed with unmatched return value - %+v", i, res) - return - } - - i++ - } -} diff --git a/internal/rule/regex.go b/internal/rule/regex.go index dc8c5e64..c0d4564b 100644 --- a/internal/rule/regex.go +++ b/internal/rule/regex.go @@ -6,10 +6,13 @@ import ( "sync" ) +const negate = '!' + type Regex struct { name string exclusive bool regexPattern string + negate bool *sync.RWMutex } @@ -41,11 +44,22 @@ func (rule *Regex) SetParameters(params []string) error { return fmt.Errorf("regex pattern is empty") } + if params[0][0] == negate { + rule.negate = true + rule.regexPattern = params[0][1:] + return nil + } + + rule.negate = false rule.regexPattern = params[0] return nil } func (rule *Regex) GetParameters() []string { + if rule.negate { + return []string{string(negate) + rule.regexPattern} + } + return []string{rule.regexPattern} } @@ -58,7 +72,8 @@ func (rule *Regex) GetExclusive() bool { // Validate checks if full string matches regex func (rule *Regex) Validate(value string, fail bool) (bool, error) { - return regexp.MatchString(fmt.Sprintf("^%s$", rule.getRegexPattern()), value) + match, err := regexp.MatchString("^"+rule.getRegexPattern()+"$", value) + return match != rule.negate, err } func (rule *Regex) getRegexPattern() string { @@ -69,6 +84,10 @@ func (rule *Regex) getRegexPattern() string { } func (rule *Regex) GetErrorMessage() string { + if rule.negate { + return fmt.Sprintf("%s:%s", rule.GetName(), string(negate)+rule.getRegexPattern()) + } + return fmt.Sprintf("%s:%s", rule.GetName(), rule.getRegexPattern()) } @@ -79,6 +98,6 @@ func (rule *Regex) Copy() Rule { c := new(Regex) c.Init() c.regexPattern = rule.regexPattern - + c.negate = rule.negate return c } diff --git a/internal/rule/rule.go b/internal/rule/rule.go index 25e24747..318fefa7 100644 --- a/internal/rule/rule.go +++ b/internal/rule/rule.go @@ -3,7 +3,6 @@ package rule var RulesIndex = map[string]Rule{ "lowercase": new(Lowercase).Init(), "regex": new(Regex).Init(), - "not_regex": new(NotRegex).Init(), "exists": new(Exists).Init(), "camelcase": new(CamelCase).Init(), @@ -16,7 +15,6 @@ var RulesIndex = map[string]Rule{ var Rules = map[string]Rule{ "lowercase": RulesIndex["lowercase"], "regex": RulesIndex["regex"], - "not_regex": RulesIndex["not_regex"], "exists": RulesIndex["exists"], "camelcase": RulesIndex["camelcase"], @@ -41,6 +39,10 @@ type Rule interface { SetParameters(params []string) error GetParameters() []string GetExclusive() bool + // Validate validates the value with the rule + // value: + // - file: filename without extension + // - dir: basename Validate(value string, fail bool) (bool, error) GetErrorMessage() string Copy() Rule From 1c4660c9c40e35f81e817db5d32564f717f2d0ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Wed, 26 Mar 2025 17:26:17 +0100 Subject: [PATCH 111/117] chore: add regex negate test --- internal/rule/regex_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/rule/regex_test.go b/internal/rule/regex_test.go index 71e21297..c058b760 100644 --- a/internal/rule/regex_test.go +++ b/internal/rule/regex_test.go @@ -14,6 +14,7 @@ func TestRegex(t *testing.T) { }{ {params: []string{".+"}, value: "regex", expected: true, err: nil}, {params: []string{"[0-9]+"}, value: "123", expected: true, err: nil}, + {params: []string{"![0-9]+"}, value: "123", expected: false, err: nil}, {params: []string{"[a-z]+"}, value: "123", expected: false, err: nil}, {params: []string{"[a-z\\-]+"}, value: "google-test", expected: true, err: nil}, {params: []string{"[a-z\\-]+"}, value: "google.test", expected: false, err: nil}, From 5f2deeb3f4de34e84da5c931e72f76243c3aff3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Wed, 26 Mar 2025 17:41:43 +0100 Subject: [PATCH 112/117] chore: extend rule interface --- internal/linter/linter.go | 6 +++--- internal/rule/camelcase.go | 2 +- internal/rule/camelcase_test.go | 2 +- internal/rule/exists.go | 2 +- internal/rule/exists_test.go | 2 +- internal/rule/kebabcase.go | 2 +- internal/rule/kebabcase_test.go | 2 +- internal/rule/lowercase.go | 2 +- internal/rule/lowercase_test.go | 2 +- internal/rule/pascalcase.go | 2 +- internal/rule/pascalcase_test.go | 2 +- internal/rule/regex.go | 2 +- internal/rule/regex_test.go | 15 ++++++++------- internal/rule/rule.go | 3 ++- internal/rule/screamingsnakecase.go | 2 +- internal/rule/screamingsnakecase_test.go | 2 +- internal/rule/snakecase.go | 2 +- internal/rule/snakecase_test.go | 2 +- 18 files changed, 28 insertions(+), 26 deletions(-) diff --git a/internal/linter/linter.go b/internal/linter/linter.go index 9bcfaec0..05c55308 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -94,7 +94,7 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate return nil } - valid, err := ruleDir.Validate(basename, ruleDir.GetName() != "exists") + valid, err := ruleDir.Validate(basename, "", ruleDir.GetName() != "exists") if err != nil { return err } @@ -177,7 +177,7 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate return nil } - valid, err := ruleFile.Validate(withoutExt, ruleFile.GetName() != "exists") + valid, err := ruleFile.Validate(withoutExt, "", ruleFile.GetName() != "exists") if err != nil { return err } @@ -372,7 +372,7 @@ func (linter *Linter) Run(filesystem fs.FS, paths map[string]struct{}, debug boo } var valid bool - if valid, err = r.Validate("", true); err != nil { + if valid, err = r.Validate("", "", true); err != nil { return err } diff --git a/internal/rule/camelcase.go b/internal/rule/camelcase.go index 65300c71..678a0ec4 100644 --- a/internal/rule/camelcase.go +++ b/internal/rule/camelcase.go @@ -43,7 +43,7 @@ func (rule *CamelCase) GetExclusive() bool { // Validate checks if string is camel case // false if rune is no letter and no digit -func (rule *CamelCase) Validate(value string, fail bool) (bool, error) { +func (rule *CamelCase) Validate(value string, _ string, _ bool) (bool, error) { for i, c := range value { // must be letter or digit if !unicode.IsLetter(c) && !unicode.IsDigit(c) { diff --git a/internal/rule/camelcase_test.go b/internal/rule/camelcase_test.go index f39b46e0..8b2c6ae5 100644 --- a/internal/rule/camelcase_test.go +++ b/internal/rule/camelcase_test.go @@ -26,7 +26,7 @@ func TestCamelCase(t *testing.T) { i := 0 for _, test := range tests { - res, err := rule.Validate(test.value, true) + res, err := rule.Validate(test.value, "", true) if !errors.Is(err, test.err) { t.Errorf("Test %d failed with unmatched error - %e", i, err) diff --git a/internal/rule/exists.go b/internal/rule/exists.go index 10dce723..bdf9060c 100644 --- a/internal/rule/exists.go +++ b/internal/rule/exists.go @@ -101,7 +101,7 @@ func (rule *Exists) GetExclusive() bool { return rule.exclusive } -func (rule *Exists) Validate(value string, fail bool) (bool, error) { +func (rule *Exists) Validate(value string, _ string, fail bool) (bool, error) { if !fail { rule.incrementCount() return true, nil diff --git a/internal/rule/exists_test.go b/internal/rule/exists_test.go index 88a175b9..cae501b5 100644 --- a/internal/rule/exists_test.go +++ b/internal/rule/exists_test.go @@ -59,7 +59,7 @@ func TestExists_Validate(t *testing.T) { i := 0 for _, test := range tests { - valid, err := test.rule.Validate("", test.fail) + valid, err := test.rule.Validate("", "", test.fail) if !errors.Is(err, test.err) { t.Errorf("Test %d failed with unmatched error - %e", i, err) diff --git a/internal/rule/kebabcase.go b/internal/rule/kebabcase.go index 5c2d4761..755c0d42 100644 --- a/internal/rule/kebabcase.go +++ b/internal/rule/kebabcase.go @@ -43,7 +43,7 @@ func (rule *KebabCase) GetExclusive() bool { // Validate checks if string is kebab case // false if rune is no lowercase letter, digit or - -func (rule *KebabCase) Validate(value string, fail bool) (bool, error) { +func (rule *KebabCase) Validate(value string, _ string, _ bool) (bool, error) { for _, c := range value { if c == 45 || unicode.IsDigit(c) { // 45 => - continue diff --git a/internal/rule/kebabcase_test.go b/internal/rule/kebabcase_test.go index 200159e5..09cc1815 100644 --- a/internal/rule/kebabcase_test.go +++ b/internal/rule/kebabcase_test.go @@ -24,7 +24,7 @@ func TestKebabCase(t *testing.T) { i := 0 for _, test := range tests { - res, err := rule.Validate(test.value, true) + res, err := rule.Validate(test.value, "", true) if !errors.Is(err, test.err) { t.Errorf("Test %d failed with unmatched error - %e", i, err) diff --git a/internal/rule/lowercase.go b/internal/rule/lowercase.go index 1ae43dbb..af31c78a 100644 --- a/internal/rule/lowercase.go +++ b/internal/rule/lowercase.go @@ -42,7 +42,7 @@ func (rule *Lowercase) GetExclusive() bool { } // Validate checks if every letter is lower -func (rule *Lowercase) Validate(value string, fail bool) (bool, error) { +func (rule *Lowercase) Validate(value string, _ string, _ bool) (bool, error) { for _, c := range value { if unicode.IsLetter(c) && !unicode.IsLower(c) { return false, nil diff --git a/internal/rule/lowercase_test.go b/internal/rule/lowercase_test.go index 286ee43f..95c2d2aa 100644 --- a/internal/rule/lowercase_test.go +++ b/internal/rule/lowercase_test.go @@ -16,7 +16,7 @@ func TestLowercase(t *testing.T) { i := 0 for _, test := range tests { - res, err := rule.Validate(test.value, true) + res, err := rule.Validate(test.value, "", true) if !errors.Is(err, test.err) { t.Errorf("Test %d failed with unmatched error - %e", i, err) diff --git a/internal/rule/pascalcase.go b/internal/rule/pascalcase.go index ad9636b8..bd41d8d8 100644 --- a/internal/rule/pascalcase.go +++ b/internal/rule/pascalcase.go @@ -44,7 +44,7 @@ func (rule *PascalCase) GetExclusive() bool { // Validate checks if string is pascal case // false if rune is no letter and no digit // false if first rune is not upper -func (rule *PascalCase) Validate(value string, fail bool) (bool, error) { +func (rule *PascalCase) Validate(value string, _ string, _ bool) (bool, error) { for i, c := range value { // must be letter or digit if !unicode.IsLetter(c) && !unicode.IsDigit(c) { diff --git a/internal/rule/pascalcase_test.go b/internal/rule/pascalcase_test.go index 4a95f94c..73340144 100644 --- a/internal/rule/pascalcase_test.go +++ b/internal/rule/pascalcase_test.go @@ -25,7 +25,7 @@ func TestPascalCase(t *testing.T) { i := 0 for _, test := range tests { - res, err := rule.Validate(test.value, true) + res, err := rule.Validate(test.value, "", true) if !errors.Is(err, test.err) { t.Errorf("Test %d failed with unmatched error - %e", i, err) diff --git a/internal/rule/regex.go b/internal/rule/regex.go index c0d4564b..1ab508c8 100644 --- a/internal/rule/regex.go +++ b/internal/rule/regex.go @@ -71,7 +71,7 @@ func (rule *Regex) GetExclusive() bool { } // Validate checks if full string matches regex -func (rule *Regex) Validate(value string, fail bool) (bool, error) { +func (rule *Regex) Validate(value string, path string, _ bool) (bool, error) { match, err := regexp.MatchString("^"+rule.getRegexPattern()+"$", value) return match != rule.negate, err } diff --git a/internal/rule/regex_test.go b/internal/rule/regex_test.go index c058b760..f47a77c4 100644 --- a/internal/rule/regex_test.go +++ b/internal/rule/regex_test.go @@ -9,15 +9,16 @@ func TestRegex(t *testing.T) { tests := []*struct { params []string value string + path string expected bool err error }{ - {params: []string{".+"}, value: "regex", expected: true, err: nil}, - {params: []string{"[0-9]+"}, value: "123", expected: true, err: nil}, - {params: []string{"![0-9]+"}, value: "123", expected: false, err: nil}, - {params: []string{"[a-z]+"}, value: "123", expected: false, err: nil}, - {params: []string{"[a-z\\-]+"}, value: "google-test", expected: true, err: nil}, - {params: []string{"[a-z\\-]+"}, value: "google.test", expected: false, err: nil}, + {params: []string{".+"}, value: "regex", path: "", expected: true, err: nil}, + {params: []string{"[0-9]+"}, value: "123", path: "", expected: true, err: nil}, + {params: []string{"![0-9]+"}, value: "123", path: "", expected: false, err: nil}, + {params: []string{"[a-z]+"}, value: "123", path: "", expected: false, err: nil}, + {params: []string{"[a-z\\-]+"}, value: "google-test", path: "", expected: true, err: nil}, + {params: []string{"[a-z\\-]+"}, value: "google.test", path: "", expected: false, err: nil}, } i := 0 @@ -33,7 +34,7 @@ func TestRegex(t *testing.T) { } // validate - res, err := rule.Validate(test.value, true) + res, err := rule.Validate(test.value, test.path, true) if err != nil && err != test.err { t.Errorf("Test %d failed with unmatched error - %s", i, err.Error()) diff --git a/internal/rule/rule.go b/internal/rule/rule.go index 318fefa7..2bbeae2e 100644 --- a/internal/rule/rule.go +++ b/internal/rule/rule.go @@ -43,7 +43,8 @@ type Rule interface { // value: // - file: filename without extension // - dir: basename - Validate(value string, fail bool) (bool, error) + // path: full path to file or dir + Validate(value string, path string, fail bool) (bool, error) GetErrorMessage() string Copy() Rule } diff --git a/internal/rule/screamingsnakecase.go b/internal/rule/screamingsnakecase.go index 57d00714..188804b2 100644 --- a/internal/rule/screamingsnakecase.go +++ b/internal/rule/screamingsnakecase.go @@ -43,7 +43,7 @@ func (rule *ScreamingSnakeCase) GetExclusive() bool { // Validate checks if string is screaming sneak case // false if rune is no uppercase letter, digit or _ -func (rule *ScreamingSnakeCase) Validate(value string, fail bool) (bool, error) { +func (rule *ScreamingSnakeCase) Validate(value string, _ string, _ bool) (bool, error) { for _, c := range value { if c == 95 || unicode.IsDigit(c) { // 95 => _ continue diff --git a/internal/rule/screamingsnakecase_test.go b/internal/rule/screamingsnakecase_test.go index 6bb54f4e..6fbc04fd 100644 --- a/internal/rule/screamingsnakecase_test.go +++ b/internal/rule/screamingsnakecase_test.go @@ -26,7 +26,7 @@ func TestScreamingSnakeCase(t *testing.T) { i := 0 for _, test := range tests { - res, err := rule.Validate(test.value, true) + res, err := rule.Validate(test.value, "", true) if !errors.Is(err, test.err) { t.Errorf("Test %d failed with unmatched error - %e", i, err) diff --git a/internal/rule/snakecase.go b/internal/rule/snakecase.go index d73a2265..9df40104 100644 --- a/internal/rule/snakecase.go +++ b/internal/rule/snakecase.go @@ -43,7 +43,7 @@ func (rule *SnakeCase) GetExclusive() bool { // Validate checks if string is sneak case // false if rune is no lowercase letter, digit or _ -func (rule *SnakeCase) Validate(value string, fail bool) (bool, error) { +func (rule *SnakeCase) Validate(value string, _ string, _ bool) (bool, error) { for _, c := range value { if c == 95 || unicode.IsDigit(c) { // 95 => _ continue diff --git a/internal/rule/snakecase_test.go b/internal/rule/snakecase_test.go index 636fcc23..6150053e 100644 --- a/internal/rule/snakecase_test.go +++ b/internal/rule/snakecase_test.go @@ -24,7 +24,7 @@ func TestSnakeCase(t *testing.T) { i := 0 for _, test := range tests { - res, err := rule.Validate(test.value, true) + res, err := rule.Validate(test.value, "", true) if !errors.Is(err, test.err) { t.Errorf("Test %d failed with unmatched error - %e", i, err) From 0c95ae3ac52b6fe4d3303ea8acf241ed744cb466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Wed, 26 Mar 2025 19:19:17 +0100 Subject: [PATCH 113/117] feat: regex substitutions --- internal/linter/linter.go | 4 ++-- internal/rule/regex.go | 15 ++++++++++++++- internal/rule/regex_test.go | 2 ++ internal/rule/rule.go | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/internal/linter/linter.go b/internal/linter/linter.go index 05c55308..b0d12fc0 100644 --- a/internal/linter/linter.go +++ b/internal/linter/linter.go @@ -94,7 +94,7 @@ func (linter *Linter) validateDir(index config.RuleIndex, path string, validate return nil } - valid, err := ruleDir.Validate(basename, "", ruleDir.GetName() != "exists") + valid, err := ruleDir.Validate(basename, pathDir, ruleDir.GetName() != "exists") if err != nil { return err } @@ -177,7 +177,7 @@ func (linter *Linter) validateFile(index config.RuleIndex, path string, validate return nil } - valid, err := ruleFile.Validate(withoutExt, "", ruleFile.GetName() != "exists") + valid, err := ruleFile.Validate(withoutExt, pathDir, ruleFile.GetName() != "exists") if err != nil { return err } diff --git a/internal/rule/regex.go b/internal/rule/regex.go index 1ab508c8..99571682 100644 --- a/internal/rule/regex.go +++ b/internal/rule/regex.go @@ -3,6 +3,7 @@ package rule import ( "fmt" "regexp" + "strings" "sync" ) @@ -72,7 +73,19 @@ func (rule *Regex) GetExclusive() bool { // Validate checks if full string matches regex func (rule *Regex) Validate(value string, path string, _ bool) (bool, error) { - match, err := regexp.MatchString("^"+rule.getRegexPattern()+"$", value) + regexPattern := rule.getRegexPattern() + if path != "" && strings.ContainsAny(regexPattern, "$") { + pathSplit := strings.Split(path, "/") + replaces := make([]string, len(pathSplit)*2) + for i := 0; i < len(pathSplit); i++ { + replaces[i*2] = fmt.Sprintf("${%d}", len(pathSplit)-1-i) + replaces[i*2+1] = pathSplit[i] + } + + regexPattern = strings.NewReplacer(replaces...).Replace(regexPattern) + } + + match, err := regexp.MatchString("^"+regexPattern+"$", value) return match != rule.negate, err } diff --git a/internal/rule/regex_test.go b/internal/rule/regex_test.go index f47a77c4..25459c67 100644 --- a/internal/rule/regex_test.go +++ b/internal/rule/regex_test.go @@ -19,6 +19,8 @@ func TestRegex(t *testing.T) { {params: []string{"[a-z]+"}, value: "123", path: "", expected: false, err: nil}, {params: []string{"[a-z\\-]+"}, value: "google-test", path: "", expected: true, err: nil}, {params: []string{"[a-z\\-]+"}, value: "google.test", path: "", expected: false, err: nil}, + {params: []string{"${1}_${0}"}, value: "google_test", path: "google/test", expected: true, err: nil}, + {params: []string{"${1}_${0}"}, value: "test", path: "google/test", expected: false, err: nil}, } i := 0 diff --git a/internal/rule/rule.go b/internal/rule/rule.go index 2bbeae2e..e857deeb 100644 --- a/internal/rule/rule.go +++ b/internal/rule/rule.go @@ -43,7 +43,7 @@ type Rule interface { // value: // - file: filename without extension // - dir: basename - // path: full path to file or dir + // path: full dir path - empty on root Validate(value string, path string, fail bool) (bool, error) GetErrorMessage() string Copy() Rule From 68c12dfc3f1a83d7e97918c7afca48ad297cdd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 27 Mar 2025 10:52:37 +0100 Subject: [PATCH 114/117] chore: bump readme --- README.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 88a973d5..0f29c223 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ An extremely fast directory and filename linter - Bring some structure to your p - Minimal setup with simple rules managed in one single or multiple `.ls-lint.yml` files - Works for directory and file names - all extensions supported - full unicode support - Incredibly fast - lints thousands of files and directories in milliseconds -- Support for Windows, MacOS and Linux + NPM Package + [GitHub Action](https://github.com/ls-lint/action) + [Homebrew](https://formulae.brew.sh/formula/ls-lint) + Docker +- Support for Windows, MacOS and Linux + [NPM Package](https://www.npmjs.com/package/@ls-lint/ls-lint) + [GitHub Action](https://github.com/ls-lint/action) + [Homebrew](https://formulae.brew.sh/formula/ls-lint) + Docker - Almost zero third-party dependencies (only [go-yaml](https://github.com/go-yaml/yaml) and [doublestar](https://github.com/bmatcuk/doublestar)) @@ -33,10 +33,18 @@ The full documentation can be found at [ls-lint.org](https://ls-lint.org) ```yaml ls: - .js: snake_case - .ts: snake_case | camelCase - .d.ts: PascalCase - .html: regex:[a-z0-9]+ + packages/*/{src,__tests__}: + .js: kebab-case + .ts: camelCase | PascalCase + .d.ts: camelCase + .spec.ts: camelCase | PascalCase + .mock.ts: camelCase + + components/*: + .ts: regex:${0} + tests: + .*: exists:0 + .test.ts: regex:${1} ignore: - node_modules @@ -50,10 +58,6 @@ ignore: [Join the ls-lint discord server](https://discord.gg/bsf9q7f2Rh) -## Sponsors - -jetbrains - ## Logo Logo created by [Studio Ajot](https://www.studio-ajot.de/) From dea50420565b3301dd886bc604a0a88144ea5b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 27 Mar 2025 10:53:32 +0100 Subject: [PATCH 115/117] chore: remove discord --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 0f29c223..f0da27f1 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,6 @@ ignore: command -## Discord - -[Join the ls-lint discord server](https://discord.gg/bsf9q7f2Rh) - ## Logo Logo created by [Studio Ajot](https://www.studio-ajot.de/) From 32e0fcdb2ba9fa1952706aba7c9ecb2fe82368f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 27 Mar 2025 11:00:57 +0100 Subject: [PATCH 116/117] chore: add renove etc --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f0da27f1..8cab9add 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ An extremely fast directory and filename linter - Bring some structure to your p - Works for directory and file names - all extensions supported - full unicode support - Incredibly fast - lints thousands of files and directories in milliseconds - Support for Windows, MacOS and Linux + [NPM Package](https://www.npmjs.com/package/@ls-lint/ls-lint) + [GitHub Action](https://github.com/ls-lint/action) + [Homebrew](https://formulae.brew.sh/formula/ls-lint) + Docker +- Trusted by [Renovate](https://github.com/renovatebot/renovate/blob/main/.ls-lint.yml), [Terser](https://github.com/terser/terser/blob/master/.ls-lint.yml) and many more - Almost zero third-party dependencies (only [go-yaml](https://github.com/go-yaml/yaml) and [doublestar](https://github.com/bmatcuk/doublestar)) From 85adf1d8b007412373e550380414520311432c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lo=CC=88ffel?= Date: Thu, 27 Mar 2025 12:16:28 +0100 Subject: [PATCH 117/117] chore: prepare release --- deployments/github/github.sh | 2 +- deployments/npm/BUILD.bazel | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/github/github.sh b/deployments/github/github.sh index 112bda2d..d2b0bfa4 100755 --- a/deployments/github/github.sh +++ b/deployments/github/github.sh @@ -4,4 +4,4 @@ set -euo pipefail gh=$1 github_files=$2 -$gh release create --generate-notes --prerelease ${STABLE_GIT_TAG} $github_files # --draft/--prerelease/--latest \ No newline at end of file +$gh release create --generate-notes ${STABLE_GIT_TAG} $github_files # --draft/--prerelease/--latest diff --git a/deployments/npm/BUILD.bazel b/deployments/npm/BUILD.bazel index 8bc306a4..27d33acd 100644 --- a/deployments/npm/BUILD.bazel +++ b/deployments/npm/BUILD.bazel @@ -43,7 +43,7 @@ npm_package( ":package_files_bin", ], args = [ - "--tag beta", + # "--tag beta", "--no-git-checks", ], hardlink = "off",