Skip to content

Commit

Permalink
script to get next rfc id (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
smoothdeveloper authored Mar 31, 2021
1 parent 77b2c82 commit 2b30e69
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions RFC_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 20 additions & 0 deletions find.next.id.fsx
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit 2b30e69

Please sign in to comment.