redhat-documentation / vale-at-red-hat

Vale config files, styles, and docs to help individuals and teams roll out Vale
https://redhat-documentation.github.io/vale-at-red-hat/
MIT License
37 stars 58 forks source link

Create a Vale rule that highlights custom CR names and suggests an example name #825

Open aireilly opened 2 months ago

aireilly commented 2 months ago

Sometimes CR names include customer sensitive information. For example:

apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetworkNodePolicy
metadata:
  name: "customer-sensitive-name"
  namespace: openshift-sriov-network-operator

Write a vale rule that highlights any CR name field that does not match the following best practice naming (pseudo code below), and suggest the best practice when it is not found:

example-$(to_kebab_case(value_of(kind)), or in the above example, example-sriov-network-node-policy

https://vale.sh/docs/topics/actions/

Would also need an update to https://github.com/openshift/openshift-docs/blob/main/contributing_to_docs/doc_guidelines.adoc#yaml-formatting-for-kubernetes-and-openshift-api-objects around naming conventions in CRs

rohennes commented 2 months ago

Thanks Aidan - could include resourceName too. And I guess any field we think could potentially contain customer sensitive data/names.

rohennes commented 2 months ago

Slightly related might be a rule for something like this "lab.eng.*redhat.com" which might indicate an internal only resource