Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a9b612

Browse files
author
james
committed
improve docs
1 parent e5d2edd commit 4a9b612

5 files changed

Lines changed: 27 additions & 24 deletions

File tree

.github/workflows/generate-query-help-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generate CodeQL documentation using Sphinx
1+
name: Generate CodeQL query help documentation using Sphinx
22

33
on:
44
push:

docs/language/query-help-markdown.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,24 @@
55
import sys
66
import os
77

8+
"""
9+
This script collects CodeQL queries that are part of code scanning query packs,
10+
renders the accompanying query help as markdown, inserts some useful metadata
11+
into the help, and adds a link to the query in the CodeQL repo.
12+
13+
This script requires that 'git' and 'codeql' commands
14+
are on the PATH. It'll try to automatically set the CodeQL search path correctly,
15+
as long as you run the script from one of the following locations:
16+
- anywhere from within a clone of the CodeQL Git repo
17+
- from the parent directory of a clone of the CodeQL Git repo (assuming 'codeql'
18+
and 'codeql-go' directories both exist)
19+
"""
20+
821
# Define which languages and query packs to consider
922
languages = [ "cpp", "csharp", "go", "java", "javascript", "python"]
1023

11-
# Running generate query-help with "security-and-quality.qls" generates errors, so just use these two suites for now
12-
packs = ["code-scanning", "security-extended"]
24+
# generate query-help fails for some queries in these suites. Faliures generate an error message.
25+
packs = ["code-scanning", "security-and-quality", "security-extended"]
1326

1427

1528
def prefix_repo_nwo(filename):

docs/language/query-help/conf.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Learn CodeQL documentation build configuration file, created by
4-
# on Tuesday Nov 13 2018.
3+
# CodeQL query help configuration file
54
#
65
# This file is execfile()d with the current directory set to its
76
# containing dir.
@@ -15,16 +14,6 @@
1514
# For details of all possible config values,
1615
# see https://www.sphinx-doc.org/en/master/usage/configuration.html
1716

18-
#################################################################################
19-
#
20-
# Modified 22052019.
21-
22-
# The configuration values below are specific to the learning ql project
23-
# To amend html_theme_options, update version/release number, or add more sphinx extensions,
24-
# refer to code/documentation/ql-documentation/global-sphinx-files/global-conf.py
25-
#
26-
##################################################################################
27-
2817
# -- Project-specific configuration -----------------------------------
2918

3019
import os
@@ -44,7 +33,6 @@
4433
project = u'CodeQL query help'
4534

4635
# Add md parser to process query help markdown files
47-
4836
extensions =['recommonmark']
4937

5038
source_suffix = {
@@ -82,4 +70,5 @@
8270

8371
# List of patterns, relative to source directory, that match files and
8472
# directories to ignore when looking for source files.
85-
exclude_patterns = ['toc-*']
73+
74+
exclude_patterns = ['toc-*'] # ignore toc-<lang>.rst files as they are 'included' in index pages

docs/language/query-help/query-list.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CodeQL query help Sphinx documentation
2+
--------------------------------------
3+
4+
This project supplies the configuration and some boiler plate
5+
index files for the CodeQL query help documentation.
6+
7+
The query help itself is automatically generated by the
8+
"Generate CodeQL query help documentation using Sphinx" workflow.

0 commit comments

Comments
 (0)