diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 00000000..11e2e617 --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,38 @@ +name: Spellcheck + +on: + pull_request: + branches: [main] # Adjust branch name if needed + +jobs: + spellcheck: + name: Spell Check + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Run Spellcheck + run: | + bash scripts/spellcheck.sh + env: + TYPOS_CONFIG: _typos.toml + + - name: Commit Changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git diff-index --quiet HEAD || git commit -m "Auto spellcheck fixes" + if: success() + + - name: Push Changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000..aa838282 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,14 @@ +[files] +extend-exclude = [ + "*.json", + "*.js", + "*.ipynb", + "src/zenml/zen_stores/migrations/versions/", + "tests/unit/materializers/test_built_in_materializer.py", + "tests/integration/functional/cli/test_pipeline.py", + "src/zenml/zen_server/dashboard/", + "examples/llm_finetuning/lit_gpt/" +] + +[default] +locale = "en-us" diff --git a/requirements.in b/requirements.in index 35b2285a..151f0055 100644 --- a/requirements.in +++ b/requirements.in @@ -2,7 +2,7 @@ # NOTE: # Use Python 3.8 or greater which ever is the minimum version of the python # you plan on supporting when creating the environment or using pip-tools. -# Only run the commands below to manully upgrade packages in requirements.txt: +# Only run the commands below to manually upgrade packages in requirements.txt: # 1) python -m pip install pip-tools # 2) pip-compile --generate-hashes --resolver=backtracking --upgrade ./requirements.in # If you are using nox commands to setup or build package you don't need to diff --git a/scripts/spellcheck.sh b/scripts/spellcheck.sh new file mode 100644 index 00000000..1443aac2 --- /dev/null +++ b/scripts/spellcheck.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Location of the typos configuration file +TYPOS_CONFIG="_typos.toml" + +# Run typos command with appropriate options +typos --config "$TYPOS_CONFIG" --write-changes + +# Exit with the typos command's exit code +exit $? diff --git a/src/common/python.ts b/src/common/python.ts index 621e9f74..a61d1734 100644 --- a/src/common/python.ts +++ b/src/common/python.ts @@ -92,7 +92,7 @@ export function checkVersion(resolved: ResolvedEnvironment | undefined): boolean return false; } -export function isPythonVersonSupported(resolvedEnv: ResolvedEnvironment | undefined): { +export function isPythonVersionSupported(resolvedEnv: ResolvedEnvironment | undefined): { isSupported: boolean; message?: string; } { diff --git a/src/services/ZenExtension.ts b/src/services/ZenExtension.ts index 7d1f1f48..69f6cc73 100644 --- a/src/services/ZenExtension.ts +++ b/src/services/ZenExtension.ts @@ -22,7 +22,7 @@ import { registerLogger, traceLog, traceVerbose } from '../common/log/logging'; import { IInterpreterDetails, initializePython, - isPythonVersonSupported, + isPythonVersionSupported, onDidChangePythonInterpreter, resolveInterpreter, } from '../common/python'; @@ -132,7 +132,7 @@ export class ZenExtension { this.interpreterCheckInProgress = true; if (interpreterDetails.path) { const resolvedEnv = await resolveInterpreter(interpreterDetails.path); - const { isSupported, message } = isPythonVersonSupported(resolvedEnv); + const { isSupported, message } = isPythonVersionSupported(resolvedEnv); if (!isSupported) { vscode.window.showErrorMessage(`Interpreter not supported: ${message}`); this.interpreterCheckInProgress = false; diff --git a/src/test/python_tests/requirements.in b/src/test/python_tests/requirements.in index 15bbd40d..3d750c36 100644 --- a/src/test/python_tests/requirements.in +++ b/src/test/python_tests/requirements.in @@ -2,7 +2,7 @@ # NOTE: # Use Python 3.8 or greater which ever is the minimum version of the python # you plan on supporting when creating the environment or using pip-tools. -# Only run the commands below to manully upgrade packages in requirements.txt: +# Only run the commands below to manually upgrade packages in requirements.txt: # 1) python -m pip install pip-tools # 2) pip-compile --generate-hashes --upgrade ./src/test/python_tests/requirements.in # If you are using nox commands to setup or build package you don't need to diff --git a/src/types/StackTypes.ts b/src/types/StackTypes.ts index ca487dd5..5ada4087 100644 --- a/src/types/StackTypes.ts +++ b/src/types/StackTypes.ts @@ -42,6 +42,6 @@ interface StackComponent { type: string; } -export type StacksReponse = StacksData | ErrorMessageResponse | VersionMismatchError; +export type StacksResponse = StacksData | ErrorMessageResponse | VersionMismatchError; export { Stack, Components, StackComponent, StacksData }; diff --git a/src/views/activityBar/stackView/StackDataProvider.ts b/src/views/activityBar/stackView/StackDataProvider.ts index 51c1327a..b6a8ef56 100644 --- a/src/views/activityBar/stackView/StackDataProvider.ts +++ b/src/views/activityBar/stackView/StackDataProvider.ts @@ -14,7 +14,7 @@ import { Event, EventEmitter, TreeDataProvider, TreeItem, window, workspace } fr import { State } from 'vscode-languageclient'; import { EventBus } from '../../../services/EventBus'; import { LSClient } from '../../../services/LSClient'; -import { Stack, StackComponent, StacksReponse } from '../../../types/StackTypes'; +import { Stack, StackComponent, StacksResponse } from '../../../types/StackTypes'; import { ITEMS_PER_PAGE_OPTIONS, LSCLIENT_STATE_CHANGED, @@ -130,7 +130,7 @@ export class StackDataProvider implements TreeDataProvider { try { const lsClient = LSClient.getInstance(); - const result = await lsClient.sendLsClientRequest( + const result = await lsClient.sendLsClientRequest( 'fetchStacks', [page, itemsPerPage] );