Skip to content

Commit 8145283

Browse files
authored
fix: address Copilot code review feedback (#268)
1 parent 5c26ac0 commit 8145283

7 files changed

Lines changed: 13 additions & 22 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
},
99
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
1010
"typescript.tsc.autoDetect": "off",
11-
"i18n-ally.localesPaths": ["src/locales"]
11+
"i18n-ally.localesPaths": ["l10n"]
1212
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@
527527
"@types/mocha": "^10.0.1",
528528
"@types/node": "^20.0.0",
529529
"@types/sinon": "^10.0.13",
530-
"@types/vscode": "^1.110.0",
530+
"@types/vscode": "1.73.1",
531531
"@vscode/l10n-dev": "^0.0.35",
532532
"@vscode/test-electron": "^2.3.8",
533533
"dotenv": "^8.2.0",

package.nls.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"ext.config.ignoreAllWhiteSpaces.description": "Ignore all white space differences (similar to 'diff -w')",
1212
"ext.config.ignoreEmptyLines.description": "Ignore differences caused by empty lines (similar to 'diff -B')",
1313
"ext.config.ignoreFileNameCase.description": "If true fileName / FileName / FiLE naMe will consider as same file and will be compared",
14-
"ext.config.ignoreExtension.description": "Pairs of extensions to to considered the same file (.e.g [index.js, index.ts]). Each extension can appear **only once**",
14+
"ext.config.ignoreExtension.description": "Pairs of extensions to be considered the same file (e.g. [index.js, index.ts]). Each extension can appear **only once**",
1515
"ext.config.includeFilter.description": "Include filters",
1616
"ext.config.excludeFilter.description": "Exclude filters",
1717
"ext.config.respectGitIgnore.description": "Include / Exclude files based on .gitignore",
1818
"ext.config.diffViewTitle.enum.nameOnly": "eg. file-name.txt",
1919
"ext.config.diffViewTitle.enum.comparedPath": "eg. file-name.txt ↔ path/to/compared/file-name.txt",
2020
"ext.config.diffViewTitle.enum.fullPath": "eg. c://file-name.txt ↔ c://path/to/compared/file-name.txt",
21-
"ext.config.diffViewTitle.description": "Specifies how the diff view's title look like",
21+
"ext.config.diffViewTitle.description": "Specifies how the diff view's title looks",
2222
"ext.config.diffLayout.enum.localCompared": "eg. left: local file, right: compared file",
2323
"ext.config.diffLayout.enum.comparedLocal": "eg. left: compared file, right: local file",
2424
"ext.config.diffLayout.description": "Specifies which file will be in the left and the right sides of the diff view",

scripts/validate-l10n.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ function showExtractedStrings() {
165165
function checkHardcodedStrings() {
166166
console.log('🔎 Checking for hardcoded user-facing strings...\n');
167167

168-
const glob = require('child_process').execSync(
169-
'find ./src -name "*.ts" -not -path "*/test/*"',
170-
{ encoding: 'utf8' }
171-
).trim().split('\n').filter(Boolean);
168+
const glob = require('glob');
169+
const files = glob.sync('./src/**/*.ts', {
170+
ignore: ['**/test/**', '**/**.test.ts']
171+
});
172172

173173
const suspiciousPatterns = [
174174
// UI message functions with string literals (not using l10n.t)
@@ -182,7 +182,7 @@ function checkHardcodedStrings() {
182182

183183
const issues = [];
184184

185-
glob.forEach(file => {
185+
files.forEach(file => {
186186
const content = fs.readFileSync(file, 'utf8');
187187
const lines = content.split('\n');
188188

src/providers/foldersCompareProvider.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,6 @@ export class CompareFoldersProvider extends BaseViewProvider {
366366
}
367367
}
368368

369-
console.log(
370-
l10n.bundle,
371-
l10n.uri,
372-
l10n.t('Click to select folders'),
373-
)
374-
375369
const openFolderChild = (isSingle: boolean) =>
376370
new File({
377371
label: isSingle ? l10n.t('Click to select a folder') : l10n.t('Click to select folders'),

src/test/suite/mocks/treeView.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
EventEmitter,
33
type Event,
4-
type TreeCheckboxChangeEvent,
54
type TreeView,
65
type TreeViewExpansionEvent,
76
type TreeViewSelectionChangeEvent,
@@ -21,8 +20,6 @@ export class MockTreeView implements TreeView<File> {
2120
readonly onDidCollapseElement: Event<TreeViewExpansionEvent<File>> = new EventEmitter<TreeViewExpansionEvent<File>>().event;
2221
readonly onDidChangeSelection: Event<TreeViewSelectionChangeEvent<File>> = new EventEmitter<TreeViewSelectionChangeEvent<File>>().event;
2322
readonly onDidChangeVisibility: Event<TreeViewVisibilityChangeEvent> = new EventEmitter<TreeViewVisibilityChangeEvent>().event;
24-
readonly onDidChangeCheckboxState: Event<TreeCheckboxChangeEvent<File>> = new EventEmitter<TreeCheckboxChangeEvent<File>>().event;
25-
2623
reveal(): Thenable<void> {
2724
return Promise.resolve();
2825
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@
240240
resolved "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz"
241241
integrity sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==
242242

243-
"@types/vscode@^1.110.0":
244-
version "1.110.0"
245-
resolved "https://registry.npmjs.org/@types/vscode/-/vscode-1.110.0.tgz"
246-
integrity sha512-AGuxUEpU4F4mfuQjxPPaQVyuOMhs+VT/xRok1jiHVBubHK7lBRvCuOMZG0LKUwxncrPorJ5qq/uil3IdZBd5lA==
243+
"@types/vscode@1.73.1":
244+
version "1.73.1"
245+
resolved "https://registry.npmjs.org/@types/vscode/-/vscode-1.73.1.tgz"
246+
integrity sha512-eArfOrAoZVV+Ao9zQOCaFNaeXj4kTCD+bGS2gyNgIFZH9xVMuLMlRrEkhb22NyxycFWKV1UyTh03vhaVHmqVMg==
247247

248248
"@typespec/ts-http-runtime@^0.3.0", "@typespec/ts-http-runtime@^0.3.4":
249249
version "0.3.4"

0 commit comments

Comments
 (0)