Skip to content

Commit 2391ab7

Browse files
authored
Fix copilot instructions using the wrong commands (#1620)
1 parent 15ae26c commit 2391ab7

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

.github/copilot-instructions.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ Most of our development takes place in the `internal` directory, and most behavi
99

1010
Most development on the codebase is in Go.
1111
Standard Go commands and practices apply, but we primarily use a tool called `hereby` to build, run tests, and other tasks.
12-
Run `npx hereby --list` to see all available commands.
12+
Run `npx hereby --tasks` to see all available commands.
1313

1414
```sh
15-
npx hereby build # Build the project
15+
npx hereby build # Build the tsgo binary (not required for tests)
1616
npx hereby test # Run tests
1717
npx hereby format # Format the code
1818
npx hereby lint # Run linters
1919

2020
# To run a specific compiler test:
21-
go test -run='TestSubmodule/<test name>' ./internal/testrunner # For submodule tests in _submodules/TypeScript
22-
go test -run='TestLocal/<test name>' ./internal/testrunner # For local tests in testdata/tests/cases
21+
go test -run='TestSubmodule/<test name>' ./internal/testrunner # For pre-existing "submodule" tests in _submodules/TypeScript
22+
go test -run='TestLocal/<test name>' ./internal/testrunner # For new "local" tests created in testdata/tests/cases
2323
```
2424

25-
Always make sure code is formatted, linted, and tested before sending a pull request.
26-
25+
Always make sure code is formatted, linted, and tested before sending a pull request.
26+
2727
## Compiler Features, Fixes, and Tests
2828

2929
When fixing a bug or implementing a new feature, at least one minimal test case should always be added in advance to verify the fix.
@@ -56,10 +56,10 @@ export interface Person {
5656
function greet(person) {
5757
console.log(`Hello, ${person.name}!`);
5858
}
59-
```
60-
61-
**New compiler tests should always enable strict mode (`@strict: true`) unless the bug specifically involves non-strict mode behavior.**
62-
59+
```
60+
61+
**New compiler tests should always enable strict mode (`@strict: true`) unless the bug specifically involves non-strict mode behavior.**
62+
6363
Tests don't always need the above `@option`s specified, but they are common to specify or modify.
6464
Tests can be run with multiple settings for a given option by using a comma-separated list (e.g. `@option: settingA,settingB`).
6565
`@filename` is only required when a test has multiple files, or when writing a test for a single JavaScript file (where `allowJs` or `checkJs` is enabled).

Herebyfile.mjs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ async function generateLibs(out) {
176176

177177
export const lib = task({
178178
name: "lib",
179+
description: "Copies the libs to built/local.",
179180
run: () => generateLibs(builtLocal),
180181
});
181182

@@ -194,6 +195,7 @@ function buildTsgo(opts) {
194195

195196
export const tsgoBuild = task({
196197
name: "tsgo:build",
198+
description: "Builds the tsgo binary.",
197199
run: async () => {
198200
await buildTsgo();
199201
},
@@ -216,6 +218,7 @@ export const build = task({
216218

217219
export const buildWatch = task({
218220
name: "build:watch",
221+
description: "Builds the tsgo binary and watches for changes.",
219222
run: async () => {
220223
await watchDebounced("build:watch", async (paths, abortSignal) => {
221224
let libsChanged = false;
@@ -263,6 +266,7 @@ export const cleanBuilt = task({
263266

264267
export const generate = task({
265268
name: "generate",
269+
description: "Runs go generate on the project.",
266270
run: async () => {
267271
assertTypeScriptCloned();
268272
await $`go generate ./...`;
@@ -326,6 +330,7 @@ async function runTests() {
326330

327331
export const test = task({
328332
name: "test",
333+
description: "Runs all tests. This is the most typical test task to need.",
329334
run: runTests,
330335
});
331336

@@ -337,6 +342,7 @@ async function runTestBenchmarks() {
337342

338343
export const testBenchmarks = task({
339344
name: "test:benchmarks",
345+
description: "Runs all benchmarks.",
340346
run: runTestBenchmarks,
341347
});
342348

@@ -350,24 +356,28 @@ async function runTestAPI() {
350356

351357
export const testTools = task({
352358
name: "test:tools",
359+
description: "Runs all tests in the _tools module.",
353360
run: runTestTools,
354361
});
355362

356363
export const buildAPITests = task({
357364
name: "build:api:test",
365+
description: "Builds the @typescript/api tests.",
358366
run: async () => {
359367
await $`npm run -w @typescript/api build:test`;
360368
},
361369
});
362370

363371
export const testAPI = task({
364372
name: "test:api",
373+
description: "Runs the @typescript/api tests.",
365374
dependencies: [tsgo, buildAPITests],
366375
run: runTestAPI,
367376
});
368377

369378
export const testAll = task({
370379
name: "test:all",
380+
description: "Runs ALL tests in the repo, including benchmarks, _tools, and the API tests.",
371381
dependencies: [tsgo, buildAPITests],
372382
run: async () => {
373383
// Prevent interleaving by running these directly instead of in parallel.
@@ -435,6 +445,7 @@ const buildCustomLinter = memoize(async () => {
435445

436446
export const lint = task({
437447
name: "lint",
448+
description: "Runs golangci-lint.",
438449
run: async () => {
439450
await buildCustomLinter();
440451

@@ -455,6 +466,7 @@ export const lint = task({
455466

456467
export const installTools = task({
457468
name: "install-tools",
469+
description: "Installs optional tools for developing within the repo.",
458470
run: async () => {
459471
await Promise.all([
460472
...[...tools].map(([tool, version]) => $`go install ${tool}${version ? `@${version}` : ""}`),
@@ -465,13 +477,15 @@ export const installTools = task({
465477

466478
export const format = task({
467479
name: "format",
480+
description: "Formats the repo.",
468481
run: async () => {
469482
await $`dprint fmt`;
470483
},
471484
});
472485

473486
export const checkFormat = task({
474487
name: "check:format",
488+
description: "Checks that the repo is formatted.",
475489
run: async () => {
476490
await $`dprint check`;
477491
},
@@ -508,7 +522,7 @@ function baselineAcceptTask(localBaseline, refBaseline) {
508522

509523
export const baselineAccept = task({
510524
name: "baseline-accept",
511-
description: "Makes the most recent test results the new baseline, overwriting the old baseline",
525+
description: "Makes the most recent test results the new baseline, overwriting the old baseline.",
512526
run: baselineAcceptTask("testdata/baselines/local/", "testdata/baselines/reference/"),
513527
});
514528

@@ -728,6 +742,7 @@ const getSignTempDir = memoize(async () => {
728742

729743
const cleanSignTempDirectory = task({
730744
name: "clean:sign-tmp",
745+
hiddenFromTaskList: true,
731746
run: () => rimraf(builtSignTmp),
732747
});
733748

@@ -1227,6 +1242,7 @@ export const signNativePreviewExtensions = task({
12271242

12281243
export const nativePreview = task({
12291244
name: "native-preview",
1245+
hiddenFromTaskList: true,
12301246
dependencies: options.forRelease ? undefined : [packNativePreviewPackages, packNativePreviewExtensions],
12311247
run: options.forRelease ? async () => {
12321248
throw new Error("This task should not be run in release builds.");
@@ -1235,6 +1251,7 @@ export const nativePreview = task({
12351251

12361252
export const installExtension = task({
12371253
name: "install-extension",
1254+
hiddenFromTaskList: true,
12381255
dependencies: options.forRelease ? undefined : [packNativePreviewExtensions],
12391256
run: async () => {
12401257
if (options.forRelease) {

0 commit comments

Comments
 (0)