Skip to content

Commit 035aa2b

Browse files
highlight violating code lines in bad examples and fixes in good examples
1 parent b73fa07 commit 035aa2b

File tree

123 files changed

+262
-262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+262
-262
lines changed

docs/4-language-usage/1-general/g-1010.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ It's a good alternative for comments to indicate the start and end of a named pr
99

1010
## Example (bad)
1111

12-
``` sql
12+
``` sql hl_lines="2 4 6 8"
1313
begin
1414
begin
1515
null;
@@ -24,7 +24,7 @@ end;
2424

2525
## Example (good)
2626

27-
``` sql
27+
``` sql hl_lines="2 5 7 10"
2828
begin
2929
<<prepare_data>>
3030
begin

docs/4-language-usage/1-general/g-1020.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Use a label directly in front of loops and nested anonymous blocks:
1212

1313
## Example (bad)
1414

15-
``` sql
15+
``` sql hl_lines="10 15 22 27 33"
1616
declare
1717
i integer;
1818
co_min_value constant integer := 1;
@@ -52,7 +52,7 @@ end;
5252

5353
## Example (good)
5454

55-
``` sql
55+
``` sql hl_lines="10 15 22 27 33"
5656
declare
5757
i integer;
5858
co_min_value constant integer := 1;

docs/4-language-usage/1-general/g-1030.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Unused variables decrease the maintainability and readability of your code.
99

1010
## Example (bad)
1111

12-
``` sql
12+
``` sql hl_lines="4 6"
1313
create or replace package body my_package is
1414
procedure my_proc is
1515
l_last_name employees.last_name%type;
@@ -33,7 +33,7 @@ end my_package;
3333

3434
## Example (good)
3535

36-
``` sql
36+
``` sql hl_lines="5 12"
3737
create or replace package body my_package is
3838
procedure my_proc is
3939
l_last_name employees.last_name%type;

docs/4-language-usage/1-general/g-1040.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Any part of your code, which is no longer used or cannot be reached, should be e
99

1010
## Example (bad)
1111

12-
``` sql
12+
``` sql hl_lines="4 12 19 31 38"
1313
declare
1414
co_dept_purchasing constant departments.department_id%type := 30;
1515
begin

docs/4-language-usage/1-general/g-1050.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To avoid an extreme plethora of constants or false positives, a literal should n
1313

1414
## Example (bad)
1515

16-
``` sql
16+
``` sql hl_lines="2-4"
1717
begin
1818
some_api.setup(in_department_id => 10);
1919
some_api.process(in_department_id => 10);
@@ -24,7 +24,7 @@ end;
2424

2525
## Example (good)
2626

27-
``` sql
27+
``` sql hl_lines="7-9"
2828
create or replace package constants_up is
2929
co_dept_admin constant departments.department_id%type := 10;
3030
end constants_up;

docs/4-language-usage/1-general/g-1060.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Instead of using `rowid` for later reference to the original row one should use
1111

1212
## Example (bad)
1313

14-
``` sql
14+
``` sql hl_lines="6 11"
1515
begin
1616
insert into employees_log (
1717
employee_id

docs/4-language-usage/1-general/g-1070.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Having an end-of-comment within a block comment will end that block-comment. Thi
99

1010
## Example (bad)
1111

12-
``` sql
12+
``` sql hl_lines="2 4"
1313
begin
1414
/* comment one -- nested comment two */
1515
null;
@@ -21,7 +21,7 @@ end;
2121

2222
## Example (good)
2323

24-
``` sql
24+
``` sql hl_lines="2 4"
2525
begin
2626
/* comment one, comment two */
2727
null;

docs/4-language-usage/1-general/g-1080.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This rule ignores operators `+`, `*` and `||`, and expressions: `1=1`, `1<>1`, `
1111

1212
## Example (bad)
1313

14-
``` sql
14+
``` sql hl_lines="9 10"
1515
declare
1616
co_max_salary constant emp.salary%type := 3000;
1717
begin
@@ -29,7 +29,7 @@ end;
2929

3030
## Example (good)
3131

32-
``` sql
32+
``` sql hl_lines="9"
3333
declare
3434
co_max_salary constant emp.salary%type := 3000;
3535
begin

docs/4-language-usage/2-variables-and-types/1-general/g-2110.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Changing the size of the database column last_name in the employees table from `
99

1010
## Example (bad)
1111

12-
``` sql
12+
``` sql hl_lines="3"
1313
create or replace package body my_package is
1414
procedure my_proc is
1515
l_last_name varchar2(20 char);
@@ -31,7 +31,7 @@ end my_package;
3131

3232
## Example (good)
3333

34-
``` sql
34+
``` sql hl_lines="3"
3535
create or replace package body my_package is
3636
procedure my_proc is
3737
l_last_name employees.last_name%type;

docs/4-language-usage/2-variables-and-types/1-general/g-2120.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A single location could be either a type specification package or the database (
1111

1212
## Example (bad)
1313

14-
``` sql
14+
``` sql hl_lines="3"
1515
create or replace package body my_package is
1616
procedure my_proc is
1717
subtype big_string_type is varchar2(1000 char);
@@ -26,7 +26,7 @@ end my_package;
2626

2727
## Example (good)
2828

29-
``` sql
29+
``` sql hl_lines="8"
3030
create or replace package types_up is
3131
subtype big_string_type is varchar2(1000 char);
3232
end types_up;

0 commit comments

Comments
 (0)