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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# shellcheck shell=bash
use flake
20 changes: 18 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ repos:
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: local
hooks:
- id: forbid-symlinks
name: Forbid symlinks
entry: Forbid symlinks
language: fail
types: [symlink]

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.6
hooks:
- id: forbid-crlf

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
Expand All @@ -41,6 +44,7 @@ repos:
# document contents. For example
# data/fixtures/recorded/languages/ruby/changeCondition.yml
exclude: ^data/fixtures/recorded/.*/[^/]*\.yml$|\.scope$|/generated/|^patches/

- repo: local
hooks:
- id: eslint
Expand All @@ -49,6 +53,7 @@ repos:
language: system
entry: pnpm exec eslint
args: [--fix]

- repo: local
hooks:
- id: prettier
Expand All @@ -57,31 +62,42 @@ repos:
language: system
entry: pnpm exec prettier
args: [--write, --list-different, --ignore-unknown]

- repo: local
hooks:
- id: format-recorded-tests
name: format-recorded-tests
files: ^data/fixtures/recorded/.*/[^/]*\.yml$
language: system
entry: pnpm exec ./packages/common/scripts/my-ts-node.js packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts

- repo: local
hooks:
- id: check-recorded-test-marks
name: check-recorded-test-marks
files: ^data/fixtures/recorded/.*/[^/]*\.yml$
language: system
entry: pnpm exec ./packages/common/scripts/my-ts-node.js packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts --check-marks

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.1
rev: v0.15.5
hooks:
- id: ruff
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/lunarmodules/luacheck
rev: v1.2.0
hooks:
- id: luacheck

- repo: https://github.com/JohnnyMorganz/StyLua
rev: v0.20.0
hooks:
- id: stylua

- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.11.0
hooks:
- id: shellcheck
name: ShellCheck
2 changes: 1 addition & 1 deletion packages/test-harness/scripts/build-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail

find .. -name '*.test.ts' | xargs -n 50 pnpm run build:base --outdir=dist --out-extension:.js=.cjs
find .. -name '*.test.ts' -print0 | xargs -0 -n 50 pnpm run build:base --outdir=dist --out-extension:.js=.cjs
10 changes: 5 additions & 5 deletions scripts/deploy-cursorless-talon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ set -euo pipefail
git switch -c cursorless-talon-staging origin/cursorless-talon-staging

# Exit if there were no changes to the cursorless-talon directory
[[ "$(git rev-parse $GITHUB_SHA:cursorless-talon)" == "$(git rev-parse cursorless-talon-staging^{tree})" ]] && exit 0
[[ "$(git rev-parse "${GITHUB_SHA}:cursorless-talon")" == "$(git rev-parse 'cursorless-talon-staging^{tree}')" ]] && exit 0

# Fetch current cursorless-talon main
git remote add cursorless-talon 'https://github.com/cursorless-dev/cursorless-talon.git'
git fetch cursorless-talon

# Sanity check that cursorless-talon/main is identical to cursorless-talon-staging
[[ "$(git rev-parse cursorless-talon/main^{tree})" == "$(git rev-parse cursorless-talon-staging^{tree})" ]]
[[ "$(git rev-parse 'cursorless-talon/main^{tree}')" == "$(git rev-parse 'cursorless-talon-staging^{tree}')" ]]

# Tag previous version of staging branch
git tag cursorless-talon-staging-previous cursorless-talon-staging

# Update the staging branch
git switch -c github-sha $GITHUB_SHA
git switch -c github-sha "$GITHUB_SHA"
git subtree split --prefix=cursorless-talon --branch=cursorless-talon-staging

# Sanity check that the previous staging commit is an ancestor of the new one
Expand All @@ -32,11 +32,11 @@ git switch -c cursorless-talon-main cursorless-talon/main
git cherry-pick cursorless-talon-staging-previous..cursorless-talon-staging

# Sanity check that cursorless-talon-main is identical to cursorless-talon-staging
[[ "$(git rev-parse cursorless-talon-main^{tree})" == "$(git rev-parse cursorless-talon-staging^{tree})" ]]
[[ "$(git rev-parse 'cursorless-talon-main^{tree}')" == "$(git rev-parse 'cursorless-talon-staging^{tree}')" ]]

# Sanity check that cursorless-talon-main is identical to cursorless-talon
# subdirectory of cursorless-vscode
[[ "$(git rev-parse cursorless-talon-main^{tree})" == "$(git rev-parse $GITHUB_SHA:cursorless-talon)" ]]
[[ "$(git rev-parse 'cursorless-talon-main^{tree}')" == "$(git rev-parse "${GITHUB_SHA}:cursorless-talon")" ]]

# Push to cursorless-talon
git push cursorless-talon cursorless-talon-main:main
Expand Down
Loading