Skip to content

Commit 754b5b6

Browse files
Merge branch 'main' into pr/josharian/1723
2 parents 44aeec7 + 06e973b commit 754b5b6

File tree

4,641 files changed

+74054
-33960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,641 files changed

+74054
-33960
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.eslintrc.json

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
"extends": [
55
"eslint:recommended",
66
"plugin:@typescript-eslint/recommended",
7+
// We want to enable this in the long run. For now there are a lot of errors that needs to be handled.
8+
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
79
"plugin:import/typescript",
810
"prettier"
911
],
1012
"parserOptions": {
1113
"ecmaVersion": 6,
12-
"sourceType": "module"
14+
"sourceType": "module",
15+
"project": true
1316
},
1417
"plugins": [
1518
"@typescript-eslint",
@@ -20,28 +23,41 @@
2023
],
2124
"rules": {
2225
"import/no-relative-packages": "error",
26+
"@typescript-eslint/consistent-type-imports": "error",
2327
"@typescript-eslint/consistent-type-assertions": [
2428
"error",
2529
{
2630
"assertionStyle": "as"
2731
}
2832
],
29-
"@typescript-eslint/naming-convention": "warn",
33+
"@typescript-eslint/naming-convention": [
34+
"error",
35+
{
36+
"selector": ["objectLiteralProperty"],
37+
"format": ["camelCase"],
38+
"filter": {
39+
"regex": "[.]",
40+
"match": false
41+
}
42+
}
43+
],
44+
"@typescript-eslint/no-floating-promises": "error",
3045
"@typescript-eslint/no-explicit-any": "off",
3146
"@typescript-eslint/no-inferrable-types": "off",
3247
"@typescript-eslint/no-non-null-assertion": "off",
3348
"unused-imports/no-unused-imports": "error",
3449
"@typescript-eslint/no-unused-vars": [
35-
"warn",
50+
"error",
3651
{
3752
"argsIgnorePattern": "^_",
3853
"varsIgnorePattern": "^_",
54+
"caughtErrorsIgnorePattern": "^_",
3955
"ignoreRestSiblings": true
4056
}
4157
],
42-
"curly": "warn",
58+
"curly": "error",
4359
"eqeqeq": [
44-
"warn",
60+
"error",
4561
"always",
4662
{
4763
"null": "never"
@@ -57,7 +73,7 @@
5773
"error",
5874
"MemberExpression[object.property.name='constructor'][property.name='name']"
5975
],
60-
"no-throw-literal": "warn",
76+
"no-throw-literal": "error",
6177
"semi": "off",
6278
"unicorn/prefer-module": "error",
6379
"mocha/no-skipped-tests": "error",
@@ -68,28 +84,37 @@
6884
"files": ["*.tsx"],
6985
"rules": {
7086
"@typescript-eslint/naming-convention": [
71-
"warn",
87+
"error",
7288
{
7389
"selector": ["function"],
7490
"format": ["PascalCase", "camelCase"]
7591
}
7692
]
7793
}
94+
},
95+
{
96+
"files": [
97+
"jest.config.ts",
98+
"docusaurus.config.mts",
99+
"mdx-components.tsx",
100+
"typings/**"
101+
],
102+
"extends": ["plugin:@typescript-eslint/disable-type-checked"]
78103
}
79104
],
80105
"settings": {
81106
"import/resolver": {
82107
"typescript": {
83108
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
84-
85109
"project": ["tsconfig.json", "packages/*/tsconfig.json"]
86110
}
87111
}
88112
},
89113
"ignorePatterns": [
90-
"**/vendor/**/*.ts",
91-
"**/vendor/**/*.js",
114+
"**/generated/**",
92115
"**/out/**",
93-
"**/generated/**"
116+
"**/vendor/**/*.js",
117+
"**/vendor/**/*.ts",
118+
"/data/playground/**"
94119
]
95120
}

.github/CODEOWNERS

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
* @pokey @AndreasArvidsson
1+
* @cursorless-dev/code-owners
22

3-
*keyboard* @pokey @AndreasArvidsson @josharian
4-
*Keyboard* @pokey @AndreasArvidsson @josharian
3+
*keyboard* @cursorless-dev/code-owners @josharian
4+
*Keyboard* @cursorless-dev/code-owners @josharian
5+
6+
*neovim* @cursorless-dev/code-owners @saidelike @fidgetingbits
7+
*Neovim* @cursorless-dev/code-owners @saidelike @fidgetingbits
8+
*nvim* @cursorless-dev/code-owners @saidelike @fidgetingbits
9+
*Nvim* @cursorless-dev/code-owners @saidelike @fidgetingbits

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
<!--
2+
Thanks for your change!
13
4+
* Remember to *add tests* if you have added a new feature, or fixed a bug.
5+
Use the test case recorder: https://www.cursorless.org/docs/contributing/test-case-recorder
26
3-
## Checklist
7+
* Remember to *update the docs* if you've added a new feature.
8+
Link: https://github.com/cursorless-dev/cursorless/tree/main/docs
49
5-
- [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
6-
- [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
7-
- [ ] I have not broken the cheatsheet
10+
* Remember to *test the cheatsheet manually* if you've added a new action,
11+
modifier, or scope -- or changed any Talon files.
12+
13+
Remove this comment.
14+
-->
15+
16+
17+
## Release notes

.github/PULL_REQUEST_TEMPLATE/new_programming_language.md

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Lua Language Server Lint"
2+
description: "Lints all lua files with lua-language-server"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: cachix/install-nix-action@v27
7+
with:
8+
nix_path: nixpkgs=channel:nixos-unstable
9+
- uses: DeterminateSystems/magic-nix-cache-action@v2
10+
- run: nix profile install --accept-flake-config .#lua-language-server
11+
shell: bash
12+
- run: scripts/lint-lua-ls.sh
13+
shell: bash
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Neovim Lua Tests"
2+
description: "Set up Neovim Lua environment and run Busted tests"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: leafo/gh-actions-lua@v10
7+
with:
8+
luaVersion: "luajit-openresty"
9+
- uses: leafo/gh-actions-luarocks@v4
10+
- shell: bash
11+
run: |
12+
luarocks install busted
13+
luarocks install luafilesystem
14+
- shell: bash
15+
run: |
16+
cd cursorless.nvim
17+
busted --run unit

.github/workflows/deploy.yaml

Lines changed: 86 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,52 +13,130 @@ jobs:
1313
environment: production
1414
env:
1515
CURSORLESS_REPO_ROOT: ${{ github.workspace }}
16+
1617
steps:
17-
- uses: actions/checkout@v4
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
1820
with:
21+
# This is needed to get the number of commits in the current branch
1922
fetch-depth: 0
20-
- run: corepack enable
21-
- uses: actions/setup-node@v4
23+
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v4
26+
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v4
2229
with:
2330
node-version-file: .nvmrc
2431
cache: pnpm
25-
- run: pnpm --color install
26-
- run: pnpm --color compile
27-
- run: pnpm --color --filter '!cursorless-org' --filter '!cursorless-org-*' build
32+
33+
- name: Install dependencies
34+
run: pnpm --color install
35+
36+
- name: Compile
37+
run: pnpm --color compile
38+
39+
- name: Build
40+
run: pnpm --color --filter '!cursorless-org' --filter '!cursorless-org-*' build
2841
env:
2942
CURSORLESS_DEPLOY: true
43+
3044
- name: Publish to Open VSX Registry
3145
id: publishToOpenVSX
3246
uses: HaaLeo/publish-vscode-extension@v1
3347
with:
3448
pat: ${{ secrets.OPEN_VSX_TOKEN }}
3549
packagePath: packages/cursorless-vscode/dist
50+
3651
- name: Publish to Visual Studio Marketplace
3752
uses: HaaLeo/publish-vscode-extension@v1
3853
with:
3954
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
4055
registryUrl: https://marketplace.visualstudio.com
4156
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
4257

58+
publish-neovim-extension:
59+
runs-on: ubuntu-latest
60+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
61+
environment: production
62+
env:
63+
CURSORLESS_REPO_ROOT: ${{ github.workspace }}
64+
STAGING_DIRECTORY: ${{ github.workspace }}/cursorless.nvim-staging
65+
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
70+
- name: Install pnpm
71+
uses: pnpm/action-setup@v4
72+
73+
- name: Set up Node.js
74+
uses: actions/setup-node@v4
75+
with:
76+
node-version-file: .nvmrc
77+
cache: pnpm
78+
79+
- name: Install dependencies
80+
run: pnpm --color install
81+
82+
- name: Compile
83+
run: pnpm --color compile
84+
85+
- name: Build
86+
run: pnpm --color --filter '!cursorless-org' --filter '!cursorless-org-*' build
87+
env:
88+
CURSORLESS_DEPLOY: true
89+
90+
- name: Checkout cursorless.nvim plugin repo
91+
uses: actions/checkout@v4
92+
with:
93+
token: ${{ secrets.CURSORLESS_BOT_TOKEN }}
94+
repository: hands-free-vim/cursorless.nvim
95+
path: ${{ env.STAGING_DIRECTORY }}
96+
97+
- name: Configure GPG Key
98+
working-directory: ${{ env.STAGING_DIRECTORY }}
99+
run: |
100+
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
101+
env:
102+
GPG_SIGNING_KEY: ${{ secrets.CURSORLESS_BOT_GPG_SIGNING_KEY }}
103+
104+
- name: git config
105+
working-directory: ${{ env.STAGING_DIRECTORY }}
106+
run: |
107+
git config user.name cursorless-bot
108+
git config user.email [email protected]
109+
git config user.signingkey A9387720AFC62221
110+
git config commit.gpgsign true
111+
112+
- name: Push compiled files to cursorless.nvim plugin repo
113+
run: bash -x scripts/deploy-cursorless-nvim.sh ${{ env.STAGING_DIRECTORY }}
114+
43115
push-cursorless-talon:
44116
name: Push cursorless-talon subrepo
45117
runs-on: ubuntu-latest
46118
needs: publish-extension
47119
environment: production
120+
48121
steps:
49-
- uses: actions/checkout@v4
122+
- name: Checkout repository
123+
uses: actions/checkout@v4
50124
with:
51125
fetch-depth: 0
52126
token: ${{ secrets.CURSORLESS_BOT_TOKEN }}
127+
53128
- name: Configure GPG Key
54129
run: |
55130
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
56131
env:
57132
GPG_SIGNING_KEY: ${{ secrets.CURSORLESS_BOT_GPG_SIGNING_KEY }}
133+
58134
- name: git config
59135
run: |
60136
git config user.name cursorless-bot
61137
git config user.email [email protected]
62138
git config user.signingkey A9387720AFC62221
63139
git config commit.gpgsign true
64-
- run: bash -x scripts/deploy-cursorless-talon.sh
140+
141+
- name: Push cursorless-talon subrepo
142+
run: bash -x scripts/deploy-cursorless-talon.sh

.github/workflows/forbid-todo.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ on:
99
jobs:
1010
forbid-todo:
1111
runs-on: ubuntu-latest
12+
1213
steps:
13-
- uses: actions/checkout@v4
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
1417
- name: Forbid TODO
1518
run: ./scripts/forbid-todo.sh
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: PR Description
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, synchronize]
6+
merge_group:
7+
branches: [main]
8+
9+
jobs:
10+
validate-pr-description:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Validate description
17+
run: |
18+
# Fetch PR description from env with jq
19+
PR_DESCRIPTION=$(jq -r ".pull_request.body" "$GITHUB_EVENT_PATH")
20+
KEYWORD="REQUIRED_KEYWORD"
21+
22+
# Ensure PR author removed the welcome comment
23+
if [[ $PR_DESCRIPTION = *"<!--"* ]] || [[ $PR_DESCRIPTION = *"-->"* ]]; then
24+
echo "FAILED: Please remove the welcome comment from your PR description."
25+
exit 1
26+
else
27+
echo "OK: Welcome comment is removed your PR description."
28+
fi
29+
30+
echo "PASS: All checks OK!"

0 commit comments

Comments
 (0)