Skip to content

Commit 72212b4

Browse files
authored
[CI] Enforce no-trailing-spaces (open-telemetry#6145)
1 parent d0dee50 commit 72212b4

File tree

11 files changed

+45
-26
lines changed

11 files changed

+45
-26
lines changed

.editorconfig

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ root = true
33
[*]
44
end_of_line = lf
55
insert_final_newline = true
6-
7-
[Makefile]
8-
indent_style = tab
6+
trim_trailing_whitespace = true
97

108
[*.{html,js,json,md,sass,yaml}]
119
indent_style = space
1210
indent_size = 2
11+
12+
[Makefile]
13+
indent_style = tab

.markdownlint.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
"no-hard-tabs": false,
88
"no-inline-html": false,
99
"no-trailing-punctuation": false,
10-
"no-trailing-spaces": true,
10+
"no-trailing-spaces": {
11+
"br_spaces": 0,
12+
"strict": true
13+
},
1114
"custom-rules-below-this-point": false,
1215
"trim-code-block-and-unindent": true
1316
}

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
!/layouts/shortcodes/es
1111
!/layouts/shortcodes/pt
1212

13+
/content/en/blog/2019
14+
/content/en/blog/202[23]
15+
1316
/content/ja
1417
/content/zh
1518

content/en/blog/2024/otel-governance/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ act as a liaison between those SIGs and the GC. Once a month, I ask SIG
109109
maintainers from Collector, Operator, Security, and Go Autoinstrumentation
110110
questions, such as:
111111

112-
1\. Do you have any specific issues within your SIG that would require GC
113-
intervention?
114-
2\. Are you happy with the current balance of
115-
contributors/triagers/approvers/maintainers?
116-
3\. What’s one thing the GC can help with to make your life easier?
112+
1. Do you have any specific issues within your SIG that would require GC
113+
intervention?
114+
2. Are you happy with the current balance of
115+
contributors/triagers/approvers/maintainers?
116+
3. What’s one thing the GC can help with to make your life easier?
117117

118118
These responses are confidential, and maintainers know they can approach me with
119119
any problems, like when there’s a conflict between community members. While I

content/en/docs/contributing/style-guide.md

+17-10
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,17 @@ properly.
6060
## Markdown standards
6161

6262
To enforce standards and consistency for Markdown files, all files should follow
63-
certain rules, enforced by
64-
[markdownlint](https://github.com/DavidAnson/markdownlint). For a full list,
65-
check the
66-
[`.markdownlint.json`](https://github.com/open-telemetry/opentelemetry.io/blob/main/.markdownlint.json)
67-
file.
63+
certain rules, enforced by [markdownlint]. For a full list, check the
64+
[.markdownlint.json] file.
65+
66+
Run:
6867

69-
Run `npm run check:markdown` to verify that all files follow the standard.
68+
- `npm run check:markdown` to ensure that all files follow our standards
69+
- `npm run fix:markdown` to fix Markdown-related formatting issues
7070

71-
Run `npm run fix:markdown` to fix Markdown related formatting issues.
71+
We also enforce markdown [file format](#file-format) and strip files of trailing
72+
whitespace. This precludes the [line break syntax] of 2+ spaces; use `<br>`
73+
instead or reformat your text.
7274

7375
## Spell checking
7476

@@ -107,12 +109,17 @@ run `npm run fix:dict`.
107109

108110
## File format
109111

110-
To enforce a certain standard on how files are structured, all files should be
111-
formatted by [prettier](https://prettier.io). Run `npm run fix:format` before
112-
submitting a PR, or run it afterwards and push an additional commit.
112+
We enforce file formatting using [Prettier]. Invoke it using
113+
`npm run fix:format`.
113114

114115
## File names
115116

116117
All file names should be in
117118
[kebab case](https://en.wikipedia.org/wiki/Letter_case#Kebab_case). Run
118119
`npm run fix:filenames` to automatically rename your files.
120+
121+
[.markdownlint.json]:
122+
https://github.com/open-telemetry/opentelemetry.io/blob/main/.markdownlint.json
123+
[line break syntax]: https://www.markdownguide.org/basic-syntax/#line-breaks
124+
[markdownlint]: https://github.com/DavidAnson/markdownlint
125+
[Prettier]: https://prettier.io

content/en/docs/kubernetes/operator/target-allocator.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ spec:
5353
replacement: $$1
5454
- action: labelmap
5555
regex: label_(.+)
56-
replacement: $$1
56+
replacement: $$1
5757
5858
exporters:
5959
# NOTE: Prior to v0.86.0 use `logging` instead of `debug`.

content/es/docs/what-is-opentelemetry.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ puede extender incluyen:
102102
- Cargar librerías de instrumentación personalizadas en un SDK.
103103
- Crear una [distribución](/docs/concepts/distributions/) de un SDK o Collector
104104
adaptada a un caso de uso específico.
105-
- Crear un nuevo exportador para un backend personalizado que aún no admite el
105+
- Crear un nuevo exportador para un backend personalizado que aún no admite el
106106
protocolo OpenTelemetry (OTLP).
107107
- Crear un propagador personalizado para un formato de propagación de contexto
108108
que no es estándar.

content/pt/docs/languages/js/getting-started/browser.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Copie o conteúdo a seguir em um arquivo em um diretório vazio e salve-o como
3838
<base href="/" />
3939
<!--
4040
https://www.w3.org/TR/trace-context/
41-
Defina o `traceparent` no código do template HTML do servidor. Ele
41+
Defina o `traceparent` no código do template HTML do servidor. Ele
4242
deve ser gerado dinamicamente pelo servidor para conter o ID do rastro
4343
da requisição do servidor, um ID de trecho pai que foi definido no trecho
4444
da requisição do servidor e as flags de rastro para indicar a decisão de

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"_diff:fail": "git diff --name-only --exit-code || exit 1",
2323
"_fail": "exit 1",
2424
"_filename-error": "echo 'ERROR: the following files violate naming conventions; fix using: `npm run fix:filenames`'; echo; npm run -s _ls-bad-filenames; exit 1",
25+
"_fix:trailing-spaces": "find content -name '*.md' -exec perl -i -pe 's/[ \t]+$//g' {} +",
2526
"_get:no": "echo SKIPPING get operation",
2627
"_get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 999}",
2728
"_hugo": "hugo --cleanDestinationDir",
@@ -68,15 +69,15 @@
6869
"fix:dict": "find content layouts -name \"*.md\" -print0 | xargs -0 scripts/normalize-cspell-front-matter.pl",
6970
"fix:expired": "npm run -s check:expired -- -q | xargs -r -I {} sh -c 'echo \"Deleting expired file: {}\" && rm {}'",
7071
"fix:filenames": "npm run _rename-to-kebab-case",
71-
"fix:format": "npm run format",
72+
"fix:format": "npm run format; npm run _fix:trailing-spaces",
7273
"fix:htmltest-config": "scripts/htmltest-config.sh",
7374
"fix:i18n:all": "scripts/check-i18n.sh -a -c HEAD",
7475
"fix:i18n:drifted": "scripts/check-i18n.sh -c HEAD",
7576
"fix:i18n:new": "scripts/check-i18n.sh -n -c HEAD",
7677
"fix:i18n": "npm run fix:i18n:new",
77-
"fix:markdown": "npm run check:markdown -- --fix",
78-
"fix:refcache": "npm run check:links",
78+
"fix:markdown": "npm run check:markdown -- --fix; echo '\nTrimming trailing whitespace'; npm run _fix:trailing-spaces",
7979
"fix:refcache:refresh": "npm run _refcache:prune -- -n ${PRUNE_N:-128}",
80+
"fix:refcache": "npm run check:links",
8081
"fix:submodule": "npm run pin:submodule",
8182
"fix:text": "npm run check:text -- --fix",
8283
"fix": "npm run fix:all",

scripts/check-markdown-wrapper.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ for symlink_target in $symlink_targets; do
1313
done
1414

1515
set -x
16-
exec npm run _check:markdown "$@"
16+
exec npm run _check:markdown -- "$@"

static/refcache.json

+4
Original file line numberDiff line numberDiff line change
@@ -18907,6 +18907,10 @@
1890718907
"StatusCode": 206,
1890818908
"LastSeen": "2025-01-06T11:32:39.303245-05:00"
1890918909
},
18910+
"https://www.markdownguide.org/basic-syntax/#line-breaks": {
18911+
"StatusCode": 206,
18912+
"LastSeen": "2025-01-31T10:25:48.883033-05:00"
18913+
},
1891018914
"https://www.mathworks.com/matlabcentral/fileexchange/130979-opentelemetry-matlab": {
1891118915
"StatusCode": 200,
1891218916
"LastSeen": "2025-01-30T21:55:43.614Z"

0 commit comments

Comments
 (0)