-
Notifications
You must be signed in to change notification settings - Fork 126
More cleanup #153
More cleanup #153
Conversation
sauyon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments and a question.
ql/src/go.qll
Outdated
| import semmle.go.frameworks.NoSQL | ||
| import semmle.go.frameworks.SystemCommandExecutors | ||
| import semmle.go.frameworks.SQL | ||
| import semmle.go.frameworks.XPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we realphabetize this in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good plan.
| } | ||
|
|
||
| func (_ *Context) IsWebsocket() bool { | ||
| func (_ *Context) IsWebSocket() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| func (_ *Context) IsWebSocket() bool { | |
| func (_ *Context) IsWebsocket() bool { |
I assume this change was unintended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, yes; let me revert those changes.
| type Socket struct { | ||
| Conn interface{} | ||
| WebsocketDialer interface{} | ||
| WebSocketDialer interface{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| WebSocketDialer interface{} | |
| WebsocketDialer interface{} |
ditto
| type Socket struct { | ||
| Conn interface{} | ||
| WebsocketDialer interface{} | ||
| WebSocketDialer interface{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| WebSocketDialer interface{} | |
| WebsocketDialer interface{} |
| * refer to `"github.com/go-pg/pg/types"`, but also to `"github.com/go-pg/pg/v10/types"`. | ||
| */ | ||
| bindingset[result, mod, path] | ||
| string package(string mod, string path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A thought for the future: should we add a version parameter to match the version as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do, in the future.
The predicate now works with an empty package path. The way this is implemented is perhaps slightly non-obvious: the `($|/)\\Q" + path + "\\E"` part of the regular expression either matches the end of the string (and `path` must then be empty), or a slash followed by `path` (which may or may not be empty). We do allow non-canonical import paths ending in `/`, which the compiler rejects. We could disallow that by putting a `(?!$)` assertion after the `/`, but that seems overkill.
|
Thanks, @sauyon, comments addressed. |
|
Added one more (unrelated) fix. |
Mostly related to the WebSocket model introduced in #107 and refined in #109.
Renaming the QLL file from
Websocket.qlltoWebSocket.qllis technically a breaking change, but we only just introduced it, so I think it's fine. (And also one wouldn't normally import that module directly anyway.)