From 0a2d9eb6a0f9e6be257545a1fecab948a76ffefc Mon Sep 17 00:00:00 2001 From: Petar Vasilev Date: Fri, 25 Sep 2026 01:08:19 +0100 Subject: [PATCH 1/5] Add Python virtual environment setup and linting tools --- .gitignore | 1 + package.json | 3 +++ requirements-dev.txt | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 requirements-dev.txt diff --git a/.gitignore b/.gitignore index 2a95f1c..3cb9f9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ gradienttopbar@pshow.org.shell-extension.zip node_modules +.venv .idea/ .yarn/* diff --git a/package.json b/package.json index 84b77ec..b3b0ea7 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,9 @@ "zip": "cd src && zip -r ../gradienttopbar@pshow.org.shell-extension.zip .", "prettify": "prettier --write 'src/**/*.{css}' && yarn lint --fix", "lint": "eslint 'src/**/*.{js,json}'", + "setup-python": "python3 -m venv .venv && .venv/bin/python -m pip install -r requirements-dev.txt", + "shexli": ".venv/bin/shexli --format json \"$PWD/src\" | .venv/bin/python -c \"import json, sys; report = json.load(sys.stdin); print(json.dumps(report, indent=2)); raise SystemExit(report['summary']['finding_count'] != 0)\"", + "verify": "yarn lint && yarn shexli", "precommit": "lint-staged", "upload": "gnome-extensions upload --accept-tos" }, diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..d7a88e8 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +shexli==0.2.1 +tree-sitter==0.25.2 From 5a1f712d5d93bc6846cf95cc7323b234e03ab51f Mon Sep 17 00:00:00 2001 From: Petar Vasilev Date: Fri, 25 Sep 2026 01:08:30 +0100 Subject: [PATCH 2/5] Add GitHub Actions workflow for verification --- .github/workflows/verify.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/verify.yml diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..952bf8e --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,26 @@ +name: Verify + +on: + push: + pull_request: + +permissions: {} + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + - run: corepack enable + - run: yarn install --immutable + - run: yarn setup-python + - run: yarn verify From ac950e2f32d89892595832d41ee8b216ba1b16dc Mon Sep 17 00:00:00 2001 From: Petar Vasilev Date: Fri, 25 Sep 2026 01:08:49 +0100 Subject: [PATCH 3/5] Update README to include Python 3.12 requirement and modify setup instructions --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index feb349d..a231d0c 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ Before you start development, make sure you have the following installed: - GNOME Shell (version 45 or higher) - Node.js and Yarn (the project uses Yarn 4.0.1) +- Python 3.12 or newer - Git ## Setting Up the Development Environment @@ -75,6 +76,7 @@ Before you start development, make sure you have the following installed: 2. Install dependencies: ```bash yarn install + yarn setup-python ``` ## Development Tools @@ -98,12 +100,14 @@ The project includes several scripts to help with development: - `yarn prettify`: Formats code using Prettier. - `yarn lint`: Lints the code using ESLint. +- `yarn shexli`: Runs the extensions.gnome.org static analyzer. +- `yarn verify`: Runs ESLint and Shexli. - `yarn precommit`: Runs lint-staged for pre-commit hooks. ## Workflow 1. Make your changes to the code. -2. Run `yarn prettify` and `yarn lint` to ensure code quality. +2. Run `yarn prettify` and `yarn verify` to ensure code quality. 3. Test your changes using `yarn local-install` and `yarn open-prefs`. 4. If needed, debug using `yarn pref-debug` or `yarn nested-wayland`. 5. Submit a pull request with your changes. From 32d6948c12fa79e47e8bc564d3bf07b046e100e8 Mon Sep 17 00:00:00 2001 From: Petar Vasilev Date: Fri, 25 Sep 2026 01:11:41 +0100 Subject: [PATCH 4/5] cache dependencies from requirements-dev.txt --- .github/workflows/verify.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 952bf8e..2b6004f 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -20,6 +20,7 @@ jobs: with: python-version: "3.12" cache: pip + cache-dependency-path: requirements-dev.txt - run: corepack enable - run: yarn install --immutable - run: yarn setup-python From 2ff52fe86893a114736dad3f8b247619832777ac Mon Sep 17 00:00:00 2001 From: Petar Vasilev Date: Fri, 25 Sep 2026 01:18:40 +0100 Subject: [PATCH 5/5] Add ESLint and Shexli jobs to GitHub Actions workflow --- .github/workflows/verify.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 2b6004f..f7bf89b 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -7,7 +7,8 @@ on: permissions: {} jobs: - verify: + lint: + name: ESLint runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -16,12 +17,24 @@ jobs: with: node-version: 22 cache: yarn + - run: corepack enable + - run: yarn install --immutable + - run: yarn lint + + shexli: + name: Shexli + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 - uses: actions/setup-python@v5 with: python-version: "3.12" cache: pip cache-dependency-path: requirements-dev.txt - run: corepack enable - - run: yarn install --immutable - run: yarn setup-python - - run: yarn verify + - run: yarn shexli