From 2b30e69b09037b45760fc5816599c595874ab48a Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Wed, 31 Mar 2021 04:54:45 +0200 Subject: [PATCH] script to get next rfc id (#535) --- README.md | 10 ++++++++-- RFC_template.md | 4 ++-- find.next.id.fsx | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 find.next.id.fsx diff --git a/README.md b/README.md index 084c9f42..72dada64 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,17 @@ All tooling RFCs (typically for cross-cutting, cross-editor tooling) live under 2. Ideas which get "approved in principle" get an [RFC entry](https://github.com/fsharp/fslang-design/tree/master/RFCs) based on the [template](https://github.com/fsharp/fslang-design/blob/master/RFC_template.md), and a corresponding [RFC discussion thread](https://github.com/fsharp/fslang-design/issues) There is currently a backlog of approved ideas. If an idea has been approved and you'd - like to accelerate the creation of an RFC, send a PR creating the RFC document for any approved-in-principle issue. + like to accelerate the creation of an RFC, send a PR creating the RFC document for any approved-in-principle issue. First in first served. To "grab the token" send a PR doing nothing but creating or naming the RFC file, and then fill in the further details with additional commits to the PR. -3. Implementations and testing are submitted to the [dotnet/fsharp repository](https://github.com/Microsoft/visualfsharp). + * to pick the RFC numbered identifier, you can run `dotnet fsi find.next.id.fsx` + * to name the file, tooling RFCs are prefixed with `FST-`, language RFC are prefixed with `FS-`, use `-` and lower casing (relaxed for code identifiers), giving descriptive name + * the file location is always under RFCs and get moved by owners of the repository when it ships in a preview or a release. + + + +3. Implementations and testing are submitted to the [dotnet/fsharp repository](https://github.com/dotnet/fsharp). When RFCs are implemented and a version of F# is revved, the RFCs which correspond to the F# version they were implemented in are archived under the appropriate folder. diff --git a/RFC_template.md b/RFC_template.md index 992ecbd9..b6bb10d2 100644 --- a/RFC_template.md +++ b/RFC_template.md @@ -5,10 +5,10 @@ The design suggestion [FILL ME IN](https://github.com/fsharp/fslang-suggestions/ This RFC covers the detailed proposal for this suggestion. - [x] Approved in principle -- [ ] [Suggestion](https://github.com/fsharp/fslang-suggestions/issues/fill-me-in) +- [ ] [Suggestion](https://github.com/fsharp/fslang-suggestions/issues/FILL-ME-IN) - [ ] [Implementation](https://github.com/dotnet/fsharp/pull/FILL-ME-IN) - [ ] Design Review Meeting(s) with @dsyme and others invitees -- [Discussion](https://github.com/fsharp/fslang-design/issues/PLEASE-ADD-A-DISCUSSION-ISSUE-AND-LINK-HERE) +- [Discussion](https://github.com/fsharp/fslang-design/discussions/FILL-ME-IN) # Summary diff --git a/find.next.id.fsx b/find.next.id.fsx new file mode 100644 index 00000000..eb6f94eb --- /dev/null +++ b/find.next.id.fsx @@ -0,0 +1,20 @@ +open System.IO +open System + +let nextId = + DirectoryInfo(__SOURCE_DIRECTORY__).GetFiles("*.md", SearchOption.AllDirectories) + |> Seq.map (fun f -> f.Name.ToLowerInvariant().Split([|"fst-";"fs-"; "-"|], StringSplitOptions.RemoveEmptyEntries)) + |> Seq.choose (function + | [||] + | [|_|] -> None + | items -> + items + |> Array.map (fun v -> Int32.TryParse(v)) + |> Array.filter fst + |> Array.map snd + |> Array.tryHead + ) + |> Seq.max + |> ((+) 1) + +printfn $"next RFC ID: %04i{nextId}" \ No newline at end of file