diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 5e6cec4..773f250 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,7 +9,7 @@ concurrency: cancel-in-progress: true env: - VALE_VERSION: "3.5.0" + VALE_VERSION: "3.6.0" jobs: run-ci: diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a191d1f..746e338 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -3,7 +3,7 @@ on: inputs: version: description: "The version of the Vale to use" - default: "3.5.0" + default: "3.6.0" type: string required: false diff --git a/packages/spectrocloud-docs-internal/styles/spectrocloud-docs-internal/plural-parantheses.yaml b/packages/spectrocloud-docs-internal/styles/spectrocloud-docs-internal/plural-parantheses.yml similarity index 100% rename from packages/spectrocloud-docs-internal/styles/spectrocloud-docs-internal/plural-parantheses.yaml rename to packages/spectrocloud-docs-internal/styles/spectrocloud-docs-internal/plural-parantheses.yml diff --git a/packages/spectrocloud-docs-internal/styles/spectrocloud-docs-internal/we.yaml b/packages/spectrocloud-docs-internal/styles/spectrocloud-docs-internal/we.yml similarity index 100% rename from packages/spectrocloud-docs-internal/styles/spectrocloud-docs-internal/we.yaml rename to packages/spectrocloud-docs-internal/styles/spectrocloud-docs-internal/we.yml diff --git a/packages/spectrocloud-docs-internal/tests/plural-parantheses/.vale.ini b/packages/spectrocloud-docs-internal/tests/plural-parantheses/.vale.ini new file mode 100644 index 0000000..cb64237 --- /dev/null +++ b/packages/spectrocloud-docs-internal/tests/plural-parantheses/.vale.ini @@ -0,0 +1,4 @@ +StylesPath = ../../styles/ +MinAlertLevel = suggestion +[*.md] +spectrocloud-docs-internal.Plural-Parantheses = YES \ No newline at end of file diff --git a/packages/spectrocloud-docs-internal/tests/plural-parantheses/fail.md b/packages/spectrocloud-docs-internal/tests/plural-parantheses/fail.md new file mode 100644 index 0000000..689a44a --- /dev/null +++ b/packages/spectrocloud-docs-internal/tests/plural-parantheses/fail.md @@ -0,0 +1,13 @@ +## Parameters + +The following parameter(s) are supported. + +:::info + +The cluster node(s) will automatically scale down. + +::: + +- `name` (string, required): The name of the user. + +- `age` (number, required): The age of the user. diff --git a/packages/spectrocloud-docs-internal/tests/plural-parantheses/pass.md b/packages/spectrocloud-docs-internal/tests/plural-parantheses/pass.md new file mode 100644 index 0000000..53cd7cd --- /dev/null +++ b/packages/spectrocloud-docs-internal/tests/plural-parantheses/pass.md @@ -0,0 +1,7 @@ +## Parameters + +The following parameters are supported: + +- `name` (string, required): The name of the user. + +- `age` (number, required): The age of the user. diff --git a/packages/spectrocloud/styles/spectrocloud/plural-parantheses.yaml b/packages/spectrocloud/styles/spectrocloud/plural-parantheses.yml similarity index 96% rename from packages/spectrocloud/styles/spectrocloud/plural-parantheses.yaml rename to packages/spectrocloud/styles/spectrocloud/plural-parantheses.yml index 298bb32..f31919b 100644 --- a/packages/spectrocloud/styles/spectrocloud/plural-parantheses.yaml +++ b/packages/spectrocloud/styles/spectrocloud/plural-parantheses.yml @@ -12,4 +12,4 @@ action: - trim_right - "(s)" tokens: - - '\b\w+\(s\)' \ No newline at end of file + - '\b\w+\(s\)' diff --git a/packages/spectrocloud/styles/spectrocloud/we.yaml b/packages/spectrocloud/styles/spectrocloud/we.yml similarity index 100% rename from packages/spectrocloud/styles/spectrocloud/we.yaml rename to packages/spectrocloud/styles/spectrocloud/we.yml diff --git a/packages/spectrocloud/tests/plural-parantheses/fail.md b/packages/spectrocloud/tests/plural-parantheses/fail.md index 8f1d57f..689a44a 100644 --- a/packages/spectrocloud/tests/plural-parantheses/fail.md +++ b/packages/spectrocloud/tests/plural-parantheses/fail.md @@ -1,6 +1,12 @@ ## Parameters -The following parameter(s) are supported: +The following parameter(s) are supported. + +:::info + +The cluster node(s) will automatically scale down. + +::: - `name` (string, required): The name of the user. diff --git a/scripts/missing_tests.sh b/scripts/missing_tests.sh index 2629cf4..8270840 100755 --- a/scripts/missing_tests.sh +++ b/scripts/missing_tests.sh @@ -9,12 +9,17 @@ REQUIRED_FILES=(".vale.ini" "pass.md" "fail.md") # Counter for failed tests failed_tests=0 -# Function to get the rule name from the rule file path +# Function to get the rule name from the rule file path. If the file does not end with .yaml, it will return an error message. get_rule_name() { local rule_file="$1" - local rule_name=$(basename "$rule_file" .yml) - rule_name=${rule_name%.yaml} - echo "$rule_name" + if [[ "$rule_file" == *.yaml ]]; then + echo "" + echo "Error: The rule $rule_file ends with .yaml. Vale requires .yml instead. ❌" + echo "" + else + local rule_name=$(basename "$rule_file" .yml) + echo "$rule_name" + fi } # Function to check if test files exist @@ -42,6 +47,15 @@ check_test_files() { } +check_yaml_extension() { + local file="$1" + if [[ "$file" == *.yaml ]]; then + echo "The file ends with .yaml" + else + echo "The file does not end with .yaml" + fi +} + # Function to traverse the directory structure traverse_directories() { for package_dir in "$BASE_DIR"/*; do