Skip to content

Commit 124eccb

Browse files
Add links from relevant parts of README.md, logo to index.html
1 parent 98dd201 commit 124eccb

3 files changed

Lines changed: 42 additions & 34 deletions

File tree

README.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ are language specific and should typically be accessed by `import qtil.lang`, e.
6565

6666
## Supported Languages
6767

68-
- C/C++: ✅ available as `import qtil.Cpp` in pack `advanced-security/qtil-cpp`
69-
- C#: ✅ available as `import qtil.CSharp` in pack `advanced-security/qtil-csharp`
70-
- Go: ✅ available as `import qtil.Go` in pack `advanced-security/qtil-go`
71-
- Java: ✅ available as `import qtil.Java` in pack `advanced-security/qtil-java`
72-
- JavaScript: ✅ available as `import qtil.Javascript` in pack `advanced-security/qtil-javascript`
73-
- Python: ✅ available as `import qtil.Python` in pack `advanced-security/qtil-python`
74-
- Ruby: ✅ available as `import qtil.Ruby` in pack `advanced-security/qtil-ruby`
68+
- C/C++: ✅ available as `import qtil.Cpp` in pack `advanced-security/qtil-cpp` — [docs](https://advanced-security.github.io/codeql-qtil/qtil/Cpp.qll/module.Cpp.html)
69+
- C#: ✅ available as `import qtil.CSharp` in pack `advanced-security/qtil-csharp` — [docs](https://advanced-security.github.io/codeql-qtil/qtil/Csharp.qll/module.Csharp.html)
70+
- Go: ✅ available as `import qtil.Go` in pack `advanced-security/qtil-go` — [docs](https://advanced-security.github.io/codeql-qtil/qtil/Go.qll/module.Go.html)
71+
- Java: ✅ available as `import qtil.Java` in pack `advanced-security/qtil-java` — [docs](https://advanced-security.github.io/codeql-qtil/qtil/Java.qll/module.Java.html)
72+
- JavaScript: ✅ available as `import qtil.Javascript` in pack `advanced-security/qtil-javascript` — [docs](https://advanced-security.github.io/codeql-qtil/qtil/Javascript.qll/module.Javascript.html)
73+
- Python: ✅ available as `import qtil.Python` in pack `advanced-security/qtil-python` — [docs](https://advanced-security.github.io/codeql-qtil/qtil/Python.qll/module.Python.html)
74+
- Ruby: ✅ available as `import qtil.Ruby` in pack `advanced-security/qtil-ruby` — [docs](https://advanced-security.github.io/codeql-qtil/qtil/Ruby.qll/module.Ruby.html)
7575
- Rust: ❌ not yet available
76-
- Swift: ✅ available as `import qtil.Swift` in pack `advanced-security/qtil-swift`
76+
- Swift: ✅ available as `import qtil.Swift` in pack `advanced-security/qtil-swift` — [docs](https://advanced-security.github.io/codeql-qtil/qtil/Swift.qll/module.Swift.html)
7777
- QL: ❌ not yet available
7878
- other languages: ❌ not supported by CodeQL.
7979

8080
## Features
8181

8282
### Pairs, Tuples, and Products, oh my!
8383

84-
**Pair**: A class to hold some set of paired values of two distinct types.
84+
[**Pair**](https://advanced-security.github.io/codeql-qtil/qtil/tuple/Pair.qll/module.Pair.html): A class to hold some set of paired values of two distinct types.
8585

8686
```ql
8787
predicate nameAge(string name, int age) {
@@ -93,7 +93,7 @@ from Qtil::Pair<string, int, nameAge/2>::Pair pair
9393
select pair.getFirst(), pair.getSecond()
9494
```
9595

96-
**Tuple**: Like a pair, but supports more than two columns.
96+
[**Tuple**](https://advanced-security.github.io/codeql-qtil/qtil/tuple/Tuple.qll/module.Tuple.html): Like a pair, but supports more than two columns.
9797

9898
```ql
9999
predicate nameAgeCity(string name, int age, City city) {
@@ -105,7 +105,7 @@ from Qtil::Tuple3<string, int, City, nameAgeCity/3>::Tuple tuple
105105
select tuple.getFirst(), tuple.getSecond(), tuple.getThird()
106106
```
107107

108-
**Product**: A class to hold all combinations of values of two distinct types.
108+
[**Product**](https://advanced-security.github.io/codeql-qtil/qtil/tuple/Product.qll/module.Product.html): A class to hold all combinations of values of two distinct types.
109109

110110
```ql
111111
// Selects all combinations of people and cities
@@ -115,7 +115,7 @@ select product.getFirst(), product.getSecond()
115115

116116
### Lists
117117

118-
**Ordered**: Takes orderable data, and automatically adds `getPrevious()`, `getNext()` predicate members for ease of traversal.
118+
[**Ordered**](https://advanced-security.github.io/codeql-qtil/qtil/list/Ordered.qll/module.Ordered.html): Takes orderable data, and automatically adds `getPrevious()`, `getNext()` predicate members for ease of traversal.
119119

120120
_Note: the `getOrder()` predicate should not have duplicates._
121121

@@ -144,7 +144,7 @@ from AgeOrderedCityPerson p
144144
select p.getName(), p.getCity(), p.getPrevious().getName(), p.getNext().getName()
145145
```
146146

147-
**CondensedList**: Like the `Ordered` class, but creates a separate `ListEntry` type rather than
147+
[**CondensedList**](https://advanced-security.github.io/codeql-qtil/qtil/list/CondensedList.qll/module.CondensedList.html): Like the `Ordered` class, but creates a separate `ListEntry` type rather than
148148
requiring you to extend the underlying type.
149149

150150
```ql
@@ -167,7 +167,7 @@ listEntry.getNext().getItem().getName()
167167

168168
### Strings
169169

170-
**join(sep, ...)**: The first argument is used as a separator to join the remaining two to eight arguments.
170+
[**join(sep, ...)**](https://advanced-security.github.io/codeql-qtil/qtil/strings/Join.qll/module.Join.html): The first argument is used as a separator to join the remaining two to eight arguments.
171171

172172
This is not intended to replace the CodeQL `concat` aggregation, but rather, to be used in cases where aggregation is not desired.
173173

@@ -176,7 +176,7 @@ This is not intended to replace the CodeQL `concat` aggregation, but rather, to
176176
select Qtil::join(",", "a", "b", "c")
177177
```
178178

179-
**Escape**: Provides a set of modules for escaping and unescaping strings.
179+
[**Escape**](https://advanced-security.github.io/codeql-qtil/qtil/strings/Escape.qll/module.Escape.html): Provides a set of modules for escaping and unescaping strings.
180180

181181
_CAUTION: Be careful in applying this escaping, which has not yet been thoroughly tested or validated, to a sensitive security context._
182182

@@ -196,7 +196,7 @@ select Qtil::SeparatedEscape<Qtil::Chars::comma/0>::EscapeBackslash::of2("foo,ba
196196
Escaping characters will carefully escape and unescape themselves. See documentation on escape maps
197197
to handle cases like turning newlines into `\n`, etc.
198198

199-
**Char**: A subtype of `int` that holds a character code, with members such as `toUppercase()`,
199+
[**Char**](https://advanced-security.github.io/codeql-qtil/qtil/strings/Char.qll/module.Char.html): A subtype of `int` that holds a character code, with members such as `toUppercase()`,
200200
`isLowercase()`, `isDigit()`, and `repeat(n)`.
201201

202202
```ql
@@ -206,15 +206,15 @@ where c.isStr("a") or c = charOf("b") or c = "0".codePointAt(0)
206206
select b.toUppercase().toString()
207207
```
208208

209-
See also the module `Chars` which defines standard nullary predicates that common characters, for
209+
See also the module [`Chars`](https://advanced-security.github.io/codeql-qtil/qtil/strings/Chars.qll/module.Chars.html) which defines standard nullary predicates that common characters, for
210210
instance, `Qtil::Chars::dollar()` holds for the result `"$"`,`Qtil::Chars::a()` holds for `"a"`, and `Qtil::Chars::upperA()` holds for `"A"`.
211211

212212
### ASTs:
213213

214214
The following modules are usable by importing `qtil.lang`, for instance, `qtil.cpp`. However, the
215215
implementations are shared across languages and are available in a do-it-yourself way as well.
216216

217-
**TwoOperands**: A module to simplify checks that an operator uses two distinct operands in a
217+
[**TwoOperands**](https://advanced-security.github.io/codeql-qtil/qtil/ast/TwoOperands.qll/module.TwoOperands.html): A module to simplify checks that an operator uses two distinct operands in a
218218
certain manner.
219219

220220
```ql
@@ -242,7 +242,7 @@ predicate intPlusConstantOld(BinaryExpr e) {
242242

243243
### Query Formatting
244244

245-
**QlFormat** offers a way of formatting CodeQL query messages in a consistent way, with varying
245+
[**QlFormat**](https://advanced-security.github.io/codeql-qtil/qtil/format/QLFormat.qll/module.QLFormat.html) offers a way of formatting CodeQL query messages in a consistent way, with varying
246246
numbers of placeholders, via a template-like syntax. This module is useful for writing more
247247
user-friendly messages for certain types of queries, with a cleaner query implementation.
248248

@@ -290,7 +290,7 @@ This mixture of query results with different numbers of placeholders can be done
290290
`QlFormat` features of qtil, but this approach can allow for much better readability and
291291
maintainability of the query code.
292292

293-
**CustomPathProblem**: Allows users to create a query that has a custom trace through the source
293+
[**CustomPathProblem**](https://advanced-security.github.io/codeql-qtil/qtil/locations/CustomPathProblem.qll/module.CustomPathProblem.html): Allows users to create a query that has a custom trace through the source
294294
code. For example, CodeQL data flow `PathGraph` shows dataflow through a program. However, by using
295295
this module, query authors can trace any path -- a call graph, inheritance chain, transitive
296296
file imports, etc.
@@ -322,12 +322,12 @@ select end, start, end, "Transitive inclusion of banned_header.h from main.cpp"
322322
```
323323

324324
If you wish to perform a path search such as the above, but without reporting problems, you can
325-
use the `Qtil::GraphPathSearch` module instead, which provides an efficient search algorithm
325+
use the [`Qtil::GraphPathSearch`](https://advanced-security.github.io/codeql-qtil/qtil/graph/GraphPathSearch.qll/module.GraphPathSearch.html) module instead, which provides an efficient search algorithm
326326
without producing a `@kind path-problem` query.
327327

328328
### Inheritance
329329

330-
**Instance**: A module to make `instanceof` inheritance easier in CodeQL, by writing
330+
[**Instance**](https://advanced-security.github.io/codeql-qtil/qtil/inheritance/Instance.qll/module.Instance.html): A module to make `instanceof` inheritance easier in CodeQL, by writing
331331
`class Foo extends Qtil::Instanceof<Bar>::Type`, which automatically adds `toString()` and a
332332
member `Bar inst()` to access the member predicates on the `Bar` parent class.
333333

@@ -352,7 +352,7 @@ requires a finite type (standard CodeQL class type). However, infinite types (su
352352
primitives) require special care, which `InfInstance` handles correctly, allowing
353353
`bindingset[this] class OpaqueIntType extends Qtil::InfInstance<int>::Type {}`. See also `UnderlyingString`.
354354

355-
**Final**: A module to avoid creating final type alias declarations, which are required in
355+
[**Final**](https://advanced-security.github.io/codeql-qtil/qtil/parameterization/Finalize.qll/module.Finalize.html): A module to avoid creating final type alias declarations, which are required in
356356
some contexts, such as parameterized modules. Simply extend `Qtil::Final<T>::Type` instead of
357357
declaring a final alias type.
358358

@@ -365,7 +365,7 @@ final class FinalFoo = Foo;
365365
class MyFoo2 extends FinalFoo { ... }
366366
```
367367

368-
**UnderlyingString**: A class to support inheriting from string in order to create custom
368+
[**UnderlyingString**](https://advanced-security.github.io/codeql-qtil/qtil/inheritance/UnderlyingString.qll/module.UnderlyingString.html): A class to support inheriting from string in order to create custom
369369
infinite types with a hidden string representation.
370370

371371
```ql
@@ -377,7 +377,7 @@ class Person extends Qtil::UnderlyingString {
377377

378378
_Note: this class is effectively the same as `Qtil::InfInstance<string>::Type`, but uses the member `str()` to get the underlying string instead of the member `inst()`._
379379

380-
**Finitize**: A module to produce a finite type from an infinite type (such as `string`, `int`, or
380+
[**Finitize**](https://advanced-security.github.io/codeql-qtil/qtil/inheritance/Finitize.qll/module.Finitize.html): A module to produce a finite type from an infinite type (such as `string`, `int`, or
381381
`Qtil::InfInstance<string>::Type`, etc.) by providing predicate that constrains that infinite type.
382382

383383
```ql
@@ -397,18 +397,18 @@ infinite types in a query.
397397
Location types in CodeQL are different types across languages. To use these classes, import
398398
`qtil.lang` (for instance, `qtil.cpp`).
399399

400-
**StringLocation**: A class that supports the codification of any location as a string, which the
400+
[**StringLocation**](https://advanced-security.github.io/codeql-qtil/qtil/locations/StringLocation.qll/module.StringLocation.html): A class that supports the codification of any location as a string, which the
401401
CodeQL engine will use as a location when selected by a query. Also includes support to turn
402402
existing locations into strings with `StringToLocation`, and support to finitize them at the point
403403
where a query no longer must deal with an infinite set using the `Finitize` module.
404404

405-
**OptionalLocation**: A class that works much like `Option<Location>`, but that also implements the
405+
[**OptionalLocation**](https://advanced-security.github.io/codeql-qtil/qtil/locations/OptionalLocation.qll/module.OptionalLocation.html): A class that works much like `Option<Location>`, but that also implements the
406406
`hasLocation()` predicate which the CodeQL engine expects of a location. Allows queries to select
407407
placeholder locations that may or may not exist.
408408

409-
**NullLocation**: An empty location.
409+
[**NullLocation**](https://advanced-security.github.io/codeql-qtil/qtil/locations/NullLocation.qll/module.NullLocation.html): An empty location.
410410

411-
**Locatable**: A signature module that allows cross language support for locatable elements in a
411+
[**Locatable**](https://advanced-security.github.io/codeql-qtil/qtil/locations/Locatable.qll/module.Locatable.html): A signature module that allows cross language support for locatable elements in a
412412
query language, for instance C++ or Java.
413413

414414
This module, and `qtil` modules that depend on it, should already have preexisting
@@ -418,7 +418,7 @@ module allows you to add qtil support for new languages.
418418

419419
### Graphs
420420

421-
**GraphPathSearch**: A module for efficiently finding paths in custom directed graphs from a set of
421+
[**GraphPathSearch**](https://advanced-security.github.io/codeql-qtil/qtil/graph/GraphPathSearch.qll/module.GraphPathSearch.html): A module for efficiently finding paths in custom directed graphs from a set of
422422
starting nodes to a set of ending nodes. For performance, this module uses a pattern called "forward
423423
reverse pruning," a pattern widely used in the CodeQL dataflow libraries.
424424

@@ -444,7 +444,7 @@ For displaying the discovered paths to users, see the `CustomPathProblem` module
444444
While codeql's `test run` subcommand is a great way to test queries, it can be better in some cases
445445
to write a more traditional unit test for CodeQL libraries. Rather than selecting a set of outputs
446446
in a query and then inspecting that the query result (in the `.expectations` file) makes sense, qtil
447-
provides a library called "Qnit" for writing direct test cases with expectations, so that there's
447+
provides a library called ["Qnit"](https://advanced-security.github.io/codeql-qtil/qtil/testing/Qnit.qll/module.Qnit.html) for writing direct test cases with expectations, so that there's
448448
better cohesion between a test case and its expected output.
449449

450450
To use Qnit, import the `qtil.testing.Qnit` module, and create a test class that extends
@@ -486,7 +486,7 @@ See the README in the `qtil.testing` directory for more information on how to us
486486

487487
### Parameterization
488488

489-
**SignaturePredicates.qll** defines modules for creating signature predicates without separate
489+
[**SignaturePredicates.qll**](https://advanced-security.github.io/codeql-qtil/qtil/parameterization/SignaturePredicates.qll/module.SignaturePredicates.html) defines modules for creating signature predicates without separate
490490
signature predicate declarations.
491491

492492
Rather than writing:
@@ -528,7 +528,7 @@ The declared predicate signatures look as follows:
528528
string, and an int result.
529529
- etc., for `Ternary`, `Quaternary`, and up to `Senary` (six parameter) predicates.
530530

531-
**SignatureTypes.qll** contains various baseline signature types to aid in writing correct
531+
[**SignatureTypes.qll**](https://advanced-security.github.io/codeql-qtil/qtil/parameterization/SignatureTypes.qll/module.SignatureTypes.html) contains various baseline signature types to aid in writing correct
532532
parameterized modules, as well as a utility to create a signature type from any existing type.
533533

534534
```ql

scripts/generate_docs.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,13 @@ def main():
185185
# Step 3: Ensure custom CSS is applied (fallback for crash)
186186
ensure_custom_css(args.output)
187187

188-
# Step 4: Create index.html with links to all packs
188+
# Step 4: Copy logo into output directory
189+
logo_src = Path("assets/logo.jpg")
190+
if not logo_src.exists():
191+
raise FileNotFoundError(f"Logo not found at {logo_src}")
192+
shutil.copy2(logo_src, out / "logo.jpg")
193+
194+
# Step 5: Create index.html with links to all packs
189195
create_index_html(args.output, generated_langs)
190196

191197
if __name__ == "__main__":

scripts/templates/index.html.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
.index-container ul { list-style: none; padding-left: 0; }
1212
.index-container li { margin: 0.5em 0; }
1313
.index-container li a { font-size: 1.1em; }
14+
.index-logo { display: block; margin: 1em auto; width: 180px; }
1415
</style>
1516
</head>
1617
<body>
1718
<div class="index-container">
19+
<img src="logo.jpg" alt="qtil logo" class="index-logo">
1820
<h1>qtil — CodeQL Utility Library</h1>
1921
<section>
2022
<h2>Core</h2>

0 commit comments

Comments
 (0)