Browse Source

Switch to grafana/regexp everywhere (#10268)

Let's have a consistent library for regexp.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
pull/10296/head
Julien Pivotto 3 years ago committed by GitHub
parent
commit
9a2e93228e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .golangci.yml
  2. 2
      cmd/prometheus/main.go
  3. 2
      config/config.go
  4. 2
      config/config_test.go
  5. 2
      discovery/file/file.go
  6. 2
      discovery/http/http.go
  7. 2
      discovery/puppetdb/puppetdb.go
  8. 2
      model/relabel/relabel.go
  9. 2
      promql/engine.go
  10. 2
      promql/functions.go
  11. 2
      promql/query_logger_test.go
  12. 2
      promql/test.go
  13. 2
      template/template.go
  14. 3
      util/httputil/cors.go
  15. 2
      util/httputil/cors_test.go
  16. 2
      util/logging/file_test.go
  17. 2
      util/stats/stats_test.go
  18. 3
      util/strutil/strconv.go
  19. 2
      web/api/v1/api.go
  20. 2
      web/web.go

4
.golangci.yml

@ -24,13 +24,11 @@ linters-settings:
depguard:
list-type: blacklist
include-go-root: true
packages:
- sync/atomic
- github.com/stretchr/testify/assert
packages-with-error-message:
- sync/atomic: "Use go.uber.org/atomic instead of sync/atomic"
- github.com/stretchr/testify/assert: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
- github.com/go-kit/kit/log: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
- regexp: "Use github.com/grafana/regexp instead of regexp"
errcheck:
exclude: scripts/errcheck_excludes.txt
goimports:

2
cmd/prometheus/main.go

@ -26,7 +26,6 @@ import (
"os"
"os/signal"
"path/filepath"
"regexp"
"runtime"
"strings"
"sync"
@ -36,6 +35,7 @@ import (
"github.com/alecthomas/units"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/regexp"
conntrack "github.com/mwitkow/go-conntrack"
"github.com/oklog/run"
"github.com/pkg/errors"

2
config/config.go

@ -19,13 +19,13 @@ import (
"net/url"
"os"
"path/filepath"
"regexp"
"strings"
"time"
"github.com/alecthomas/units"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/common/config"
"github.com/prometheus/common/model"

2
config/config_test.go

@ -19,12 +19,12 @@ import (
"net/url"
"os"
"path/filepath"
"regexp"
"testing"
"time"
"github.com/alecthomas/units"
"github.com/go-kit/log"
"github.com/grafana/regexp"
"github.com/prometheus/common/config"
"github.com/prometheus/common/model"
"github.com/stretchr/testify/require"

2
discovery/file/file.go

@ -20,7 +20,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
"sync"
"time"
@ -28,6 +27,7 @@ import (
"github.com/fsnotify/fsnotify"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/config"

2
discovery/http/http.go

@ -21,12 +21,12 @@ import (
"io/ioutil"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"time"
"github.com/go-kit/log"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/common/config"
"github.com/prometheus/common/model"

2
discovery/puppetdb/puppetdb.go

@ -24,12 +24,12 @@ import (
"net/http"
"net/url"
"path"
"regexp"
"strconv"
"strings"
"time"
"github.com/go-kit/log"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/common/config"
"github.com/prometheus/common/model"

2
model/relabel/relabel.go

@ -16,9 +16,9 @@ package relabel
import (
"crypto/md5"
"fmt"
"regexp"
"strings"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/common/model"

2
promql/engine.go

@ -20,7 +20,6 @@ import (
"fmt"
"math"
"reflect"
"regexp"
"runtime"
"sort"
"strconv"
@ -29,6 +28,7 @@ import (
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"

2
promql/functions.go

@ -15,12 +15,12 @@ package promql
import (
"math"
"regexp"
"sort"
"strconv"
"strings"
"time"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/common/model"

2
promql/query_logger_test.go

@ -17,9 +17,9 @@ import (
"context"
"io/ioutil"
"os"
"regexp"
"testing"
"github.com/grafana/regexp"
"github.com/stretchr/testify/require"
)

2
promql/test.go

@ -18,11 +18,11 @@ import (
"fmt"
"io/ioutil"
"math"
"regexp"
"strconv"
"strings"
"time"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/common/model"
"github.com/stretchr/testify/require"

2
template/template.go

@ -21,13 +21,13 @@ import (
"math"
"net"
"net/url"
"regexp"
"sort"
"strconv"
"strings"
text_template "text/template"
"time"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"

3
util/httputil/cors.go

@ -15,7 +15,8 @@ package httputil
import (
"net/http"
"regexp"
"github.com/grafana/regexp"
)
var corsHeaders = map[string]string{

2
util/httputil/cors_test.go

@ -15,9 +15,9 @@ package httputil
import (
"net/http"
"regexp"
"testing"
"github.com/grafana/regexp"
"github.com/stretchr/testify/require"
)

2
util/logging/file_test.go

@ -16,10 +16,10 @@ package logging
import (
"io/ioutil"
"os"
"regexp"
"strings"
"testing"
"github.com/grafana/regexp"
"github.com/stretchr/testify/require"
)

2
util/stats/stats_test.go

@ -15,10 +15,10 @@ package stats
import (
"encoding/json"
"regexp"
"testing"
"time"
"github.com/grafana/regexp"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/require"

3
util/strutil/strconv.go

@ -16,7 +16,8 @@ package strutil
import (
"fmt"
"net/url"
"regexp"
"github.com/grafana/regexp"
)
var invalidLabelCharRE = regexp.MustCompile(`[^a-zA-Z0-9_]`)

2
web/api/v1/api.go

@ -23,7 +23,6 @@ import (
"net/url"
"os"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
@ -32,6 +31,7 @@ import (
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/regexp"
jsoniter "github.com/json-iterator/go"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"

2
web/web.go

@ -29,7 +29,6 @@ import (
"os"
"path"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
@ -39,6 +38,7 @@ import (
"github.com/alecthomas/units"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/regexp"
conntrack "github.com/mwitkow/go-conntrack"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"

Loading…
Cancel
Save