From 505f8527fc0b3eb4a85b85a1775b6bc893f236bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Wed, 4 Jan 2023 12:35:01 +0100 Subject: [PATCH] chore: added Vale configuration to validate style guide consistency (#1107) --- .gitignore | 1 + .vale.ini | 24 +++++++++++++++++++ .../PodmanDesktop/ProductNames/.vale.ini | 23 ++++++++++++++++++ .../PodmanDesktop/ProductNames/testinvalid.md | 2 ++ .../PodmanDesktop/ProductNames/testvalid.md | 3 +++ .vale/styles/PodmanDesktop/ProductNames.yml | 9 +++++++ 6 files changed, 62 insertions(+) create mode 100644 .vale.ini create mode 100644 .vale/fixtures/PodmanDesktop/ProductNames/.vale.ini create mode 100644 .vale/fixtures/PodmanDesktop/ProductNames/testinvalid.md create mode 100644 .vale/fixtures/PodmanDesktop/ProductNames/testvalid.md create mode 100644 .vale/styles/PodmanDesktop/ProductNames.yml diff --git a/.gitignore b/.gitignore index 910730203c2..81110b2a09e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist *.cdix .parcel-cache .idea +.vale/styles/RedHat diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 00000000000..85cf3662800 --- /dev/null +++ b/.vale.ini @@ -0,0 +1,24 @@ +; .vale.ini +; Vale configuration file. See https://vale.sh +; +; Copyright (C) 2023 Red Hat, Inc. +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. +; +; SPDX-License-Identifier: Apache-2.0 +; +MinAlertLevel = suggestion +Packages = RedHat +StylesPath = .vale/styles + +[*.md] +BasedOnStyles = RedHat,PodmanDesktop diff --git a/.vale/fixtures/PodmanDesktop/ProductNames/.vale.ini b/.vale/fixtures/PodmanDesktop/ProductNames/.vale.ini new file mode 100644 index 00000000000..3d3a3d68ea1 --- /dev/null +++ b/.vale/fixtures/PodmanDesktop/ProductNames/.vale.ini @@ -0,0 +1,23 @@ +; .vale.ini +; Vale configuration file. See https://vale.sh +; +; Copyright (C) 2023 Red Hat, Inc. +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. +; +; SPDX-License-Identifier: Apache-2.0 +; +MinAlertLevel = suggestion +StylesPath = ../../../styles + +[*.md] +PodmanDesktop.ProductNames = YES diff --git a/.vale/fixtures/PodmanDesktop/ProductNames/testinvalid.md b/.vale/fixtures/PodmanDesktop/ProductNames/testinvalid.md new file mode 100644 index 00000000000..014e183fcaa --- /dev/null +++ b/.vale/fixtures/PodmanDesktop/ProductNames/testinvalid.md @@ -0,0 +1,2 @@ +Podman desktop +podman diff --git a/.vale/fixtures/PodmanDesktop/ProductNames/testvalid.md b/.vale/fixtures/PodmanDesktop/ProductNames/testvalid.md new file mode 100644 index 00000000000..d5777e6b2ba --- /dev/null +++ b/.vale/fixtures/PodmanDesktop/ProductNames/testvalid.md @@ -0,0 +1,3 @@ +Podman Desktop +`podman` +Podman diff --git a/.vale/styles/PodmanDesktop/ProductNames.yml b/.vale/styles/PodmanDesktop/ProductNames.yml new file mode 100644 index 00000000000..eaa4e05e6de --- /dev/null +++ b/.vale/styles/PodmanDesktop/ProductNames.yml @@ -0,0 +1,9 @@ +--- +extends: substitution +message: "Consider using: %s, rather than: %s" +level: warning +ignorecase: false +# swap map tokens in the form of bad: good +swap: + Podman desktop: Podman Desktop + podman: '`podman` or Podman'