From e11e6159003f912df00f289561f7d570e0160abe Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Fri, 4 Oct 2024 16:02:56 +0200 Subject: [PATCH] Adjust lint config to tolerate malordered imports in antlr generated files. --- antlr/sequence/BUILD.bazel | 3 ++- antlr/sequence/sequence_lexer.go | 3 +-- antlr/traffic_class/BUILD.bazel | 16 ++++++++++++++++ antlr/traffic_class/trafficclass_lexer.go | 3 +-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/antlr/sequence/BUILD.bazel b/antlr/sequence/BUILD.bazel index 9b491b840f..b168bee93f 100644 --- a/antlr/sequence/BUILD.bazel +++ b/antlr/sequence/BUILD.bazel @@ -5,7 +5,8 @@ load("@apple_rules_lint//lint:defs.bzl", "package_lint_config") go_lint_config( name = "go_lint_config", exclude_filter = [ - "sequence_parser.go", + "_parser.go", + "_lexer.go", ], visibility = [ "//visibility:public", diff --git a/antlr/sequence/sequence_lexer.go b/antlr/sequence/sequence_lexer.go index 7e0166610d..d297d01205 100644 --- a/antlr/sequence/sequence_lexer.go +++ b/antlr/sequence/sequence_lexer.go @@ -4,10 +4,9 @@ package sequence import ( "fmt" + "github.com/antlr4-go/antlr/v4" "sync" "unicode" - - "github.com/antlr4-go/antlr/v4" ) // Suppress unused import error diff --git a/antlr/traffic_class/BUILD.bazel b/antlr/traffic_class/BUILD.bazel index 45254d9c43..6071e1f8bd 100644 --- a/antlr/traffic_class/BUILD.bazel +++ b/antlr/traffic_class/BUILD.bazel @@ -1,4 +1,20 @@ load("//tools/lint:go.bzl", "go_library") +load("//tools/lint:go_config.bzl", "go_lint_config") +load("@apple_rules_lint//lint:defs.bzl", "package_lint_config") + +go_lint_config( + name = "go_lint_config", + exclude_filter = [ + "_lexer.go", + ], + visibility = [ + "//visibility:public", + ], +) + +package_lint_config({ + "go": ":go_lint_config", +}) go_library( name = "go_default_library", diff --git a/antlr/traffic_class/trafficclass_lexer.go b/antlr/traffic_class/trafficclass_lexer.go index a031ba41f6..50ae746279 100644 --- a/antlr/traffic_class/trafficclass_lexer.go +++ b/antlr/traffic_class/trafficclass_lexer.go @@ -4,10 +4,9 @@ package traffic_class import ( "fmt" + "github.com/antlr4-go/antlr/v4" "sync" "unicode" - - "github.com/antlr4-go/antlr/v4" ) // Suppress unused import error