Skip to content

Commit

Permalink
test: fixed file format
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-cardenas-coding committed Jun 26, 2024
1 parent 11cbdf3 commit c1b07e1
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
cancel-in-progress: true

env:
VALE_VERSION: "3.5.0"
VALE_VERSION: "3.6.0"

jobs:
run-ci:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
StylesPath = ../../styles/
MinAlertLevel = suggestion
[*.md]
spectrocloud-docs-internal.Plural-Parantheses = YES
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ action:
- trim_right
- "(s)"
tokens:
- '\b\w+\(s\)'
- '\b\w+\(s\)'
8 changes: 7 additions & 1 deletion packages/spectrocloud/tests/plural-parantheses/fail.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
22 changes: 18 additions & 4 deletions scripts/missing_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c1b07e1

Please sign in to comment.