Skip to content

Commit

Permalink
Include all project files
Browse files Browse the repository at this point in the history
  • Loading branch information
marwan37 committed Apr 5, 2024
1 parent e5b5b1b commit 9d091a6
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ jobs:
node-version: '18.x'

- name: Install dependencies
run: npm install
run: |
npm install
pip install autoflake isort black ruff
- name: Build VSCode Extension
run: npm run compile

- name: Run VSCode Extension Formatter
run: npm run format
run: ./scripts/format.sh

- name: Run VSCode Extension Linter
run: npm run lint
run: ./scripts/lint.sh

- name: Run headless test
uses: coactions/setup-xvfb@v1
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 20.10.0
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extension.description": "Integrates ZenML directly into VS Code, enhancing machine learning workflow with support for pipelines, stacks, and server management.",
"zenml.promptForInterpreter": "Prompt to select a Python interpreter from the command palette in VSCode.",
"command.promptForInterpreter": "Prompt to select a Python interpreter from the command palette in VSCode.",
"command.connectServer": "Establishes a connection to a specified ZenML server.",
"command.disconnectServer": "Disconnects from the currently connected ZenML server.",
"command.refreshServerStatus": "Refreshes the status of the ZenML server to reflect the current state.",
Expand Down
5 changes: 2 additions & 3 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ find $python_src -name "*.py" -print0 | xargs -0 autoflake --in-place --remove-a
find $python_src -name "*.py" -print0 | xargs -0 isort --
find $python_src -name "*.py" -print0 | xargs -0 black --line-length 100 --

# For now, Typescript formatting is separate from Python
# echo "Formatting TypeScript files..."
# npx prettier --ignore-path .gitignore --write "**/*.+(ts|json)"
echo "Formatting TypeScript files..."
npx prettier --ignore-path .gitignore --write "**/*.+(ts|json)"

echo "Formatting complete."
3 changes: 2 additions & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euxo pipefail

cd "$(dirname "$0")/.." || exit

Expand All @@ -11,6 +12,6 @@ ruff bundled/tool || { echo "Linting Python files failed"; exit 1; }

# Lint TypeScript files with eslint
echo "Linting TypeScript files..."
eslint 'src/**/*.ts'
npx eslint 'src/**/*.ts' || { echo "Linting TypeScript files failed"; exit 1; }

unset PYTHONPATH
4 changes: 3 additions & 1 deletion src/services/ZenExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ export class ZenExtension {
return;
}

ZenMLStatusBar.getInstance();
const zenmlStatusBar = ZenMLStatusBar.getInstance();
zenmlStatusBar.registerCommand();

this.dataProviders.forEach((provider, viewId) => {
const view = vscode.window.createTreeView(viewId, { treeDataProvider: provider });
this.viewDisposables.push(view);
Expand Down
6 changes: 4 additions & 2 deletions src/views/statusBar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ export default class ZenMLStatusBar {
constructor() {
this.statusBarItem = window.createStatusBarItem(StatusBarAlignment.Right, 100);
this.subscribeToEvents();
this.statusBarItem.command = 'zenml/statusBar/switchStack';
}

this.statusBarItem.command = 'zenml.switchStack';
commands.registerCommand('zenml.switchStack', () => this.switchStack());
public registerCommand() {
commands.registerCommand('zenml/statusBar/switchStack', () => this.switchStack());
}

/**
Expand Down

0 comments on commit 9d091a6

Please sign in to comment.