Skip to content

Commit be2cd02

Browse files
docs: fix links to rules (#467)
we'll have to deploy to see if this actually works – using `mike serve` apparently doesn't deploy the local `docs/` directory, but uses a git branch.
1 parent fa18370 commit be2cd02

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

crates/pgt_diagnostics_categories/src/categories.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
// must be between `define_categories! {\n` and `\n ;\n`.
1414

1515
define_categories! {
16-
"lint/safety/addingRequiredField": "https://pglt.dev/linter/rules/adding-required-field",
17-
"lint/safety/banDropColumn": "https://pglt.dev/linter/rules/ban-drop-column",
18-
"lint/safety/banDropDatabase": "https://pgtools.dev/linter/rules/ban-drop-database",
19-
"lint/safety/banDropNotNull": "https://pglt.dev/linter/rules/ban-drop-not-null",
20-
"lint/safety/banDropTable": "https://pglt.dev/linter/rules/ban-drop-table",
21-
"lint/safety/banTruncateCascade": "https://pgtools.dev/linter/rules/ban-truncate-cascade",
16+
"lint/safety/addingRequiredField": "https://pgtools.dev/latest/rules/adding-required-field",
17+
"lint/safety/banDropColumn": "https://pgtools.dev/latest/rules/ban-drop-column",
18+
"lint/safety/banDropDatabase": "https://pgtools.dev/latest/rules/ban-drop-database",
19+
"lint/safety/banDropNotNull": "https://pgtools.dev/latest/rules/ban-drop-not-null",
20+
"lint/safety/banDropTable": "https://pgtools.dev/latest/rules/ban-drop-table",
21+
"lint/safety/banTruncateCascade": "https://pgtools.dev/latest/rules/ban-truncate-cascade",
2222
// end lint rules
2323
;
2424
// General categories

docs/codegen/src/rules_index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn generate_group(
6969

7070
write!(
7171
content,
72-
"| [{rule_name}](/rules/{dashed_rule}) | {summary} | {properties} |"
72+
"| [{rule_name}](./{dashed_rule}) | {summary} | {properties} |"
7373
)?;
7474

7575
writeln!(content)?;

docs/codegen/src/rules_sources.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ pub fn generate_rule_sources(docs_dir: &Path) -> anyhow::Result<()> {
4848
for (rule_name, metadata) in rules {
4949
let kebab_rule_name = Case::Kebab.convert(rule_name);
5050
if metadata.sources.is_empty() {
51-
exclusive_rules.insert((rule_name.to_string(), format!("./rules/{kebab_rule_name}")));
51+
exclusive_rules.insert((rule_name.to_string(), format!("../rules/{kebab_rule_name}")));
5252
} else {
5353
for source in metadata.sources {
5454
let source_set = SourceSet {
5555
rule_name: rule_name.to_string(),
56-
link: format!("./rules/{kebab_rule_name}"),
56+
link: format!("../rules/{kebab_rule_name}"),
5757
source_link: source.to_rule_url(),
5858
source_rule_name: source.as_rule_name().to_string(),
5959
};

docs/rule_sources.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
### Squawk
44
| Squawk Rule Name | Rule Name |
55
| ---- | ---- |
6-
| [adding-required-field](https://squawkhq.com/docs/adding-required-field) |[addingRequiredField](./rules/adding-required-field) |
7-
| [ban-drop-column](https://squawkhq.com/docs/ban-drop-column) |[banDropColumn](./rules/ban-drop-column) |
8-
| [ban-drop-database](https://squawkhq.com/docs/ban-drop-database) |[banDropDatabase](./rules/ban-drop-database) |
9-
| [ban-drop-not-null](https://squawkhq.com/docs/ban-drop-not-null) |[banDropNotNull](./rules/ban-drop-not-null) |
10-
| [ban-drop-table](https://squawkhq.com/docs/ban-drop-table) |[banDropTable](./rules/ban-drop-table) |
11-
| [ban-truncate-cascade](https://squawkhq.com/docs/ban-truncate-cascade) |[banTruncateCascade](./rules/ban-truncate-cascade) |
6+
| [adding-required-field](https://squawkhq.com/docs/adding-required-field) |[addingRequiredField](../rules/adding-required-field) |
7+
| [ban-drop-column](https://squawkhq.com/docs/ban-drop-column) |[banDropColumn](../rules/ban-drop-column) |
8+
| [ban-drop-database](https://squawkhq.com/docs/ban-drop-database) |[banDropDatabase](../rules/ban-drop-database) |
9+
| [ban-drop-not-null](https://squawkhq.com/docs/ban-drop-not-null) |[banDropNotNull](../rules/ban-drop-not-null) |
10+
| [ban-drop-table](https://squawkhq.com/docs/ban-drop-table) |[banDropTable](../rules/ban-drop-table) |
11+
| [ban-truncate-cascade](https://squawkhq.com/docs/ban-truncate-cascade) |[banTruncateCascade](../rules/ban-truncate-cascade) |

docs/rules.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Rules that detect potential safety issues in your code.
1212

1313
| Rule name | Description | Properties |
1414
| --- | --- | --- |
15-
| [addingRequiredField](/rules/adding-required-field) | Adding a new column that is NOT NULL and has no default value to an existing table effectively makes it required. | |
16-
| [banDropColumn](/rules/ban-drop-column) | Dropping a column may break existing clients. ||
17-
| [banDropDatabase](/rules/ban-drop-database) | Dropping a database may break existing clients (and everything else, really). | |
18-
| [banDropNotNull](/rules/ban-drop-not-null) | Dropping a NOT NULL constraint may break existing clients. ||
19-
| [banDropTable](/rules/ban-drop-table) | Dropping a table may break existing clients. ||
20-
| [banTruncateCascade](/rules/ban-truncate-cascade) | Using `TRUNCATE`'s `CASCADE` option will truncate any tables that are also foreign-keyed to the specified tables. | |
15+
| [addingRequiredField](./adding-required-field) | Adding a new column that is NOT NULL and has no default value to an existing table effectively makes it required. | |
16+
| [banDropColumn](./ban-drop-column) | Dropping a column may break existing clients. ||
17+
| [banDropDatabase](./ban-drop-database) | Dropping a database may break existing clients (and everything else, really). | |
18+
| [banDropNotNull](./ban-drop-not-null) | Dropping a NOT NULL constraint may break existing clients. ||
19+
| [banDropTable](./ban-drop-table) | Dropping a table may break existing clients. ||
20+
| [banTruncateCascade](./ban-truncate-cascade) | Using `TRUNCATE`'s `CASCADE` option will truncate any tables that are also foreign-keyed to the specified tables. | |
2121

2222
[//]: # (END RULES_INDEX)
2323

xtask/codegen/src/generate_new_analyser_rule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub fn generate_new_analyser_rule(
132132
// We sort rules to reduce conflicts between contributions made in parallel.
133133
let rule_line = match category {
134134
Category::Lint => format!(
135-
r#" "lint/{group}/{rule_name_camel}": "https://pgtools.dev/linter/rules/{kebab_case_rule}","#
135+
r#" "lint/{group}/{rule_name_camel}": "https://pgtools.dev/latest/rules/{kebab_case_rule}","#
136136
),
137137
};
138138
let lint_start = match category {

0 commit comments

Comments
 (0)