Skip to content
Merged
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
40 changes: 40 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Verify

on:
push:
pull_request:

permissions: {}

jobs:
lint:
name: ESLint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
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 setup-python
- run: yarn shexli
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
gradienttopbar@pshow.org.shell-extension.zip
node_modules
.venv
.idea/

.yarn/*
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shexli==0.2.1
tree-sitter==0.25.2
Loading