Skip to content

Commit

Permalink
Add spell check with CSpell (#370)
Browse files Browse the repository at this point in the history
Spell check all files with CSpell. Should prevent typos, which can be
cumbersome for both parties during code review.
  • Loading branch information
johnnyomair authored Oct 16, 2024
1 parent aa661fc commit 656cb7e
Show file tree
Hide file tree
Showing 28 changed files with 7,466 additions and 349 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In use by `@comet/create-app` to create new Comet DXP projects. Find more inform
### Installation

// Optionally set domain to use instead of localhost (add to ~/.bashrc)
export DEV_DOMAIN=myname.dev.vivid-planet.cloud // Vivid Planet network
export DEV_DOMAIN=my-name.dev.vivid-planet.cloud // Vivid Planet network

// Execute following script
./install.sh
Expand Down
4 changes: 2 additions & 2 deletions admin/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "@comet/eslint-config/react",
"ignorePatterns": ["schema.json", "src/fragmentTypes.json", "src/**/*.generated.ts"],
"extends": ["@comet/eslint-config/react", "plugin:@cspell/recommended"],
"ignorePatterns": ["schema.json", "src/fragmentTypes.json", "src/**/*.generated.ts", "src/site-configs.d.ts"],
"rules": {
"react/react-in-jsx-scope": "off"
}
Expand Down
13 changes: 13 additions & 0 deletions admin/cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: "0.2"
dictionaryDefinitions:
- name: project-words
path: "./project-words.txt"
addWords: true
dictionaries:
- project-words
ignorePaths:
- "node_modules"
- "/project-words.txt"
- "**/*.generated.ts"
1,588 changes: 1,502 additions & 86 deletions admin/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"@comet/cli": "^7.5.0",
"@comet/eslint-config": "^7.5.0",
"@comet/eslint-plugin": "^7.5.0",
"@cspell/eslint-plugin": "^8.15.2",
"@formatjs/cli": "^6.0.0",
"@graphql-codegen/add": "^3.0.0",
"@graphql-codegen/cli": "^2.0.0",
Expand All @@ -81,6 +82,7 @@
"@types/react-router-dom": "^5.1.7",
"@vitejs/plugin-react-swc": "^3.7.0",
"chokidar-cli": "^3.0.0",
"cspell": "^8.14.4",
"dotenv-cli": "^7.0.0",
"eslint": "^8.0.0",
"npm-run-all": "^4.1.5",
Expand Down
4 changes: 4 additions & 0 deletions admin/project-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
imgproxy
pagetree
prelogin
rdndmb
2 changes: 1 addition & 1 deletion admin/src/common/ContentScopeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@comet/cms-admin";
import { ContentScope } from "@src/site-configs";

// convenince wrapper for app (Bind Generic)
// convenience wrapper for app (Bind Generic)
export function useContentScope(): UseContentScopeApi<ContentScope> {
return useContentScopeLibrary<ContentScope>();
}
Expand Down
3 changes: 2 additions & 1 deletion api/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"extends": "@comet/eslint-config/nestjs"
"extends": ["@comet/eslint-config/nestjs", "plugin:@cspell/recommended"],
"ignorePatterns": ["src/site-configs.d.ts"]
}
12 changes: 12 additions & 0 deletions api/cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: "0.2"
dictionaryDefinitions:
- name: project-words
path: "./project-words.txt"
addWords: true
dictionaries:
- project-words
ignorePaths:
- "node_modules"
- "/project-words.txt"
1,605 changes: 1,520 additions & 85 deletions api/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"@comet/cli": "^7.5.0",
"@comet/eslint-config": "^7.5.0",
"@comet/eslint-plugin": "^7.5.0",
"@cspell/eslint-plugin": "^8.15.2",
"@nestjs/cli": "^9.0.0",
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
Expand All @@ -98,6 +99,7 @@
"@types/jest": "^27.0.0",
"@types/node": "^20.0.0",
"@types/uuid": "^8.3.0",
"cspell": "^8.14.4",
"dotenv-cli": "^7.0.0",
"eslint": "^8.19.0",
"jest-junit": "^13.2.0",
Expand Down
8 changes: 8 additions & 0 deletions api/project-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
authproxy
imgproxy
mikro
nowait
ormconfig
pkey
schemaname
tablename
14 changes: 7 additions & 7 deletions api/src/db/migrate.console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ export class MigrateConsole {
);

let lockTries = 0;
let lockAquired = false;
while (!lockAquired) {
let lockAcquired = false;
while (!lockAcquired) {
try {
// we lock in exclusive mode, so any other transactions fails immediatly (NOWAIT)
// we lock in exclusive mode, so any other transactions fails immediately (NOWAIT)
// lock gets automatically released on commit or rollback
await connection.execute(
`LOCK TABLE "MigrationsLock" IN EXCLUSIVE MODE NOWAIT`,
undefined,
undefined,
em.getTransactionContext(),
);
lockAquired = true;
lockAcquired = true;
} catch (error) {
await em.rollback();
this.logger.warn(error);
this.logger.warn(`Cannot aquire lock for table MigrationsLock (try ${++lockTries})`);
this.logger.warn(`Cannot acquire lock for table MigrationsLock (try ${++lockTries})`);
if (lockTries > 3600) {
this.logger.error(`Giving up...`);
throw new Error("Could not aquire lock for table MigrationsLocks");
throw new Error("Could not acquire lock for table MigrationsLocks");
}
await this.sleep(1);
await em.begin(em.getTransactionContext());
Expand All @@ -74,7 +74,7 @@ export class MigrateConsole {
this.logger.error(error);
await em.rollback();

// we need to fail with non-zero exit-code, so migrations will be retried by kubernetes with exponantial back-off
// we need to fail with non-zero exit-code, so migrations will be retried by kubernetes with exponential back-off
process.exit(-1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion create-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["@comet/eslint-config/nestjs"],
"extends": ["@comet/eslint-config/nestjs", "plugin:@cspell/recommended"],
"rules": {
"@comet/no-other-module-relative-import": "off"
}
Expand Down
12 changes: 12 additions & 0 deletions create-app/cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: "0.2"
dictionaryDefinitions:
- name: project-words
path: "./project-words.txt"
addWords: true
dictionaries:
- project-words
ignorePaths:
- "node_modules"
- "/project-words.txt"
Loading

0 comments on commit 656cb7e

Please sign in to comment.