-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Python: document api graphs #5425
New issue
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
Python: document api graphs #5425
Conversation
…n/codeql into tausbn-python-document-api-graphs
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.
LGTM 👍
Hello @github/docs-content-codeql - this PR is ready for docs review. |
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.
Thanks for writing this! I've left some minor editorial suggestions, but this looks like a useful addition to the docs overall 😊
docs/codeql/codeql-language-guides/analyzing-data-flow-in-python.rst
Outdated
Show resolved
Hide resolved
docs/codeql/codeql-language-guides/codeql-library-for-python.rst
Outdated
Show resolved
Hide resolved
docs/codeql/codeql-language-guides/using-api-graphs-in-python.rst
Outdated
Show resolved
Hide resolved
docs/codeql/codeql-language-guides/using-api-graphs-in-python.rst
Outdated
Show resolved
Hide resolved
|
||
select API::moduleImport("re") | ||
|
||
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1876172022264324639/>`__. |
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.
I see that this example has no results. Is it worth finding projects with a result? (Perhaps not necessary, since the next example shows results!)
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.
I think perhaps the API node corresponding to the imported module does not have a location and therefor does not show up as a result. While moduleImport
is not meant to be used on its own, I wonder if this behaviour should be considered a bug, since we might be tempted to detect if certain libraries are imported just by seeing if moduleImport
gives results..
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.
Issue created.
docs/codeql/codeql-language-guides/using-api-graphs-in-python.rst
Outdated
Show resolved
Hide resolved
docs/codeql/codeql-language-guides/using-api-graphs-in-python.rst
Outdated
Show resolved
Hide resolved
|
||
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/288293322319747121/>`__. | ||
|
||
Note the use of the set literal ``["View", "MethodView"]`` to match both classes simultaneously. |
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.
Yay, this might be the first set literal example I've seen "in the wild" in the docs! 😉 (Apart from the reference)
docs/codeql/codeql-language-guides/using-api-graphs-in-python.rst
Outdated
Show resolved
Hide resolved
docs/codeql/codeql-language-guides/using-api-graphs-in-python.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
Issue for the non-result here. |
Adjustment of #5389