CodeQL: Python topics (2166) - WIP#2823
CodeQL: Python topics (2166) - WIP#2823felicitymay merged 14 commits intogithub:docs-preparationfrom
Conversation
|
A possible flaw with this approach to the introductions - the sidebar has both the new titles and the old titles for the child articles. This may simply be because I haven't updated the titles in the articles yet. I'll look into it on Friday. |
This is probably because the sidebar entries are autogenerated from the elements in |
|
Thanks for the tip Shati - much appreciated. I've tried the page as a bulleted list and it looks rather cramped to me: http://docteam.internal.semmle.com/felicity/2166-python-bullets/python/ql-for-python.html. |
Agreed, the bulleted list looks pretty cramped, but the second version looks great! 🎉 (Though all of this stuff will be autogenerated once we use the GitHub process, so I guess it doesn't matter too much?) |
That's a good point. I think this might be worth talking about. Since the migration isn't expected to start soon, it might be nice to make the pre-migration changes in such a way that we can merge the |
b0aeeb2 to
7f6e2a4
Compare
|
Following discussions with @shati-patel and @jf205 - I removed the duplicated introductions from the map topic and uncommented the |
7f6e2a4 to
8ab4ceb
Compare
|
As discussed, I've backed out the wider-reaching changes that I'd started in the Library introduction topic. I've updated the description to match the commits that are now in this PR and the preview is also updated. I'd be very grateful for a review. |
shati-patel
left a comment
There was a problem hiding this comment.
Thanks for doing this! These topics were definitely due for a tidy-up... I like how you've readjusted the heading levels and added consistent titles for examples 👍
I've made quite a few comments, but most of them are just a single comment that I've duplicated in a few places. Also, feel free to ignore any of my more general comments/questions!
| .. toctree:: | ||
| :glob: | ||
| :hidden: | ||
| :maxdepth: 2 |
There was a problem hiding this comment.
Setting maxdepth to 1 is probably closer to what GitHub map topics look like, but I don't think it really matters! (Admittedly the table of contents would look a bit sparse without the introductions.)
There was a problem hiding this comment.
I agree about the maxdepth but thought that, in the absence of introductions on this page, the top-level headings at least gave more information about what was in each topic.
Happy to change to 1 if that's preferred though.
| The simplest use of the ``ControlFlowNode`` and ``AstNode`` classes is to find unreachable code. There is one ``ControlFlowNode`` per path through any ``AstNode`` and any ``AstNode`` that is unreachable has no paths flowing through it. Therefore, any ``AstNode`` without a corresponding ``ControlFlowNode`` is unreachable. | ||
|
|
||
| **Unreachable AST nodes** | ||
| Example finding unreachable AST nodes |
There was a problem hiding this comment.
Note for future work: perhaps these two examples could be combined into a single procedural section.
Adding Example to the heading text (here and in other places below) doesn't feel quite right to me, but it's probably fine for this first round of changes (and I can't think of a better suggestion).
| =================== | ||
|
|
||
| This example uses the standard CodeQL class ``Function`` (see :doc:`Introducing the Python libraries <introduce-libraries-python>`). | ||
| Functions are key building blocks of Python code bases. You can find functions and identify calls to them using syntactic classes from the standard CodeQL library. |
There was a problem hiding this comment.
I see what you are trying to do here, but I'm not sure the opening sentence Functions are key building blocks of Python code bases. really belongs in an intro as it doesn't really users identify what's in this topic. The second sentence does though ✨
When we start more substantial content updates, I think Functions are key building blocks of Python code bases.... would fit nicely in an opening conceptual section, for example `About functions in Python.
There was a problem hiding this comment.
Hmm. I was trying to differentiate between the style of introductions for referential versus quickstart topics. It felt as if a referential topic ought to have more of a statement and less of a call to action.
However, looking at help.github.com, I can see that two of the three reference topics linked from the content models use "You can" to begin their introductions. https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions is the only exception. So probably this isn't necessary. I can see that you and Alistair have both used the "you can" approach.
There was a problem hiding this comment.
I've created a Google doc to summarize the questions arising from the pre-migration work we've done so far. I've included some examples and will add this too.
Many thanks for the review suggestions. Co-Authored-By: Shati Patel <42641846+shati-patel@users.noreply.github.com>
Based on suggestions from James and Shati
shati-patel
left a comment
There was a problem hiding this comment.
Thanks for the changes! A few more minor things, but this looks good to merge 👍
1ff1a7e to
7a2bb12
Compare
|
I've updated the introductions following Emily's feedback in https://docs.google.com/document/d/1x917mlEHcpUBQqyKrQ7aogw8dG3FseO32m1s62fuIJA/edit. I think that this is ready for a final review and merge. |
|
@shati-patel - do you have any more feedback before this is merged? |
| CodeQL library for Python | ||
| ========================= |
There was a problem hiding this comment.
This doesn't match the suggested title in Emily's spreadsheet, but it possibly makes more sense as we only discuss one library in this article. I think we'll need to update the equivalent JS topic, which still uses 'libraries' in the title.
There was a problem hiding this comment.
Hmm. This suggests lots of other changes to this topic for consistency.
There was a problem hiding this comment.
Stick with libraries. We'll update the other language topics accordingly.
There was a problem hiding this comment.
On balance, the more that I read this topic, the more convinced I am that it ought to be "library" - I think you're right that we should standardize on this, one way or the other. I'm going to leave this as-is for now pending that discussion.
There was a problem hiding this comment.
I think 'libraries' is consistent with what happens when you include import python in your query--although there is a single import statement, several .qll files (library files) are made available to use in the query. Not a big deal, but I agree we should merge now, standardize later.
There was a problem hiding this comment.
Sorry - spotted this after I merged it. It's more than just a title though - we are inconsistent within the documentation in how we refer to things. I think of a language library being made up of a series of library files, each of which defines a library module.
There was a problem hiding this comment.
It seems as if I'm probably in a minority.
|
@felicitymay: As with #2866, I think this is good to merge after you have looked at the most recent suggestions, pending approval from @shati-patel. Further changes can be made in a follow-up PR 👍 |
|
Thanks for all the review comments. I'm happy to make any further changes in a follow up PR. |
This PR contains changes that start the work of preparing the CodeQL for Python topics for future migration, as outlined in product-documentation issue 2166.
Notes
For most topics, this PR makes just the following changes:
introand a toc of the child articles. The other resources are moved into a reusable snippet for use in the "Further reading" section of all child topics.Questions
intro- review comments very welcome.