Skip to content

Commit

Permalink
removed checker for url
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidanio committed Aug 5, 2024
1 parent 4c15f34 commit 02246d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.4.0 h1:uCmaf4vVbWAOZz36k1hrQD7ijGRzLwaME8Am/7a4jZI=
github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE=
github.com/quasilyte/regex/syntax v0.0.0-20200419152657-af9db7f4a3ab h1:rjBjlam2Bbr6Dwp0T8HY2paibXTjMsNQU7vUH8hB+C4=
github.com/quasilyte/regex/syntax v0.0.0-20200419152657-af9db7f4a3ab/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0=
github.com/yookoala/realpath v1.0.0 h1:7OA9pj4FZd+oZDsyvXWQvjn5oBdcHRTV44PpdMSuImQ=
github.com/yookoala/realpath v1.0.0/go.mod h1:gJJMA9wuX7AcqLy1+ffPatSCySA1FQ2S8Ya9AIoYBpE=
go.lsp.dev/uri v0.3.0 h1:KcZJmh6nFIBeJzTugn5JTU6OOyG0lDOo3R9KwTxTYbo=
go.lsp.dev/uri v0.3.0/go.mod h1:P5sbO1IQR+qySTWOCnhnK7phBx+W3zbLqSMDJNTw88I=
Expand Down
1 change: 0 additions & 1 deletion src/linter/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import (
// 52 - renamed all PhpDoc and Phpdoc with PHPDoc
// 53 - added DeprecationInfo for functions and methods and support for some attributes
// 54 - forced cache version invalidation due to the #1165
// 55 - added @link tag -> new field in Rule
const cacheVersion = 54

var (
Expand Down
11 changes: 1 addition & 10 deletions src/rules/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,7 @@ func (p *parser) parseRuleInfo(st ir.Node, labelStmt ir.Node, proto *Rule) (Rule
if len(part.Params) != 1 {
return rule, p.errorf(st, "@link expects exactly 1 param, got %d", len(part.Params))
}
var link = part.Params[0]
if !isURL(link) {
return rule, p.errorf(st, "@link argument is not link")
}
rule.Link = link
rule.Link = part.Params[0]

case "location":
if len(part.Params) != 1 {
Expand Down Expand Up @@ -348,11 +344,6 @@ func (p *parser) parseRuleInfo(st ir.Node, labelStmt ir.Node, proto *Rule) (Rule
return rule, nil
}

func isURL(str string) bool {
re := regexp.MustCompile(`^((https?|ftp)://)?[^\s/$.?#].\S*$`)
return re.MatchString(str)
}

func (p *parser) parseRules(stmts []ir.Node, proto *Rule) error {
for len(stmts) > 0 {
stmt := stmts[0]
Expand Down

0 comments on commit 02246d7

Please sign in to comment.