Skip to content

Commit

Permalink
Use grafana/regexp instead of regexp package (#1745)
Browse files Browse the repository at this point in the history
* Use grafana/regexp instead of regexp package

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Use grafana/regexp in tools/ too

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Add grafana/regexp to tools/doc-validator/

Signed-off-by: Marco Pracucci <marco@pracucci.com>
  • Loading branch information
pracucci committed Apr 22, 2022
1 parent 6f5563f commit b7cc6ad
Show file tree
Hide file tree
Showing 23 changed files with 2,777 additions and 15 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -238,6 +238,7 @@ lint: check-makefiles
GOFLAGS="-tags=requires_docker" faillint -paths "github.com/bmizerany/assert=github.com/stretchr/testify/assert,\
golang.org/x/net/context=context,\
sync/atomic=go.uber.org/atomic,\
regexp=github.com/grafana/regexp,\
github.com/go-kit/kit/log/...=github.com/go-kit/log,\
github.com/prometheus/client_golang/prometheus.{MultiError}=github.com/prometheus/prometheus/tsdb/errors.{NewMulti},\
github.com/weaveworks/common/user.{ExtractOrgID}=github.com/grafana/mimir/pkg/tenant.{TenantID,TenantIDs},\
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/multitenant_test.go
Expand Up @@ -18,7 +18,6 @@ import (
"net/http/pprof"
"os"
"path/filepath"
"regexp"
"strings"
"sync"
"testing"
Expand All @@ -31,6 +30,7 @@ import (
"github.com/grafana/dskit/ring"
"github.com/grafana/dskit/services"
"github.com/grafana/dskit/test"
"github.com/grafana/regexp"
"github.com/prometheus/alertmanager/cluster/clusterpb"
"github.com/prometheus/alertmanager/notify"
"github.com/prometheus/alertmanager/pkg/labels"
Expand Down
2 changes: 1 addition & 1 deletion pkg/compactor/compactor_test.go
Expand Up @@ -16,7 +16,6 @@ import (
"os"
"path"
"path/filepath"
"regexp"
"strconv"
"strings"
"testing"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/grafana/dskit/ring"
"github.com/grafana/dskit/services"
"github.com/grafana/dskit/test"
"github.com/grafana/regexp"
"github.com/oklog/ulid"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion pkg/frontend/querymiddleware/querysharding_test.go
Expand Up @@ -11,7 +11,6 @@ import (
"fmt"
"math"
"net/http"
"regexp"
"runtime"
"sort"
"strconv"
Expand All @@ -21,6 +20,7 @@ import (
"time"

"github.com/go-kit/log"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/testutil"
Expand Down
5 changes: 2 additions & 3 deletions pkg/mimirtool/analyze/grafana.go
Expand Up @@ -8,15 +8,14 @@ package analyze
import (
"encoding/json"
"fmt"
"regexp"
"sort"
"strings"

log "github.com/sirupsen/logrus"

"github.com/grafana-tools/sdk"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/prometheus/promql/parser"
log "github.com/sirupsen/logrus"
)

type MetricsInGrafana struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/tsdb/bucketcache/caching_bucket_test.go
Expand Up @@ -12,14 +12,14 @@ import (
"fmt"
"io"
"io/ioutil"
"regexp"
"sort"
"strings"
"testing"
"time"

"github.com/go-kit/log"
"github.com/grafana/dskit/runutil"
"github.com/grafana/regexp"
"github.com/pkg/errors"
promtest "github.com/prometheus/client_golang/prometheus/testutil"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/tsdb/caching_config.go
Expand Up @@ -9,12 +9,12 @@ import (
"flag"
"fmt"
"path/filepath"
"regexp"
"strings"
"time"

"github.com/go-kit/log"
"github.com/golang/snappy"
"github.com/grafana/regexp"
"github.com/oklog/ulid"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion pkg/storegateway/bucket_test.go
Expand Up @@ -19,7 +19,6 @@ import (
"os"
"path"
"path/filepath"
"regexp"
"runtime"
"sort"
"strconv"
Expand All @@ -30,6 +29,7 @@ import (
"github.com/go-kit/log"
"github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/types"
"github.com/grafana/regexp"
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
Expand Down
3 changes: 2 additions & 1 deletion tools/add-license/main.go
Expand Up @@ -10,8 +10,9 @@ import (
"log"
"os"
"path/filepath"
"regexp"
"strings"

"github.com/grafana/regexp"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion tools/doc-generator/parse/parser.go
Expand Up @@ -10,13 +10,13 @@ import (
"fmt"
"net/url"
"reflect"
"regexp"
"strings"
"time"
"unicode"

"github.com/go-kit/log"
"github.com/grafana/dskit/flagext"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/relabel"
Expand Down
2 changes: 1 addition & 1 deletion tools/doc-generator/writer.go
Expand Up @@ -7,11 +7,11 @@ package main

import (
"fmt"
"regexp"
"sort"
"strconv"
"strings"

"github.com/grafana/regexp"
"github.com/mitchellh/go-wordwrap"
"gopkg.in/yaml.v3"

Expand Down
1 change: 1 addition & 0 deletions tools/doc-validator/go.mod
Expand Up @@ -4,6 +4,7 @@ go 1.17

require (
github.com/gomarkdown/markdown v0.0.0-20220310201231-552c6011c0b8
github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.1
)
Expand Down
2 changes: 2 additions & 0 deletions tools/doc-validator/go.sum
Expand Up @@ -3,6 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gomarkdown/markdown v0.0.0-20220310201231-552c6011c0b8 h1:YVvt637ygnOO9qjLBVmPOvrUmCz/i8YECSu/8UlOQW0=
github.com/gomarkdown/markdown v0.0.0-20220310201231-552c6011c0b8/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2 h1:uirlL/j72L93RhV4+mkWhjv0cov2I0MIgPOG9rMDr1k=
github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
2 changes: 1 addition & 1 deletion tools/doc-validator/main.go
Expand Up @@ -9,11 +9,11 @@ import (
"net/url"
"os"
"path/filepath"
"regexp"
"strings"

"github.com/gomarkdown/markdown/ast"
"github.com/gomarkdown/markdown/parser"
"github.com/grafana/regexp"
"github.com/pkg/errors"
)

Expand Down
15 changes: 15 additions & 0 deletions tools/doc-validator/vendor/github.com/grafana/regexp/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions tools/doc-validator/vendor/github.com/grafana/regexp/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions tools/doc-validator/vendor/github.com/grafana/regexp/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b7cc6ad

Please sign in to comment.