Skip to content

Commit 5c0f63d

Browse files
committed
Original schema renamed to rule-schema
1 parent 6d8b8c5 commit 5c0f63d

12 files changed

Lines changed: 23 additions & 20 deletions

.github/workflows/rule-validation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: rule-validation
33
on:
44
push:
55
pull_request:
6-
paths: ["rules", "docs/namelint-schema.yaml"]
6+
paths: ["config/*", "rules/*", "docs/*-schema.yaml"]
77

88
# Allows you to run this workflow manually from the Actions tab
99
workflow_dispatch:

.github/workflows/website-deploy.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,23 @@ jobs:
2828
steps:
2929
- name: Checkout
3030
uses: actions/checkout@v4
31+
32+
- name: YAML to JSON
33+
run: |
34+
yq --version
35+
ls -l .
36+
cat ./docs/namelint-rule-schema.yaml | yq . --output-format=json >./docs/namelint-rule-schema.json
37+
cat ./docs/namelint-config-schema.yaml | yq . --output-format=json >./docs/namelint-config-schema.json
38+
3139
- name: Setup Pages
3240
uses: actions/configure-pages@v5
41+
3342
- name: Build with Jekyll
3443
uses: actions/jekyll-build-pages@v1
3544
with:
3645
source: ./docs
3746
destination: ./_site
38-
- name: YAML to JSON
39-
run: |
40-
yq --version
41-
ls -l .
42-
sudo chown --recursive runner:docker _site
43-
ls -l .
44-
cat ./docs/namelint-schema.yaml | yq . --output-format=json >./_site/namelint-schema.json
45-
cat ./docs/namelint-config-schema.yaml | yq . --output-format=json >./_site/namelint-config-schema.json
47+
4648
- name: Upload artifact
4749
uses: actions/upload-pages-artifact@v3
4850

bin/validate-configs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1111
REPO_DIR="$( cd "${SCRIPT_DIR}/.." && pwd )"
1212

1313
SCHEMA_YAML="${REPO_DIR}/docs/namelint-config-schema.yaml"
14-
YAML_DIR="${REPO_DIR}/conf"
14+
YAML_DIR="${REPO_DIR}/config"
1515

1616
"${SCRIPT_DIR}/_validate.sh" "${SCHEMA_YAML}" "${YAML_DIR}"

bin/validate-rules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -o nounset
1010
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1111
REPO_DIR="$( cd "${SCRIPT_DIR}/.." && pwd )"
1212

13-
SCHEMA_YAML="${REPO_DIR}/docs/namelint-schema.yaml"
13+
SCHEMA_YAML="${REPO_DIR}/docs/namelint-rule-schema.yaml"
1414
YAML_DIR="${REPO_DIR}/rules"
1515

1616
"${SCRIPT_DIR}/_validate.sh" "${SCHEMA_YAML}" "${YAML_DIR}"
File renamed without changes.

docs/namelint-config-schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$schema: https://json-schema.org/draft/2020-12/schema
2-
$id: https://www.namelint.dev/namelint-schema.json
2+
$id: https://www.namelint.dev/namelint-config-schema.json
33
title: Namelint configuration file schema
44
description: >-
55
Schema for the configuration of namelint
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$schema: https://json-schema.org/draft/2020-12/schema
2-
$id: https://www.namelint.dev/namelint-schema.json
2+
$id: https://www.namelint.dev/namelint-rule-schema.json
33
title: Namelint rule definition file schema
44
description: >-
55
Schema for the definition of filename rules and rule sets

rules/posix.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ rules:
22
- description: |
33
Only allow characters in the Posix [Portable Filename Character Set](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_265)
44
regex:
5-
pattern: "$[A-Za-z0-9._-]+$"
5+
pattern: "^[A-Za-z0-9._-]+$"
66
expect: "match"
77
rule_id: "posix-portable"
88
title: "Only POSIX portable filename characters"

src/exam-cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn main() {
3737
let binding = command.get_matches();
3838

3939
let schema_file = binding.get_one::<String>("schema");
40-
let validator = must_load_validator(schema_file);
40+
let validator = must_load_validator(schema_file, true);
4141

4242
let mut all_rules: HashMap<String, Rule> = HashMap::new();
4343
let mut all_rulesets: HashMap<String, RuleSet> = HashMap::new();

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn main() {
5252
let binding = command.get_matches();
5353
//LATER: convert to log level let verbose = binding.get_count("verbose");
5454
let schema_file = binding.get_one::<String>("schema");
55-
let validator = must_load_validator(schema_file);
55+
let validator = must_load_validator(schema_file, true);
5656

5757
let mut all_rules: HashMap<String, Rule> = HashMap::new();
5858
let mut all_rulesets: HashMap<String, RuleSet> = HashMap::new();

0 commit comments

Comments
 (0)