|
| 1 | +# AGENTS.md — FSharp.Control.TaskSeq |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +FSharp.Control.TaskSeq is an F# library providing a `taskSeq` computation expression for `IAsyncEnumerable<'T>`, along with a comprehensive `TaskSeq` module of combinators. It targets `netstandard2.1`. |
| 6 | + |
| 7 | +## Repository Layout |
| 8 | + |
| 9 | +- `src/FSharp.Control.TaskSeq/` — Main library (netstandard2.1) |
| 10 | +- `src/FSharp.Control.TaskSeq.Test/` — xUnit test project (net6.0) |
| 11 | +- `src/FSharp.Control.TaskSeq.SmokeTests/` — Smoke/integration tests |
| 12 | +- `src/FSharp.Control.TaskSeq.sln` — Solution file |
| 13 | +- `Version.props` — Single source of truth for the package version |
| 14 | +- `build.cmd` — Windows build/test script used by CI |
| 15 | + |
| 16 | +## Build |
| 17 | + |
| 18 | +The solution uses the .NET SDK. Restore tools first, then build: |
| 19 | + |
| 20 | +```bash |
| 21 | +dotnet tool restore |
| 22 | +dotnet build src/FSharp.Control.TaskSeq.sln -c Release |
| 23 | +``` |
| 24 | + |
| 25 | +Or use the provided script (Windows): |
| 26 | + |
| 27 | +```cmd |
| 28 | +./build.cmd # default: release build |
| 29 | +./build.cmd debug # debug build |
| 30 | +``` |
| 31 | + |
| 32 | +`build.cmd` modes: `build` (default), `test`, `ci`. Configurations: `release` (default), `debug`. |
| 33 | + |
| 34 | +## Test |
| 35 | + |
| 36 | +Tests use **xUnit** with `FsUnit.xUnit` assertions. The test project is at `src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj`. |
| 37 | + |
| 38 | +Run tests locally: |
| 39 | + |
| 40 | +```bash |
| 41 | +dotnet test src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj -c Release |
| 42 | +``` |
| 43 | + |
| 44 | +Or via the build script: |
| 45 | + |
| 46 | +```cmd |
| 47 | +./build.cmd test # runs tests without TRX logging |
| 48 | +./build.cmd test -debug # debug configuration |
| 49 | +./build.cmd ci # CI mode: adds --blame-hang-timeout 60000ms and TRX logging |
| 50 | +./build.cmd ci -release # CI mode, release config |
| 51 | +./build.cmd ci -debug # CI mode, debug config |
| 52 | +``` |
| 53 | + |
| 54 | +CI runs both debug and release test configurations on `windows-latest`. Test results are output as TRX files to `src/FSharp.Control.TaskSeq.Test/TestResults/`. |
| 55 | + |
| 56 | +## Code Formatting |
| 57 | + |
| 58 | +Formatting is enforced by **Fantomas** (version 6.3.0-alpha-004, configured as a dotnet local tool). |
| 59 | + |
| 60 | +Check formatting (CI runs this on every PR): |
| 61 | + |
| 62 | +```bash |
| 63 | +dotnet tool restore |
| 64 | +dotnet fantomas . --check |
| 65 | +``` |
| 66 | + |
| 67 | +Apply formatting: |
| 68 | + |
| 69 | +```bash |
| 70 | +dotnet fantomas . |
| 71 | +``` |
| 72 | + |
| 73 | +Fantomas settings are in `src/.editorconfig` under the `[*.{fs,fsx}]` section. Key settings: |
| 74 | + |
| 75 | +- `max_line_length = 140` |
| 76 | +- `indent_size = 4` |
| 77 | +- `fsharp_space_before_parameter = true` |
| 78 | +- `fsharp_space_before_lowercase_invocation = true` |
| 79 | +- `fsharp_max_if_then_else_short_width = 60` |
| 80 | +- `fsharp_max_record_width = 80` |
| 81 | +- `fsharp_max_array_or_list_width = 100` |
| 82 | + |
| 83 | +## CI Workflows |
| 84 | + |
| 85 | +All workflows are in `.github/workflows/`: |
| 86 | + |
| 87 | +| Workflow | File | Trigger | Purpose | |
| 88 | +|---|---|---|---| |
| 89 | +| **ci-build** | `build.yaml` | Pull requests | Verify formatting (`dotnet fantomas . --check`) then build release on Windows | |
| 90 | +| **ci-test** | `test.yaml` | Pull requests | Run tests in both debug and release on Windows, upload TRX artifacts | |
| 91 | +| **ci-report** | `test-report.yaml` | After `ci-test` completes | Publish test results via `dorny/test-reporter` | |
| 92 | +| **Build main** | `main.yaml` | Push to `main` | Build + test release on Windows | |
| 93 | +| **Publish** | `publish.yaml` | Push to `main` | Build, then push NuGet package (skip-duplicate) | |
| 94 | + |
| 95 | +## Conventions |
| 96 | + |
| 97 | +- F# source files use `.fs` extension; signature files use `.fsi`. |
| 98 | +- `TreatWarningsAsErrors` is enabled for all projects. |
| 99 | +- File ordering matters in F# — the `<Compile>` order in `.fsproj` files defines compilation order. |
| 100 | +- The library targets `netstandard2.1`; tests target `net6.0` with `FSharp.Core` pinned to `6.0.1`. |
| 101 | +- NuGet packages are output to the `packages/` directory. |
0 commit comments