Skip to content

Commit fcc20ba

Browse files
committed
use Taskfiles for tasks
1 parent 8257cbe commit fcc20ba

12 files changed

Lines changed: 197 additions & 73 deletions

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## 🚨 CRITICAL RULES - MUST ALWAYS BE FOLLOWED 🚨
44

5-
1. **NEVER mark a feature as done until `./scripts/all_check.sh` is passing**
6-
2. **ALWAYS run `./scripts/all_check.sh` before claiming completion**
5+
1. **NEVER mark a feature as done until `task all` is passing**
6+
2. **ALWAYS run `task all` before claiming completion**
77
3. **NO EXCEPTIONS to the above rules - features are NOT complete until all checks pass**
88
4. **This rule must ALWAYS be followed no matter what**
99

@@ -12,8 +12,8 @@
1212
### Core Commands
1313

1414
- Setup: `scripts/setup.sh`
15-
- Run all checks: `scripts/all_check.sh` (runs typecheck, export, lint, test, etc.)
16-
- Run all checks with auto-fix: `scripts/all_write.sh`
15+
- Run all checks: `task all` (runs typecheck, export, lint, test, etc.)
16+
- Run all checks with auto-fix: `task fix`
1717
- Interactive console: `scripts/console.rb`
1818

1919
### Testing Commands

Taskfile.prettier.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: '3'
2+
3+
tasks:
4+
deps:
5+
desc: Install repository tooling dependencies (pnpm)
6+
run: once
7+
cmds:
8+
- pnpm install --frozen-lockfile
9+
10+
check:
11+
desc: Check formatting with Prettier
12+
deps: [deps]
13+
cmds:
14+
- scripts/prettier.sh --check
15+
16+
write:
17+
desc: Format files with Prettier
18+
deps: [deps]
19+
cmds:
20+
- scripts/prettier.sh --write

Taskfile.rails.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: '3'
2+
3+
vars:
4+
RAILS_VERSION: '{{.RAILS_VERSION | default "7.0.8"}}'
5+
6+
tasks:
7+
test:
8+
desc: Run Rails integration tests (override with RAILS_VERSION=...)
9+
cmds:
10+
- cmd: RAILS_VERSION={{.RAILS_VERSION}} ./scripts/rails_tests.sh
11+
dir: .
12+
13+
test:matrix:
14+
desc: Run Rails integration tests for supported versions (7.0.8 and 8.0.1)
15+
cmds:
16+
- task: test
17+
- cmd: RAILS_VERSION=8.0.1 ./scripts/rails_tests.sh
18+
dir: .

Taskfile.ruby.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: '3'
2+
3+
tasks:
4+
generate:
5+
desc: Generate Sorbet structs and TypeScript artifacts
6+
cmds:
7+
- bundle exec ruby scripts/generate_structs.rb
8+
9+
typecheck:
10+
desc: Run Sorbet type checking
11+
cmds:
12+
- scripts/typecheck.sh
13+
14+
lint:
15+
desc: Run RuboCop
16+
cmds:
17+
- bundle exec ruby scripts/rubocop.rb
18+
19+
lint:fix:
20+
desc: Auto-correct RuboCop offenses
21+
cmds:
22+
- bundle exec ruby scripts/rubocop.rb -A
23+
24+
check-generated:
25+
desc: Ensure generated Ruby structs are up to date (CI safe)
26+
cmds:
27+
- scripts/check_generated.sh
28+
29+
test:
30+
desc: Run Ruby unit tests
31+
cmds:
32+
- bundle exec ruby scripts/test.rb
33+
34+
coverage:merge:
35+
desc: Merge Ruby and Rails coverage reports
36+
cmds:
37+
- scripts/merge_coverage.sh

Taskfile.site.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: '3'
2+
3+
tasks:
4+
deps:
5+
dir: site
6+
desc: Install frontend dependencies (pnpm)
7+
run: once
8+
cmds:
9+
- pnpm install --frozen-lockfile
10+
11+
typecheck:
12+
dir: site
13+
desc: Run TypeScript type checking
14+
deps: [deps]
15+
cmds:
16+
- pnpm exec tsc --noEmit
17+
18+
lint:
19+
dir: site
20+
desc: Run ESLint
21+
deps: [deps]
22+
cmds:
23+
- npm run lint
24+
25+
lint:fix:
26+
dir: site
27+
desc: Run ESLint with auto-fix
28+
deps: [deps]
29+
cmds:
30+
- npm run lint -- --fix
31+
32+
test:
33+
dir: site
34+
desc: Run frontend tests
35+
deps: [deps]
36+
cmds:
37+
- npm test

Taskfile.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
version: '3'
2+
3+
includes:
4+
ruby: ./Taskfile.ruby.yml
5+
site: ./Taskfile.site.yml
6+
prettier: ./Taskfile.prettier.yml
7+
rails: ./Taskfile.rails.yml
8+
9+
tasks:
10+
generate:
11+
desc: Regenerate LogStruct Ruby and TypeScript structs
12+
cmds:
13+
- task: ruby:generate
14+
15+
typecheck:
16+
desc: Run Sorbet and TypeScript type checking
17+
cmds:
18+
- task: ruby:typecheck
19+
- task: site:typecheck
20+
21+
lint:
22+
desc: Run Ruby and frontend linters
23+
cmds:
24+
- task: ruby:lint
25+
- task: prettier:check
26+
- task: site:lint
27+
28+
lint:fix:
29+
desc: Auto-fix Ruby and frontend lint issues
30+
cmds:
31+
- task: ruby:lint:fix
32+
- task: prettier:write
33+
- task: site:lint:fix
34+
35+
spellcheck:
36+
desc: Run repository spellcheck
37+
deps: [prettier:deps]
38+
cmds:
39+
- scripts/spellcheck.sh
40+
41+
test:
42+
desc: Run Ruby unit tests, Rails integration tests, and merge coverage
43+
cmds:
44+
- task: ruby:check-generated
45+
- task: ruby:test
46+
- task: rails:test
47+
- task: ruby:coverage:merge
48+
49+
all:
50+
desc: Run the full validation workflow (replaces scripts/all_check.sh)
51+
cmds:
52+
- task: generate
53+
- task: typecheck
54+
- task: lint
55+
- task: spellcheck
56+
- task: site:test
57+
- task: test
58+
59+
fix:
60+
desc: Auto-fix lint issues then run the full validation workflow (replaces scripts/all_write.sh)
61+
cmds:
62+
- task: generate
63+
- task: typecheck
64+
- task: lint:fix
65+
- task: spellcheck
66+
- task: site:test
67+
- task: test

scripts/all_check.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

scripts/all_write.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

scripts/export_provider_catalog.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
keys_path = File.join(site_gen, "log-fields.json")
1313

1414
unless File.exist?(enums_path) && File.exist?(structs_path) && File.exist?(keys_path)
15-
abort "Missing generated files in #{site_gen}. Run scripts/all_check.sh first."
15+
abort "Missing generated files in #{site_gen}. Run `task generate` first."
1616
end
1717

1818
enums = JSON.parse(File.read(enums_path))

site/eslint.config.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ const compat = new FlatCompat({
1111

1212
const eslintConfig = [
1313
...compat.extends('next/core-web-vitals', 'next/typescript'),
14+
{
15+
rules: {
16+
'@typescript-eslint/no-unused-vars': [
17+
'error',
18+
{
19+
argsIgnorePattern: '^_',
20+
varsIgnorePattern: '^_',
21+
},
22+
],
23+
},
24+
},
1425
];
1526

1627
export default eslintConfig;

0 commit comments

Comments
 (0)