Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spell Check added #20

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -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 }}
14 changes: 14 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -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/"
Comment on lines +3 to +10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need updating. They relate to the core ZenML package, not this repository.

]

[default]
locale = "en-us"
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions scripts/spellcheck.sh
Original file line number Diff line number Diff line change
@@ -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
Comment on lines +6 to +7
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't want to actually write changes. We just want to surface any errors for them to be manually corrected.


# Exit with the typos command's exit code
exit $?
2 changes: 1 addition & 1 deletion src/common/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
} {
Expand Down
4 changes: 2 additions & 2 deletions src/services/ZenExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { registerLogger, traceLog, traceVerbose } from '../common/log/logging';
import {
IInterpreterDetails,
initializePython,
isPythonVersonSupported,
isPythonVersionSupported,
onDidChangePythonInterpreter,
resolveInterpreter,
} from '../common/python';
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/test/python_tests/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/types/StackTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
4 changes: 2 additions & 2 deletions src/views/activityBar/stackView/StackDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -130,7 +130,7 @@ export class StackDataProvider implements TreeDataProvider<TreeItem> {

try {
const lsClient = LSClient.getInstance();
const result = await lsClient.sendLsClientRequest<StacksReponse>(
const result = await lsClient.sendLsClientRequest<StacksResponse>(
'fetchStacks',
[page, itemsPerPage]
);
Expand Down