Skip to content

Commit f4fe14a

Browse files
Improve Hyperlint config to avoid false positives (#1036)
Co-authored-by: Angela Simms <[email protected]>
1 parent 11bc243 commit f4fe14a

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
= Redpanda Data Documentation Code Formatting Guidelines
22

3-
== Commands and code
4-
5-
Don't start a sentence not inside a code block with a command or code. Instead, try to move the code into the middle of the sentence. For example, you can introduce the command with a more descriptive word like “Run”.
3+
== Rule: Do not start a sentence with a command or code.
64

75
*Correct:* Run the `rpk topic create` command to create a new topic.
86

97
*Incorrect:* `rpk topic create` creates a new topic.
108

11-
Similarly, do not start a sentence with a filename.
12-
13-
*Correct:* The `redpanda.yaml` file contains configuration parameters.
14-
15-
*Incorrect:* `redpanda.yaml` contains configuration parameters.
16-
17-
This version is correct because the sentence starts with the definite article, providing a descriptive context before introducing the xref.
9+
This is incorrect because the sentence is starting with a command / code in backticks.
1810

1911
*Correct:*
2012

@@ -30,4 +22,12 @@ The xref:api:ROOT:admin-api.adoc#get-/v1/broker/pre_restart_probe[`pre_restart_p
3022
xref:api:ROOT:admin-api.adoc#get-/v1/broker/pre_restart_probe[`pre_restart_probe`] is an endpoint.
3123
----
3224

33-
This version is incorrect because it starts directly with the xref. According to our style guidelines, sentences should not begin with a command, code snippet, or filename. Instead, the xref should be integrated into a descriptive sentence.
25+
== Rule: Do not start a sentence with a filename.
26+
27+
*Correct:* The `redpanda.yaml` file contains configuration parameters.
28+
29+
*Incorrect:* `redpanda.yaml` contains configuration parameters.
30+
31+
== Rule: Ignore AsciiDoc include directives
32+
33+
Do not make comments on lines that begin with `include::`. This notation inserts the content from another file.

.hyperlint/reviewer/custom-style-guide/styles.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
= Redpanda Data Documentation Style Guidelines
22

3-
=== Notes and warnings
3+
== Notes and warnings
44

5-
Redpanda product documentation uses AsciiDoc note and warning admonitions:
5+
Redpanda documentation uses AsciiDoc admonitions:
66

77
[cols="1,1",options="header"]
88
|===
@@ -28,7 +28,7 @@ For whole numbers between one and nine, spell out the number (for example, nine
2828
* *Correct:* To run Redpanda in a three-node cluster, use this command: `rpk container start -n 3`
2929
* *Incorrect:* To run Redpanda in a 3-node cluster, use this command: `rpk container start -n 3`
3030

31-
The exception to this is within code or when youre referring to a default value. For example:
31+
The exception to this is within code blocks or when you're referring to a default value. For example:
3232

3333
* *Correct:* cloud_storage_upload_ctrl_d_coeff - The derivative coefficient for the upload controller. Default is 0.
3434
* *Incorrect:* cloud_storage_upload_ctrl_d_coeff - The derivative coefficient for the upload controller. Default is zero.

.hyperlint/reviewer/vale-style-guide/.vale.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ BasedOnStyles = Vale, Google, CustomStyle
1414

1515
# Vale.Spelling = NO # comment this in to disable spelling checks
1616
# Vale.Terms = NO # comment this in to disable terms checks
17-
17+
# Disable this rule because Google wants level 1 headings to be in sentence case.
18+
Google.Headings = NO
19+
Google.WordList = NO
1820

1921
[asciidoctor]
2022
experimental = YES
2123
attribute-missing = drop
2224

2325
[*.adoc]
2426
# Put ASCIIDOC specific rules here
25-
# Disable this rule because Google wants level 1 headings to be in sentence case.
26-
disable = Google.Headings-warning

.hyperlint/reviewer/vale-style-guide/styles/CustomStyle/We.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extends: existence
2-
message: "Try to avoid using first-person plural like '%s'."
2+
message: "Try to avoid using first-person plural like '%s'. Instead use the first person singular, or rephrase the sentence to use Redpanda Data as the subject."
33
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
44
level: warning
55
ignorecase: true

0 commit comments

Comments
 (0)