Skip to content

Commit

Permalink
perf: use jdkato/regexp
Browse files Browse the repository at this point in the history
This makes a big difference!
  • Loading branch information
jdkato committed Nov 14, 2020
1 parent ba54de4 commit 2936d7a
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
3 changes: 1 addition & 2 deletions check/occurrence.go
@@ -1,10 +1,9 @@
package check

import (
"regexp"

"github.com/errata-ai/vale/v2/config"
"github.com/errata-ai/vale/v2/core"
"github.com/jdkato/regexp"
"github.com/mitchellh/mapstructure"
)

Expand Down
2 changes: 1 addition & 1 deletion core/core.go
Expand Up @@ -5,7 +5,6 @@ import (
"bytes"
"io/ioutil"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
Expand All @@ -15,6 +14,7 @@ import (
"github.com/gobwas/glob"
"github.com/jdkato/prose/tag"
"github.com/jdkato/prose/tokenize"
"github.com/jdkato/regexp"
)

// AlertLevels holds the possible values for "level" in an external rule.
Expand Down
3 changes: 2 additions & 1 deletion core/format.go
Expand Up @@ -2,8 +2,9 @@ package core

import (
"path/filepath"
"regexp"
"strings"

"github.com/jdkato/regexp"
)

// CommentsByNormedExt determines what parts of a file we should lint -- e.g.,
Expand Down
3 changes: 2 additions & 1 deletion core/location.go
@@ -1,9 +1,10 @@
package core

import (
"regexp"
"strings"
"unicode/utf8"

"github.com/jdkato/regexp"
)

// initialPosition calculates the position of a match (given by the location in
Expand Down
3 changes: 2 additions & 1 deletion spell/aff.go
Expand Up @@ -4,9 +4,10 @@ import (
"bufio"
"fmt"
"io"
"regexp"
"strconv"
"strings"

"github.com/jdkato/regexp"
)

// AffixType is either an affix prefix or suffix
Expand Down
3 changes: 2 additions & 1 deletion spell/gospell.go
Expand Up @@ -6,8 +6,9 @@ import (
"io"
"log"
"os"
"regexp"
"strings"

"github.com/jdkato/regexp"
)

// GoSpell is main struct
Expand Down
3 changes: 2 additions & 1 deletion spell/words.go
@@ -1,9 +1,10 @@
package spell

import (
"regexp"
"strings"
"unicode"

"github.com/jdkato/regexp"
)

// number form, may include dots, commas and dashes
Expand Down
2 changes: 1 addition & 1 deletion styles/plugins/Sequence.go
Expand Up @@ -5,10 +5,10 @@
package main

import (
"regexp"
"strings"

"github.com/errata-ai/vale/v2/core"
"github.com/jdkato/regexp"
)

var pat = regexp.MustCompile(`dialog \w+`)
Expand Down
2 changes: 1 addition & 1 deletion ui/error.go
Expand Up @@ -6,11 +6,11 @@ import (
"io"
"log"
"os"
"regexp"
"strconv"
"strings"

"github.com/errata-ai/vale/v2/core"
"github.com/jdkato/regexp"
"github.com/mattn/go-colorable"
)

Expand Down

0 comments on commit 2936d7a

Please sign in to comment.