Skip to content

Commit be54d6b

Browse files
authored
[infra] Move en words into separate word list, set up lists for es and pt (#5011)
1 parent 3c3342e commit be54d6b

7 files changed

+179
-150
lines changed

.cspell.yml

+21-138
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ ignorePaths:
1212
- vendors.yaml
1313
- content/ja
1414
- content/zh
15-
# words here are only listed for their spelling, if there is a certain way
16-
# to write a word (e.g. OpenTelemetry vs Opentelemetry or cloud native vs
17-
# cloud-native), edit the text-lint rules in .textlintrc.yml
1815
patterns:
1916
- name: CodeBlock
2017
pattern: |
@@ -28,140 +25,26 @@ languageSettings:
2825
- languageId: markdown
2926
ignoreRegExpList:
3027
- CodeBlock
28+
dictionaryDefinitions:
29+
- name: en-words
30+
path: .cspell/en-words.txt
31+
- name: es-palabras
32+
path: .cspell/es-palabras.txt
33+
- name: pt-palavras
34+
path: .cspell/pt-palavras.txt
3135
dictionaries:
32-
[pt-br, es-es, companies, cpp, dotnet, golang, node, softwareTerms]
33-
words:
34-
- accountingservice
35-
- actix
36-
- adservice
37-
- alibaba
38-
- Alolita
39-
- APAC
40-
- appdynamics
41-
- appender
42-
- appenders
43-
- aspecto
44-
- autoconfiguration
45-
- autoinstrumentation
46-
- autoloaded
47-
- autoloader
48-
- autoloading
49-
- backoff
50-
- caml
51-
- cartservice
52-
- cassandra
53-
- checkoutservice
54-
- Chronosphere
55-
- classpath
56-
- cncf
57-
- currencyservice
58-
- daemonset
59-
- datadog
60-
- discoverability
36+
# Natural languages
37+
- es-es
38+
- pt-br
39+
# Local word lists
40+
- en-words
41+
- es-palabras
42+
- pt-palavras
43+
# Programming languages and software terms
44+
- cpp
6145
- dotnet
62-
- Dyla
63-
- dynatrace
64-
- emailservice
65-
- EMEA
66-
- erlang
67-
- errorf
68-
- featureflagservice
69-
- frauddetectionservice
70-
- frontendproxy
71-
- github
72-
- gitpod
73-
- grafana
74-
- Hausenblas
75-
- hugo
76-
- initializers
77-
- instana
78-
- istio
79-
- jaeger
80-
- jaegertracing
81-
- javaagent
82-
- javadoc
83-
- jboss
84-
- jdbc
85-
- julia
86-
- Juraci
87-
- knative
88-
- kotlin
89-
- Kröhling
90-
- kubecon
91-
- kubernetes
92-
- laravel
93-
- lifecycles
94-
- lightstep
95-
- Loffay
96-
- Mancuso
97-
- microservices
98-
- mongodb
99-
- ndjson
100-
- Neumann
101-
- nginx
102-
- ocaml
103-
- opamp
104-
- opencensus
105-
- opensearch
106-
- opentelemetry
107-
- opentracing
108-
- openzipkin
109-
- OSTIF
110-
- otel
111-
- otel-comms
112-
- otel-endusers
113-
- otelcol
114-
- otep
115-
- otlp
116-
- packagist
117-
- pageinfo
118-
- Paixão
119-
- parentbased
120-
- Pavol
121-
- paymentservice
122-
- postgresql
123-
- Pranay
124-
- Prateek
125-
- prepper
126-
- productcatalogservice
127-
- prometheus
128-
- proto
129-
- protobuf
130-
- quantile
131-
- quantiles
132-
- quarkus
133-
- quoteservice
134-
- recommendationservice
135-
- redis
136-
- relref
137-
- Rexed
138-
- Rynn
139-
- semconv
140-
- servlet
141-
- Severin
142-
- Sharma
143-
- shippingservice
144-
- Socha
145-
- Stalnaker
146-
- stdoutmetric
147-
- Strimzi
148-
- symfony
149-
- tabpane
150-
- textlint
151-
- thanos
152-
- tocstop
153-
- tracecontext
154-
- traceidratio
155-
- traceloop
156-
- traceparent
157-
- traefik
158-
- Trask
159-
- uids
160-
- unsampled
161-
- unshallow
162-
- upstreamed
163-
- Villela
164-
- wordpress
165-
- WSGI
166-
- zend
167-
- zipkin
46+
- golang
47+
- node
48+
- softwareTerms
49+
# Other
50+
- companies

.cspell/en-words.txt

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Words listed here are only for their spelling. If there is a certain way to
2+
# capitalize the word, add capitalization rules to text-lint rules in
3+
# .textlintrc.yml
4+
5+
accountingservice
6+
actix
7+
adservice
8+
alibaba
9+
Alolita
10+
APAC
11+
appdynamics
12+
appender
13+
appenders
14+
aspecto
15+
autoconfiguration
16+
autoinstrumentation
17+
autoloaded
18+
autoloader
19+
autoloading
20+
backoff
21+
caml
22+
cartservice
23+
cassandra
24+
checkoutservice
25+
Chronosphere
26+
classpath
27+
cncf
28+
currencyservice
29+
daemonset
30+
datadog
31+
discoverability
32+
dotnet
33+
Dyla
34+
dynatrace
35+
emailservice
36+
EMEA
37+
erlang
38+
errorf
39+
featureflagservice
40+
frauddetectionservice
41+
frontendproxy
42+
github
43+
gitpod
44+
grafana
45+
Hausenblas
46+
hugo
47+
initializers
48+
instana
49+
istio
50+
jaeger
51+
jaegertracing
52+
javaagent
53+
javadoc
54+
jboss
55+
jdbc
56+
julia
57+
Juraci
58+
knative
59+
kotlin
60+
Kröhling
61+
kubecon
62+
kubernetes
63+
laravel
64+
lifecycles
65+
lightstep
66+
Loffay
67+
Mancuso
68+
microservices
69+
mongodb
70+
ndjson
71+
Neumann
72+
nginx
73+
ocaml
74+
opamp
75+
opencensus
76+
opensearch
77+
opentelemetry
78+
opentracing
79+
openzipkin
80+
OSTIF
81+
otel
82+
otel-comms
83+
otel-endusers
84+
otelcol
85+
otep
86+
otlp
87+
packagist
88+
pageinfo
89+
Paixão
90+
parentbased
91+
Pavol
92+
paymentservice
93+
postgresql
94+
Pranay
95+
Prateek
96+
prepper
97+
productcatalogservice
98+
prometheus
99+
proto
100+
protobuf
101+
quantile
102+
quantiles
103+
quarkus
104+
quoteservice
105+
recommendationservice
106+
redis
107+
relref
108+
Rexed
109+
Rynn
110+
semconv
111+
servlet
112+
Severin
113+
Sharma
114+
shippingservice
115+
Socha
116+
Stalnaker
117+
stdoutmetric
118+
Strimzi
119+
symfony
120+
tabpane
121+
textlint
122+
thanos
123+
tocstop
124+
tracecontext
125+
traceidratio
126+
traceloop
127+
traceparent
128+
traefik
129+
Trask
130+
uids
131+
unsampled
132+
unshallow
133+
upstreamed
134+
Villela
135+
wordpress
136+
WSGI
137+
zend
138+
zipkin

.cspell/es-palabras.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
observabilidad
2+
telemetría

.cspell/pt-palavras.txt

Whitespace-only changes.

content/es/_index.md

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ developer_note:
99
de imagen que contenga la palabra "background" en su nombre.
1010
show_banner: true
1111
default_lang_commit: 7ac35d6b429165bbe6c28bdd91feeae83fd35142
12-
cSpell:ignore: observabilidad telemetría
1312
---
1413

1514
<div class="d-none"><a rel="me" href="https://fosstodon.org/@opentelemetry"></a></div>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"diff:check": "npm run _diff:check || (echo; echo 'WARNING: the files above have not been committed'; echo)",
6262
"diff:fail": "npm run _diff:check || (echo; echo 'ERROR: the files above have changed. Locally rerun `npm run test-and-fix` and commit changes'; echo; exit 1)",
6363
"fix:all": "npm run seq -- $(npm -s run _list:fix:*)",
64-
"fix:dict": "find content layouts -name \"*.md\" -print0 | xargs -0 scripts/normalize-cspell-front-matter.pl",
64+
"fix:dict": "find content/en layouts -name \"*.md\" -print0 | xargs -0 scripts/normalize-cspell-front-matter.pl",
6565
"fix:filenames": "npm run _rename-to-kebab-case",
6666
"fix:format": "npm run format",
6767
"fix:i18n:all": "scripts/check-i18n.sh -a -c HEAD",

scripts/normalize-cspell-front-matter.pl

+17-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
my $lineLenLimit = 79;
99
my $last_file = '';
1010
my $last_line = '';
11-
my %dictionary = getSiteWideDictWords('.cspell.yml', '.textlintrc.yml');
11+
my %dictionary = getSiteWideDictWords('.cspell/en-words.txt', '.textlintrc.yml');
1212

1313
while (<>) {
1414
if (/^\s*(spelling: |-\s*)?cSpell:ignore:?\s*(.*)$/
@@ -43,15 +43,16 @@ sub getSiteWideDictWords {
4343
my $dictionary_file = shift;
4444
my $textlintrc_file = shift;
4545

46-
my %dictionary = readYmlListOfWords('words', $dictionary_file);
47-
my %textlintDictionary = readYmlListOfWords('terms', $textlintrc_file);
46+
my %dictionary = readYmOrPlainlListOfWords('', $dictionary_file);
47+
my %textlintDictionary = readYmOrPlainlListOfWords('terms', $textlintrc_file);
4848
# Merge dictionaries
4949
@dictionary{keys %textlintDictionary} = values %textlintDictionary;
5050

5151
return %dictionary;
5252
}
5353

54-
sub readYmlListOfWords {
54+
sub readYmOrPlainlListOfWords {
55+
# Read plain list of words if $wordsFieldName is empty
5556
my $wordsFieldName = shift;
5657
my $file_path = shift;
5758
my $fh = FileHandle->new($file_path, "r") or die "Could not open file '$file_path': $!";
@@ -60,18 +61,24 @@ sub readYmlListOfWords {
6061

6162
my %dictionary;
6263
my $indentation = '';
63-
my $in_terms = 0;
64+
my $in_terms = $wordsFieldName eq '' ? 1 : 0;
6465
foreach my $line (@lines) {
6566
chomp $line;
66-
if ($line =~ /^(\s*)$wordsFieldName:/) {
67-
$indentation = $1 || '';
67+
next if $line =~ /^\s*#|^\s*$/;
68+
# print "> $line\n" if $wordsFieldName;
69+
70+
if ($wordsFieldName && $line =~ /^(\s*)$wordsFieldName:/) {
71+
$indentation = "$1 - " || '';
6872
$in_terms = 1;
69-
# print STDOUT "Found terms!";
70-
} elsif ($line =~ /^$indentation - (\w[^\s]*)$/ && $in_terms) {
73+
# print "> FOUND $wordsFieldName keyword\n"
74+
} elsif ($line =~ /^$indentation(\w[^\s]*)$/ && $in_terms) {
7175
my $term = $1;
7276
$dictionary{$term} = 1 if $term;
73-
} elsif ($line !~ /^ / && $in_terms) {
77+
} elsif ($wordsFieldName && $line !~ /^ / && $in_terms) {
7478
$in_terms = 0;
79+
# print "FINISHE word list\n" if $in_terms;
80+
} else {
81+
# print "OOPS LINE DID NOT MATCH\n" if $in_terms;
7582
}
7683
}
7784

0 commit comments

Comments
 (0)