Skip to content

Commit f0c77d5

Browse files
chalincartermp
andauthored
Enable Prettier check over all remaining files (#2414)
Co-authored-by: Phillip Carter <[email protected]>
1 parent 7f1761c commit f0c77d5

File tree

397 files changed

+1911
-1284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

397 files changed

+1911
-1284
lines changed

.github/ISSUE_TEMPLATE/DOCS_UPDATE.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ about: You've found an issue with the documentation.
44
title: ''
55
labels: bug
66
assignees: ''
7-
87
---
98

10-
**What needs to be changed?**
11-
Describe the update that is required.
9+
**What needs to be changed?** Describe the update that is required.
1210

13-
**What is the name + path of the page that needs changed?**
14-
The relative path and page title where you found a problem.
11+
**What is the name + path of the page that needs changed?** The relative path
12+
and page title where you found a problem.
1513

16-
**Additional context**
17-
Anything else you can think about that would be helpful.
14+
**Additional context**: anything else you can think about that would be helpful.
1815

1916
_Please delete paragraphs that you did not use before submitting._

.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ about: For things we should add or change on the site.
44
title: ''
55
labels: feature request
66
assignees: ''
7-
87
---
98

10-
**Desired feature or idea.**
11-
What would you like to see happen?
9+
**Desired feature or idea**: What would you like to see happen?
1210

13-
**Additional context**
14-
Anything else you can think about that would be helpful.
11+
**Additional context**: anything else you can think about that would be helpful.
1512

1613
_Please delete paragraphs that you did not use before submitting._

.github/ISSUE_TEMPLATE/ISSUE_REPORT.md

+7-11
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,18 @@ about: For reporting a problem with the opentelemetry.io site.
44
title: ''
55
labels: bug
66
assignees: ''
7-
87
---
98

10-
**What happened?**
11-
Describe the problem that occurred.
9+
**What happened?** Describe the problem that occurred.
1210

13-
**What did you expect would happen?**
14-
Describe the expected result/output.
11+
**What did you expect would happen?** Describe the expected result/output.
1512

16-
**What is the name + path of the page where you encountered the issue?**
17-
The relative path and page title where you found a problem.
13+
**What is the name + path of the page where you encountered the issue?** The
14+
relative path and page title where you found a problem.
1815

19-
**What browser, OS, and platform were you using when you encountered the problem?**
20-
Please include the browser version if you know it as well.
16+
**What browser, OS, and platform were you using when you encountered the
17+
problem?** Include the browser version if you know it as well.
2118

22-
**Additional context**
23-
Anything else you can think about that would be helpful.
19+
**Additional context**: anything else you can think about that would be helpful.
2420

2521
_Please delete paragraphs that you did not use before submitting._
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
## Docs PR Checklist
2+
23
<!--- Just making sure... -->
3-
- [ ] This PR is for a documentation page whose authoritative copy is in the opentelemetry.io repository.
4+
5+
- [ ] This PR is for a documentation page whose authoritative copy is in the
6+
opentelemetry.io repository.

.github/dependabot.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
3+
- package-ecosystem: npm
4+
directory: /
55
schedule:
6-
interval: "weekly"
6+
interval: weekly

.github/workflows/auto-update-versions.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
schedule:
66
# hourly at minute 10
7-
- cron: "10 * * * *"
7+
- cron: 10 * * * *
88

99
jobs:
1010
auto-update-versions:

.prettierignore

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
# Base
22

33
/.netlify
4-
/.vscode
54
/iconography
65
/layouts
7-
package-lock.json
8-
/public
96
/themes
107
/tmp
118

12-
# Ignore content-modules except for Go docs
9+
# Ignore content-modules except for Community pages and Go docs
1310

1411
/content-modules/*
12+
!/content-modules/community
13+
/content-modules/community/*
14+
!/content-modules/community/mission-vision-values.md
15+
!/content-modules/community/roadmap.md
16+
1517
!/content-modules/opentelemetry-go
1618
/content-modules/opentelemetry-go/*
1719
!/content-modules/opentelemetry-go/website_docs
1820
/content-modules/opentelemetry-go/website_docs/**/*
1921
!/content-modules/opentelemetry-go/website_docs/**/*.md
2022

21-
# Temporary while we ramp up use of Prettier
23+
# Ignore generated resources
2224

23-
/.github
24-
/archetypes
25-
/assets/**/*.js
26-
/data
25+
package-lock.json
26+
/public
2727
/resources
28-
/scripts
29-
/templates

archetypes/blog.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ markdown formatter (see below).
2525
If you use images, make sure that your blog post is located in it's own
2626
directory. Put the images into the same directory.
2727

28-
If you have an image stored at
29-
`content/en/{{ .File.Dir }}imagename.png`,
30-
you can reference them like the following:
28+
If you have an image stored at `content/en/{{ .File.Dir }}imagename.png`, you
29+
can reference them like the following:
3130

3231
![Provide a good image description for improved accessibility](imagename.png)
3332

assets/js/registrySearch.js

+80-64
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,54 @@ let fuseOptions = {
99
maxPatternLength: 32,
1010
minMatchCharLength: 1,
1111
keys: [
12-
{ name: "title", weight: 0.8 },
13-
{ name: "description", weight: 0.5 },
14-
{ name: "tags", weight: 0.3 },
15-
{ name: "categories", weight: 0.3 },
12+
{ name: 'title', weight: 0.8 },
13+
{ name: 'description', weight: 0.5 },
14+
{ name: 'tags', weight: 0.3 },
15+
{ name: 'categories', weight: 0.3 },
1616
],
1717
};
1818

1919
// Get searchQuery for queryParams
2020
let pathName = window.location.pathname;
21-
let searchQuery = "";
22-
let selectedLanguage = "all";
23-
let selectedComponent = "all";
21+
let searchQuery = '';
22+
let selectedLanguage = 'all';
23+
let selectedComponent = 'all';
2424

2525
parseUrlParams();
2626

27-
if (pathName.includes("registry")) {
27+
if (pathName.includes('registry')) {
2828
// Run search or display default body
2929
if (searchQuery) {
30-
document.querySelector("#search-query").value = searchQuery;
31-
document.querySelector("#default-body").style.display = "none";
30+
document.querySelector('#search-query').value = searchQuery;
31+
document.querySelector('#default-body').style.display = 'none';
3232
executeSearch(searchQuery);
3333
} else {
34-
let defaultBody = document.querySelector("#default-body");
35-
if (defaultBody.style.display === "none") {
36-
defaultBody.style.display = "block";
34+
let defaultBody = document.querySelector('#default-body');
35+
if (defaultBody.style.display === 'none') {
36+
defaultBody.style.display = 'block';
3737
}
3838
}
3939

40-
if (selectedLanguage!=="all" || selectedComponent!== "all"){
41-
if (selectedLanguage!=="all"){
42-
document.getElementById('languageDropdown').textContent = document.getElementById(`language-item-${selectedLanguage}`).textContent;
40+
if (selectedLanguage !== 'all' || selectedComponent !== 'all') {
41+
if (selectedLanguage !== 'all') {
42+
document.getElementById('languageDropdown').textContent =
43+
document.getElementById(
44+
`language-item-${selectedLanguage}`
45+
).textContent;
4346
}
44-
if (selectedComponent!=="all"){
45-
document.getElementById('componentDropdown').textContent = document.getElementById(`component-item-${selectedComponent}`).textContent;
47+
if (selectedComponent !== 'all') {
48+
document.getElementById('componentDropdown').textContent =
49+
document.getElementById(
50+
`component-item-${selectedComponent}`
51+
).textContent;
4652
}
4753
updateFilters();
4854
}
4955
}
5056

5157
// Runs search through Fuse for fuzzy search
5258
function executeSearch(searchQuery) {
53-
fetch("/ecosystem/registry/index.json")
59+
fetch('/ecosystem/registry/index.json')
5460
.then((res) => res.json())
5561
.then((json) => {
5662
let fuse = new Fuse(json, fuseOptions);
@@ -59,8 +65,8 @@ function executeSearch(searchQuery) {
5965
if (results.length > 0) {
6066
populateResults(results);
6167
} else {
62-
document.querySelector("#search-results").innerHTML +=
63-
"<p>No matches found</p>";
68+
document.querySelector('#search-results').innerHTML +=
69+
'<p>No matches found</p>';
6470
}
6571
});
6672
}
@@ -69,16 +75,16 @@ function executeSearch(searchQuery) {
6975
function populateResults(results) {
7076
results.forEach((result, key) => {
7177
let contents = result.item.description;
72-
let snippet = "";
78+
let snippet = '';
7379
let snippetHighlights = [];
7480

7581
if (fuseOptions.tokenize) {
7682
snippetHighlights.push(searchQuery);
7783
} else {
7884
result.matches.forEach((match) => {
79-
if (match.key === "tags" || match.key === "categories") {
85+
if (match.key === 'tags' || match.key === 'categories') {
8086
snippetHighlights.push(match.value);
81-
} else if (match.key === "description") {
87+
} else if (match.key === 'description') {
8288
start =
8389
match.indices[0][0] - summaryInclude > 0
8490
? match.indices[0][0] - summaryInclude
@@ -103,8 +109,9 @@ function populateResults(results) {
103109
}
104110

105111
// Pull template from hugo template definition
106-
let templateDefinition = document.querySelector("#search-result-template")
107-
.innerHTML;
112+
let templateDefinition = document.querySelector(
113+
'#search-result-template'
114+
).innerHTML;
108115

109116
// Replace values from template with search results
110117
let output = render(templateDefinition, {
@@ -120,7 +127,7 @@ function populateResults(results) {
120127
snippet: snippet,
121128
otVersion: result.item.otVersion,
122129
});
123-
document.querySelector("#search-results").innerHTML += output;
130+
document.querySelector('#search-results').innerHTML += output;
124131
});
125132
}
126133

@@ -138,78 +145,87 @@ function render(templateString, data) {
138145
copy = copy.replace(conditionalMatches[0], conditionalMatches[2]);
139146
} else {
140147
//not valid, remove entire section
141-
copy = copy.replace(conditionalMatches[0], "");
148+
copy = copy.replace(conditionalMatches[0], '');
142149
}
143150
}
144151
templateString = copy;
145152

146153
//now any conditionals removed we can do simple substitution
147154
let key, find, re;
148155
for (key in data) {
149-
find = "\\$\\{\\s*" + key + "\\s*\\}";
150-
re = new RegExp(find, "g");
156+
find = '\\$\\{\\s*' + key + '\\s*\\}';
157+
re = new RegExp(find, 'g');
151158
templateString = templateString.replace(re, data[key]);
152159
}
153160
return templateString;
154161
}
155162

156-
if (pathName.includes("registry")) {
163+
if (pathName.includes('registry')) {
157164
document.addEventListener('DOMContentLoaded', (event) => {
158-
let languageList = document.getElementById('languageFilter').querySelectorAll('.dropdown-item')
159-
let typeList = document.getElementById('componentFilter').querySelectorAll('.dropdown-item')
160-
languageList.forEach((element) => element.addEventListener('click', function(evt) {
161-
let val = evt.target.getAttribute('value')
162-
selectedLanguage = val;
163-
document.getElementById('languageDropdown').textContent = evt.target.textContent;
164-
setInput("language", val);
165-
updateFilters();
166-
}))
167-
typeList.forEach((element) => element.addEventListener('click', function(evt) {
168-
let val = evt.target.getAttribute('value')
169-
selectedComponent = val;
170-
document.getElementById('componentDropdown').textContent = evt.target.textContent;
171-
setInput("component", val);
172-
updateFilters();
173-
}))
174-
})
165+
let languageList = document
166+
.getElementById('languageFilter')
167+
.querySelectorAll('.dropdown-item');
168+
let typeList = document
169+
.getElementById('componentFilter')
170+
.querySelectorAll('.dropdown-item');
171+
languageList.forEach((element) =>
172+
element.addEventListener('click', function (evt) {
173+
let val = evt.target.getAttribute('value');
174+
selectedLanguage = val;
175+
document.getElementById('languageDropdown').textContent =
176+
evt.target.textContent;
177+
setInput('language', val);
178+
updateFilters();
179+
})
180+
);
181+
typeList.forEach((element) =>
182+
element.addEventListener('click', function (evt) {
183+
let val = evt.target.getAttribute('value');
184+
selectedComponent = val;
185+
document.getElementById('componentDropdown').textContent =
186+
evt.target.textContent;
187+
setInput('component', val);
188+
updateFilters();
189+
})
190+
);
191+
});
175192
}
176193

177-
178-
function setInput(key, value){
194+
function setInput(key, value) {
179195
document.getElementById(`input-${key}`).value = value;
180196
var queryParams = new URLSearchParams(window.location.search);
181197
queryParams.set(key, value);
182-
history.replaceState(null, null, "?"+queryParams.toString());
198+
history.replaceState(null, null, '?' + queryParams.toString());
183199
}
184200

185201
// Filters items based on language and component filters
186202
function updateFilters() {
187-
let allItems = [...document.getElementsByClassName("media")];
188-
if (selectedComponent === "all" && selectedLanguage === "all") {
189-
allItems.forEach((element) => element.classList.remove("d-none"));
203+
let allItems = [...document.getElementsByClassName('media')];
204+
if (selectedComponent === 'all' && selectedLanguage === 'all') {
205+
allItems.forEach((element) => element.classList.remove('d-none'));
190206
} else {
191207
allItems.forEach((element) => {
192208
const dc = element.dataset.registrytype;
193209
const dl = element.dataset.registrylanguage;
194210
if (
195-
(dc === selectedComponent || selectedComponent === "all") &&
196-
(dl === selectedLanguage || selectedLanguage === "all")
211+
(dc === selectedComponent || selectedComponent === 'all') &&
212+
(dl === selectedLanguage || selectedLanguage === 'all')
197213
) {
198-
element.classList.remove("d-none");
214+
element.classList.remove('d-none');
199215
} else if (dc === selectedComponent && dl !== selectedLanguage) {
200-
element.classList.add("d-none");
216+
element.classList.add('d-none');
201217
} else if (dl === selectedLanguage && dc !== selectedComponent) {
202-
element.classList.add("d-none");
218+
element.classList.add('d-none');
203219
} else {
204-
element.classList.add("d-none");
220+
element.classList.add('d-none');
205221
}
206222
});
207223
}
208224
}
209225

210-
function parseUrlParams(){
226+
function parseUrlParams() {
211227
let urlParams = new URLSearchParams(window.location.search);
212-
searchQuery = urlParams.get("s");
213-
selectedLanguage = urlParams.get("language") || "all";
214-
selectedComponent = urlParams.get("component") || "all";
228+
searchQuery = urlParams.get('s');
229+
selectedLanguage = urlParams.get('language') || 'all';
230+
selectedComponent = urlParams.get('component') || 'all';
215231
}

0 commit comments

Comments
 (0)