We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please support to check if functions are called from the other. Let me show an example. Let me show an example.
This is the code I need to check. I need to check if I use an argument in concurrent mode.
let use_thing thing = let%bind () = fn1 thing and _ = fn2 thing in return () let other_fn () = get_thing use_thing
And it works when this function is inside the function where get_thing is called.
get_thing
rules: - id: concurrent-use patterns: - pattern-inside: pattern-either: - pattern: get_thing (fun $THING -> ...) - pattern: get_thing @@ fun $THING -> ... - pattern: let $FN_NAME $THING = ... in get_thing $FN_NAME - pattern-either: - pattern: let $X = ... $THING ... and $Y = ... $THING ... in ... - pattern: let () = ... $THING ... and () = ... $THING ... in ... - pattern: let $X = ... $THING ... and () = ... $THING ... in ... - pattern: let () = ... $THING ... and $Y = ... $THING ... in ... languages: - ocaml severity: ERROR
And this could be rewritten with the following pattern (at least the same idea works for typescript and python)
rules: - id: concurrent-use patterns: - pattern: let $F $THING = ... ... get_thing $F - pattern-either: - pattern: let $X = ... $THING ... and $Y = ... $THING ... in ... - pattern: let () = ... $THING ... and () = ... $THING ... in ... - pattern: let $X = ... $THING ... and () = ... $THING ... in ... - pattern: let () = ... $THING ... and $Y = ... $THING ... in ... message: Semgrep found a match languages: - ocaml severity: ERROR
But nothing is caught.
I tried this version (which is worked for typescript too):
- pattern: let $F $THING = ... ... let $ANOTHER_FN ... = get_thing $F
But I caught: Invalid pattern for OCaml:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Please support to check if functions are called from the other. Let me show an example. Let me show an example.
This is the code I need to check. I need to check if I use an argument in concurrent mode.
And it works when this function is inside the function where
get_thing
is called.And this could be rewritten with the following pattern (at least the same idea works for typescript and python)
But nothing is caught.
I tried this version (which is worked for typescript too):
But I caught: Invalid pattern for OCaml:
The text was updated successfully, but these errors were encountered: