Skip to content

Commit

Permalink
fix: misc improvements (#28)
Browse files Browse the repository at this point in the history
* fix: added airgap term

* docs: fixed headings title rule

* fix: fix title rule

* ci: fix test script

* chore: added missing rule

* chore: removed colon

* chore: fix file path

* chore: updated test rules

* ci: updated vale rule
  • Loading branch information
karl-cardenas-coding authored Oct 24, 2024
1 parent 122f7b6 commit 865bd29
Show file tree
Hide file tree
Showing 18 changed files with 74 additions and 70 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.6.0"
VALE_VERSION: "3.7.1"

jobs:
run-ci:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ Kubernetes NFS Subdir External Provisioner
Splunk
Kubevious
Citrix
Disable
[Dd]isable
Hotfixes
Hotfix
Layer 2
L2
HashiCorp
airgap
Airgap
jq
Caddy
jumpbox
Expand Down Expand Up @@ -195,7 +193,7 @@ rhel
Ubuntu
RHEL
repave
airgap
[Aa]irgap
Crossplane
traceroute
Local UI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ message: "Avoid using a noun that starts with an -ing in headings. Your heading
level: error
scope: heading
raw:
- "ing\\b"
- "^\\b\\w+ing\\b"
exceptions:
- "Breaking"
- "Breaking Changes"
9 changes: 9 additions & 0 deletions packages/spectrocloud-docs-internal/tests/colon/pass.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ A few things to keep in mind before removing the cluster profile:
- Active clusters are not affected.

- Names starting with `project:scope` are reserved for internal use.

#### External Registry Parameters

:::warning

This parameter is deprecated. Use the parameter [`stylus.externalRegistries`](#external-registries) to configure
external registries.

:::
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
StylesPath = ../../styles/
MinAlertLevel = suggestion
[*.md]
spectrocloud.heading-all-caps = YES
spectrocloud-docs-internal.heading-all-caps = YES
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Select the workflow that best fits your needs.
- [Create an Edge Native Host Cluster](#create-an-edge-native-host-cluster)
- [Add an Edge Host to a Host Cluster](#add-an-edge-host-to-a-host-cluster)

### Improvements

<!-- prettier-ignore -->
- <VersionedLink text="BYOOS Edge OS" url="/integrations/packs/?pack=edge-native-byoi" /> pack version 2.0.0 is now available with support for [agent mode deployment](../deployment-modes/agent-mode/agent-mode.md).

## THIS IS NOT TITLE CASE

## Create an Edge Native Host Cluster
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
StylesPath = ../../styles/
MinAlertLevel = suggestion
[*.md]
spectrocloud.heading-title-case = YES
spectrocloud.heading-all-caps = YES
spectrocloud-docs-internal.heading-title-case = YES
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ Palette eXtended Kubernetes (PXK) is a Kubernetes distribution that is optimized
##### Security

###### Exceptions

## Registry Mapping Rules

# Breaking Changes
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ Kubernetes NFS Subdir External Provisioner
Splunk
Kubevious
Citrix
Disable
[Dd]isable
Hotfixes
Hotfix
Layer 2
L2
HashiCorp
airgap
Airgap
jq
Caddy
jumpbox
Expand Down Expand Up @@ -195,7 +193,7 @@ rhel
Ubuntu
RHEL
repave
airgap
[Aa]irgap
Crossplane
traceroute
Local UI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ scope: heading
# $title, $sentence, $lower, $upper, or a pattern.
match: $title
style: Chicago # AP or Chicago; only applies when match is set to $title.

5 changes: 4 additions & 1 deletion packages/spectrocloud/styles/spectrocloud/headings-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ message: "Avoid using a noun that starts with an -ing in headings. Your heading
level: error
scope: heading
raw:
- "ing\\b"
- "^\\b\\w+ing\\b"
exceptions:
- "Breaking"
- "Breaking Changes"
29 changes: 29 additions & 0 deletions packages/spectrocloud/styles/spectrocloud/longform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

---
extends: existence
message: "Avoid using the short form of commands. Replace the short form flag in '%s' with the corresponding long form flag."
link: https://spectrocloud.atlassian.net/wiki/spaces/DE/pages/1765933057/Spectro+Cloud+Internal+Style+Guide#Commands-%26-Parameters
level: error
ignorecase: false
scope: raw
tokens:
# Match a word followed by one or more spaces, followed by the short form of a flag (one to three letters). The short flag can appear one or more times consecutively. For example: palette -h.
- (\b([\w]+))([\s ]{1,}[-][a-zA-Z]{1,3})+
exceptions:
- ls([\s ]{1,}[-][a-zA-Z]{1,3})+
- cd([\s ]{1,}[-][a-zA-Z]{1,3})+
- cp([\s ]{1,}[-][a-zA-Z]{1,3})+
- mv([\s ]{1,}[-][a-zA-Z]{1,3})+
- rm([\s ]{1,}[-][a-zA-Z]{1,3})+
- mkdir([\s ]{1,}[-][a-zA-Z]{1,3})+
- rmdir([\s ]{1,}[-][a-zA-Z]{1,3})+
- cat([\s ]{1,}[-][a-zA-Z]{1,3})+
- pwd([\s ]{1,}[-][a-zA-Z]{1,3})+
- echo([\s ]{1,}[-][a-zA-Z]{1,3})+
- chmod([\s ]{1,}[-][a-zA-Z]{1,3})+
- chown([\s ]{1,}[-][a-zA-Z]{1,3})+
- sed([\s ]{1,}[-][a-zA-Z]{1,3})+
- wc([\s ]{1,}[-][a-zA-Z]{1,3})+
- tar([\s ]{1,}[-][a-zA-Z]{1,3})+
4 changes: 0 additions & 4 deletions packages/spectrocloud/tests/colon/.vale.ini

This file was deleted.

21 changes: 0 additions & 21 deletions packages/spectrocloud/tests/colon/fail.md

This file was deleted.

21 changes: 0 additions & 21 deletions packages/spectrocloud/tests/colon/pass.md

This file was deleted.

3 changes: 1 addition & 2 deletions packages/spectrocloud/tests/heading-title-case/.vale.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
StylesPath = ../../styles/
MinAlertLevel = suggestion
[*.md]
spectrocloud.heading-title-case = YES
spectrocloud.heading-all-caps = YES
spectrocloud.heading-title-case = YES
4 changes: 4 additions & 0 deletions packages/spectrocloud/tests/headings-title/pass.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ Palette eXtended Kubernetes (PXK) is a Kubernetes distribution that is optimized
##### Security

###### Exceptions

## Registry Mapping Rules

# Breaking Changes
14 changes: 7 additions & 7 deletions scripts/check_rule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ check_fail_conditions() {

# Check if the directory contains a file named fail.md
if [ ! -f "$fail_md_file" ]; then
echo "Error: $base_directory does not contain a file named pass.md"
echo "Error: $base_directory does not contain a file named fail.md"
exit 1
fi

Expand All @@ -92,12 +92,12 @@ check_fail_conditions() {

RESULT=$(vale --config="$config_file" --no-exit --output=line "$fail_md_file" | wc -l)

if [ -z $RESULT ]; then
echo "$package_name/$rule_name fail condition test - ❌"
log=$(vale --config="$config_file" --output=line "$fail_md_file")
echo "Debug: $log"
failed_tests=$((failed_tests + 1))
return 1
if [ "$RESULT" -eq 0 ]; then
echo "$package_name/$rule_name fail condition test - ❌"
log=$(vale --config="$config_file" --output=line "$fail_md_file")
echo "Debug: $log"
failed_tests=$((failed_tests + 1))
return 1
fi
echo "$package_name/$rule_name fail condition test - ✅"
}
Expand Down

0 comments on commit 865bd29

Please sign in to comment.