Skip to content

Commit

Permalink
fix: fixing linter in dsl and client packages
Browse files Browse the repository at this point in the history
  • Loading branch information
antklim committed Jul 30, 2021
1 parent 1ccc97e commit 6bc61f4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/service_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ type processMap struct {
func (pm *processMap) Get(k int) *exec.Cmd {
pm.RLock()
defer pm.RUnlock()
v, _ := pm.processes[k]
v := pm.processes[k]
return v
}

Expand Down
4 changes: 2 additions & 2 deletions dsl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,13 @@ var waitForPort = func(port int, network string, address string, timeoutDuration
func sanitiseRubyResponse(response string) string {
log.Println("[TRACE] response from Ruby process pre-sanitisation:", response)

r := regexp.MustCompile("(?m)^\\s*#.*$")
r := regexp.MustCompile(`(?m)^\s*#.*$`)
s := r.ReplaceAllString(response, "")

r = regexp.MustCompile("(?m).*bundle exec rake pact:verify.*$")
s = r.ReplaceAllString(s, "")

r = regexp.MustCompile("\\n+")
r = regexp.MustCompile(`\n+`)
s = r.ReplaceAllString(s, "\n")

return s
Expand Down
1 change: 0 additions & 1 deletion dsl/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
const (
hexadecimal = `[0-9a-fA-F]+`
ipAddress = `(\d{1,3}\.)+\d{1,3}`
ipv6Address = `(\A([0-9a-f]{1,4}:){1,1}(:[0-9a-f]{1,4}){1,6}\Z)|(\A([0-9a-f]{1,4}:){1,2}(:[0-9a-f]{1,4}){1,5}\Z)|(\A([0-9a-f]{1,4}:){1,3}(:[0-9a-f]{1,4}){1,4}\Z)|(\A([0-9a-f]{1,4}:){1,4}(:[0-9a-f]{1,4}){1,3}\Z)|(\A([0-9a-f]{1,4}:){1,5}(:[0-9a-f]{1,4}){1,2}\Z)|(\A([0-9a-f]{1,4}:){1,6}(:[0-9a-f]{1,4}){1,1}\Z)|(\A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-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`
timestamp = `^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$`
date = `^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))?)`
Expand Down
4 changes: 2 additions & 2 deletions dsl/pact.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ func (p *Pact) Setup(startMockServer bool) *Pact {
}

if p.LogDir == "" {
p.LogDir = fmt.Sprintf(filepath.Join(dir, "logs"))
p.LogDir = filepath.Join(dir, "logs")
}

if p.PactDir == "" {
p.PactDir = fmt.Sprintf(filepath.Join(dir, "pacts"))
p.PactDir = filepath.Join(dir, "pacts")
}

if p.SpecificationVersion == 0 {
Expand Down

0 comments on commit 6bc61f4

Please sign in to comment.