Skip to content

Commit

Permalink
Use config from issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Dec 6, 2023
1 parent 4506b86 commit 61a1447
Show file tree
Hide file tree
Showing 11 changed files with 179 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ describe('Validate search/load config files', () => {
});

test.each`
dir | expectedImports
${new URL('issue-5034/cspell.json', urlIssues).href} | ${[oc({ filename: sm(/cspell.config.yaml/) }), oc({ filename: sm(/cspell-ext.json/) }), oc({ filename: sm(/cspell.json/) })]}
dir | expectedImports
${new URL('issue-5034/.cspell.json', urlIssues).href} | ${[oc({ filename: sm(/cspell-ext.json/) }), oc({ filename: sm(/.cspell.json/) })]}
`('Search and merge from $dir', async ({ dir, expectedImports }) => {
const loader = getDefaultConfigLoader();
const url = toFileUrl(dir);
Expand Down
10 changes: 5 additions & 5 deletions packages/cspell-lib/src/lib/util/resolveFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ describe('Validate resolveFile', () => {
const urlIssue5034 = new URL('issue-5034/', issuesFolderURL);

test.each`
filename | relativeTo | expected | found
${'./nested/cspell.config.yaml'} | ${urlIssue5034.href} | ${sm(/nested[/\\]cspell\.config\.yaml$/)} | ${true}
${'./nested/cspell.config.yaml'} | ${new URL('cspell.json', urlIssue5034).href} | ${sm(/nested[/\\]cspell\.config\.yaml$/)} | ${true}
${'./nested/cspell.config.yaml'} | ${fileURLToPath(urlIssue5034)} | ${sm(/nested[/\\]cspell\.config\.yaml$/)} | ${true}
${'./nested/node_modules/@cspell/dict-fr-fr/cspell-ext.json'} | ${urlIssue5034.href} | ${sm(/cspell-ext\.json$/)} | ${true}
filename | relativeTo | expected | found
${'./frontend/cfg/cspell.config.yaml'} | ${urlIssue5034.href} | ${sm(/cfg[/\\]cspell\.config\.yaml$/)} | ${true}
${'./frontend/cfg/cspell.config.yaml'} | ${new URL('cspell.json', urlIssue5034).href} | ${sm(/cfg[/\\]cspell\.config\.yaml$/)} | ${true}
${'./frontend/cfg/cspell.config.yaml'} | ${fileURLToPath(urlIssue5034)} | ${sm(/cfg[/\\]cspell\.config\.yaml$/)} | ${true}
${'./frontend/node_modules/@cspell/dict-fr-fr/cspell-ext.json'} | ${urlIssue5034.href} | ${sm(/cspell-ext\.json$/)} | ${true}
`('resolveFile $filename rel $relativeTo', async ({ filename, relativeTo, expected, found }) => {
const r = resolveFile(filename, relativeTo);
// console.error('r %o', r);
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ packages:
- "test-packages/*/*"
- "test-packages/*/*/bin"
- "test-packages/*/*/source"
- "test-fixtures/issues/issue-5034"
- "test-fixtures/issues/issue-5034/frontend"
- doc-generator
- integration-tests
- scripts
Expand Down
126 changes: 126 additions & 0 deletions test-fixtures/issues/issue-5034/.cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"version": "0.2",
"ignorePaths": [
".neoconf.json",
".vscode/settings.json",
".vim/coc-settings.json",
"frontend/node_modules/**",
"frontend/coverage/**",
"frontend/build/**",
"frontend/db/dist/**",
"frontend/package.json",
"frontend/public/locales/ar/**",
"frontend/public/locales/zgh/**",
"frontend/public/supportedBrowsers.js",
"docker-compose*.yml",
"cloudformation.yml",
"vendor",
"web/src/composer.json",
"web/src/vendor",
"web/src/shared/scripts",
"web/src/css",
"web/src/locales/ar/translations.yml",
"node/src/locales/ar.json",
"web/src/locales/zgh/translations.yml",
"web/src/api/Validation/lang/ar/validation.php",
".env",
"renovate.json",
"web/conf/**/*",
"*Dockerfile"
],
"allowCompoundWords": true,
"ignoreWords": [
"culturehq",
"yiisoft",
"lintstagedrc",
"rehype",
"noto",
"graphiql",
"webp"
],
"words": [
"AMZN",
"capce",
"cedata",
"crunz",
"cronitor",
"destructured",
"droppable",
"entityid",
"esetnik",
"esnext",
"falsey",
"Gravatar",
"hacky",
"Handtevy",
"hocs",
"iframe",
"imgix",
"immer",
"junit",
"jwplayer",
"JWPLAYER",
"Lngs",
"luxon",
"Maknz",
"Mebibytes",
"msodbcsql",
"newid",
"noopener",
"NREMT",
"nuka",
"oems",
"onstatechange",
"onupdatefound",
"phpcs",
"phpcbf",
"phuocng",
"recertification",
"reduxjs",
"resizer",
"signup",
"testid",
"tamazight",
"tifinagh",
"tsql",
"Tuupola",
"unmount",
"unregister",
"UPDLOCK",
"wdyr",
"xlarge"
],
"import": [
"./frontend/node_modules/@cspell/dict-fr-fr/cspell-ext.json"
],
"overrides": [
{
"filename": "**/*.md",
"language": "en,fr"
},
{
"filename": "**/locales/fr/**/{*.json,*.yml}",
"language": "en,fr"
},
{
"filename": "**/__test__/**",
"language": "en,fr"
},
{
"filename": "**/{*.test.ts,*.test.tsx}",
"language": "en,fr"
},
{
"filename": "**/Validation/lang/fr/validation.php",
"language": "en,fr"
},
{
"filename": "node/src/locales/fr.json",
"language": "en,fr"
},
{
"filename": "frontend/src/themes/*.json",
"languageId": "css"
}
]
}
6 changes: 0 additions & 6 deletions test-fixtures/issues/issue-5034/cspell.json

This file was deleted.

9 changes: 9 additions & 0 deletions test-fixtures/issues/issue-5034/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Read me

Related to [#5034](https://github.com/streetsidesoftware/cspell/issues/5034)

bon après-midi

<!---
cspell:language en,fr
--->
14 changes: 14 additions & 0 deletions test-fixtures/issues/issue-5034/frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "issue-5034-frontend",
"version": "2.34.4",
"private": true,
"dependencies": {},
"scripts": {
"spellcheck": "cspell -c '../.cspell.json' -r '..' --no-progress --dot --gitignore \"**/*.{js,jsx,ts,tsx,json,yml,md}\"",
"test": "pnpm run spellcheck"
},
"devDependencies": {
"@cspell/dict-fr-fr": "2.2.2",
"cspell": "workspace:*"
}
}

This file was deleted.

11 changes: 10 additions & 1 deletion test-fixtures/issues/issue-5034/package.json
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
{}
{
"name": "issue-5034",
"version": "2.34.4",
"private": true,
"dependencies": {},
"scripts": {
"test": "yarn --cwd frontend spellcheck"
},
"devDependencies": {}
}

0 comments on commit 61a1447

Please sign in to comment.