Skip to content

Commit a98ae89

Browse files
authored
Merge pull request github#13832 from github/shati-patel/docs-indentation
Docs: Fix indentation in tutorial examples
2 parents 2dff0ce + 1694915 commit a98ae89

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

docs/codeql/writing-codeql-queries/catch-the-fire-starter.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ Exercise 1
168168
predicate isSouthern(Person p) { p.getLocation() = "south" }
169169
170170
class Southerner extends Person {
171-
/* the characteristic predicate */
172-
Southerner() { isSouthern(this) }
171+
/* the characteristic predicate */
172+
Southerner() { isSouthern(this) }
173173
}
174174
175175
class Child extends Person {
176-
/* the characteristic predicate */
177-
Child() { this.getAge() < 10 }
176+
/* the characteristic predicate */
177+
Child() { this.getAge() < 10 }
178178
179-
/* a member predicate */
180-
override predicate isAllowedIn(string region) { region = this.getLocation() }
179+
/* a member predicate */
180+
override predicate isAllowedIn(string region) { region = this.getLocation() }
181181
}
182182
183183
from Southerner s
@@ -194,16 +194,16 @@ Exercise 2
194194
predicate isSouthern(Person p) { p.getLocation() = "south" }
195195
196196
class Southerner extends Person {
197-
/* the characteristic predicate */
198-
Southerner() { isSouthern(this) }
197+
/* the characteristic predicate */
198+
Southerner() { isSouthern(this) }
199199
}
200200
201201
class Child extends Person {
202-
/* the characteristic predicate */
203-
Child() { this.getAge() < 10 }
202+
/* the characteristic predicate */
203+
Child() { this.getAge() < 10 }
204204
205-
/* a member predicate */
206-
override predicate isAllowedIn(string region) { region = this.getLocation() }
205+
/* a member predicate */
206+
override predicate isAllowedIn(string region) { region = this.getLocation() }
207207
}
208208
209209
predicate isBald(Person p) { not exists(string c | p.getHairColor() = c) }

docs/codeql/writing-codeql-queries/crown-the-rightful-heir.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ Exercise 1
183183
184184
from Person p
185185
where
186-
not p.isDeceased() and
187-
p = relativeOf("King Basil")
186+
not p.isDeceased() and
187+
p = relativeOf("King Basil")
188188
select p
189189
190190
Exercise 2
@@ -197,14 +197,14 @@ Exercise 2
197197
Person relativeOf(Person p) { parentOf*(result) = parentOf*(p) }
198198
199199
predicate hasCriminalRecord(Person p) {
200-
p = "Hester" or
201-
p = "Hugh" or
202-
p = "Charlie"
200+
p = "Hester" or
201+
p = "Hugh" or
202+
p = "Charlie"
203203
}
204204
205205
from Person p
206206
where
207-
not p.isDeceased() and
208-
p = relativeOf("King Basil") and
209-
not hasCriminalRecord(p)
207+
not p.isDeceased() and
208+
p = relativeOf("King Basil") and
209+
not hasCriminalRecord(p)
210210
select p

docs/codeql/writing-codeql-queries/find-the-thief.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,14 @@ Exercise 1
307307
308308
from Person t
309309
where
310-
/* 1 */ t.getHeight() > 150 and
311-
/* 2 */ not t.getHairColor() = "blond" and
312-
/* 3 */ exists (string c | t.getHairColor() = c) and
313-
/* 4 */ not t.getAge() < 30 and
314-
/* 5 */ t.getLocation() = "east" and
315-
/* 6 */ (t.getHairColor() = "black" or t.getHairColor() = "brown") and
316-
/* 7 */ not (t.getHeight() > 180 and t.getHeight() < 190) and
317-
/* 8 */ exists(Person p | p.getAge() > t.getAge())
310+
/* 1 */ t.getHeight() > 150 and
311+
/* 2 */ not t.getHairColor() = "blond" and
312+
/* 3 */ exists (string c | t.getHairColor() = c) and
313+
/* 4 */ not t.getAge() < 30 and
314+
/* 5 */ t.getLocation() = "east" and
315+
/* 6 */ (t.getHairColor() = "black" or t.getHairColor() = "brown") and
316+
/* 7 */ not (t.getHeight() > 180 and t.getHeight() < 190) and
317+
/* 8 */ exists(Person p | p.getAge() > t.getAge())
318318
select t
319319
320320
Exercise 2
@@ -326,16 +326,16 @@ Exercise 2
326326
327327
from Person t
328328
where
329-
/* 1 */ t.getHeight() > 150 and
330-
/* 2 */ not t.getHairColor() = "blond" and
331-
/* 3 */ exists (string c | t.getHairColor() = c) and
332-
/* 4 */ not t.getAge() < 30 and
333-
/* 5 */ t.getLocation() = "east" and
334-
/* 6 */ (t.getHairColor() = "black" or t.getHairColor() = "brown") and
335-
/* 7 */ not (t.getHeight() > 180 and t.getHeight() < 190) and
336-
/* 8 */ exists(Person p | p.getAge() > t.getAge()) and
337-
/* 9 */ not t = max(Person p | | p order by p.getHeight()) and
338-
/* 10 */ t.getHeight() < avg(float i | exists(Person p | p.getHeight() = i) | i) and
339-
/* 11 */ t = max(Person p | p.getLocation() = "east" | p order by p.getAge())
329+
/* 1 */ t.getHeight() > 150 and
330+
/* 2 */ not t.getHairColor() = "blond" and
331+
/* 3 */ exists (string c | t.getHairColor() = c) and
332+
/* 4 */ not t.getAge() < 30 and
333+
/* 5 */ t.getLocation() = "east" and
334+
/* 6 */ (t.getHairColor() = "black" or t.getHairColor() = "brown") and
335+
/* 7 */ not (t.getHeight() > 180 and t.getHeight() < 190) and
336+
/* 8 */ exists(Person p | p.getAge() > t.getAge()) and
337+
/* 9 */ not t = max(Person p | | p order by p.getHeight()) and
338+
/* 10 */ t.getHeight() < avg(float i | exists(Person p | p.getHeight() = i) | i) and
339+
/* 11 */ t = max(Person p | p.getLocation() = "east" | p order by p.getAge())
340340
select "The thief is " + t + "!"
341341

0 commit comments

Comments
 (0)