Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9917c50
Wip
vbfox May 9, 2021
9bedb68
Make Interpolated strings build
vbfox May 9, 2021
8f73915
Move things to internal
vbfox May 9, 2021
e42e1b3
Rename back to Finalize for compat
vbfox May 9, 2021
cfdad47
Ignore test results
vbfox May 9, 2021
cbc9bf1
Hide IsNullOrEmpty
vbfox May 9, 2021
7b22e70
Add a few tests
vbfox May 9, 2021
0e837ef
Commit the original files from the compiler for easy diff
vbfox May 9, 2021
46a3537
More readme for myself
vbfox May 9, 2021
95077c1
Cleaner TestApp
vbfox May 10, 2021
bfa19c6
Add a more complete test suite that can serve as non-regression
vbfox May 10, 2021
af50a79
Ignore more warnings
vbfox Sep 4, 2024
2b19a2a
Fix readme position in SLN
vbfox Sep 4, 2024
16944b4
Small rename
vbfox Sep 4, 2024
63667d2
Bump paket
vbfox Sep 4, 2024
9048268
Default to LF line endings
vbfox Sep 4, 2024
97006c9
Less warnings
vbfox Sep 4, 2024
f2592fc
Use a newer version of the SDK
vbfox Sep 4, 2024
9d7a952
Bump a bunch of versions
vbfox Sep 4, 2024
c877198
Bump actions/checkout to v4
vbfox Sep 4, 2024
809dc7e
Let's try installing old dotnet on GH actions
vbfox Sep 4, 2024
8904452
Test all interpolated string formats
vbfox Sep 4, 2024
9c59754
Document string interpolation
vbfox Sep 4, 2024
c1b3a4c
Test string interpolation a bit more
vbfox Sep 4, 2024
742afa8
Don't force personal VSCode settings on users
vbfox Sep 4, 2024
dad9542
Test some custom IFormattable
vbfox Sep 5, 2024
50b70b2
More tests
vbfox Sep 5, 2024
2806f13
Restrict .Net versions a bit more
vbfox Sep 5, 2024
3587e7e
Prepare for an alpha release
vbfox Sep 5, 2024
1c3cf0c
Ensure we have all packages for net8.0 build
vbfox Sep 5, 2024
a4e6d54
Make it build again
vbfox Sep 5, 2024
bb0edd0
Include readme in NuGet
vbfox Sep 5, 2024
51439e7
More .NET versions in GH actions
vbfox Sep 5, 2024
3bc204d
Twitter is dead
vbfox Sep 5, 2024
de2f631
Prepare for a 2.0.0
vbfox Sep 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"paket": {
"version": "6.0.0-beta9",
"version": "8.0.3",
"commands": [
"paket"
]
Expand Down
6 changes: 1 addition & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root = true
indent_style = space
indent_size = 4
insert_final_newline = true
end_of_line = crlf
end_of_line = lf

# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
Expand All @@ -16,7 +16,3 @@ indent_size = 2

[*.{yml,yaml}]
indent_size = 2

[*.sh]
end_of_line = lf

14 changes: 12 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ jobs:
DOTNET_NOLOGO: 1
PAKET_SKIP_RESTORE_TARGETS: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
2
5
- name: Restore packages
run: ./paket.sh restore
- name: Compile build script
Expand All @@ -30,7 +35,12 @@ jobs:
DOTNET_NOLOGO: 1
PAKET_SKIP_RESTORE_TARGETS: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
2
5
- name: Restore packages
run: ./paket.cmd restore
- name: Compile build script
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,5 @@ paket-files/
launchSettings.json
.ionide/
.idea/

TestResults.xml
944 changes: 505 additions & 439 deletions .paket/Paket.Restore.targets

Large diffs are not rendered by default.

30 changes: 18 additions & 12 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
MasterOfFoo
===========
# MasterOfFoo

!["f" Logo](https://raw.githubusercontent.com/vbfox/MasterOfFoo/master/src/BlackFox.MasterOfFoo/Icon.png)

Expand All @@ -13,8 +12,7 @@ The code is essentially an extracted version of [`printf.fs`][printf_fs] where t
what to do with the final blocks that compose the string (printf put them on the console, sprintf in a buffer, ...)
but also what to do with the parameters passed for each format specifier.

Sample usage
------------
## Sample usage

```fsharp
module MyModule =
Expand All @@ -33,8 +31,7 @@ module MyModule =
MyModule.mysprintf "Hello %s." "World"
```

Mini-Doc
--------
## Mini-Doc

### PrintableElement

Expand Down Expand Up @@ -70,8 +67,7 @@ Members:
* `doPrintfFromEnv`: Take a format and a `PrintfEnv` to create a printf-like function
* `doPrintf`: Same as `doPrintfFromEnv` but allow to know the number of elements when the `PrintfEnv` is created.

FAQ
---
## FAQ

### What does it allow exactly that can't be done with the original set of functions ?

Expand Down Expand Up @@ -102,12 +98,22 @@ value.
val it : (int -> int -> float -> string) = <fun:it@1>
````

Projects using it
-----------------
### How are interpolated strings represented ?

The details of string interpolation internals are specified in [F# RFC FS-1001 - String Interpolation][fs-1001].

They appear as follow in this library:
* Type-checked "printf-style" fills behave exactly as they do in `sprintf` and friends.
* Unchecked ".NET-style" fills appear with a `Specifier.TypeChar` of 'P' and the .NET format string
in `Specifier.InteropHoleDotNetFormat`.

[fs-1001]: https://github.com/fsharp/fslang-design/blob/aca88da13cdb95f4f337d4f7d44cbf9d343704ae/FSharp-5.0/FS-1001-StringInterpolation.md#f-rfc-fs-1001---string-interpolation

## Projects using it

* [ColoredPrintf][colorprintf]: A small library that I created to add colored parts to printf strings.

*If you use it somewhere, ping me on twitter [@virtualblackfox][twitter] so I can add you.*
*If you use it somewhere, ping me on the fediverse [@[email protected]][fedi] so I can add you.*

More fun ?
----------
Expand Down Expand Up @@ -142,5 +148,5 @@ ColorPrintf.colorprintf "%s est %t" "La vie" (fun _ -> "belle !")
```

[printf_fs]: https://github.com/fsharp/fsharp/blob/master/src/fsharp/FSharp.Core/printf.fs
[twitter]: https://twitter.com/virtualblackfox
[fedi]: https://hachyderm.io/@vbfox
[colorprintf]: https://github.com/vbfox/ColoredPrintf
7 changes: 7 additions & 0 deletions Release Notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### New in 2.0.0

* Include the readme in the NuGet package
* Build with 8.0.201 SDK
* The new set of supported platforms is .NET Framework 4.6.1, .NET Standard 2.0 and .NET 5.0
* Add support for interpolated strings

### New in 1.0.6

* Make dependency ranges less strict (For `FSharp.Core` 6.x)
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0.201",
"version": "8.0.201",
"rollForward": "latestMajor"
}
}
3 changes: 2 additions & 1 deletion paket.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@dotnet tool restore
@dotnet tool restore --verbosity quiet

dotnet paket %*
6 changes: 3 additions & 3 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
source https://api.nuget.org/v3/index.json
framework: net5.0,netcoreapp2.0,netstandard1.6,netstandard2.0,net45
framework: net8.0,net5.0,netcoreapp2.0,netstandard2.0,net461
storage:none

nuget Expecto
nuget Expecto ~> 9
nuget FSharp.Core
nuget System.Data.SqlClient

// Build infrastructure
group build
source https://api.nuget.org/v3/index.json
storage: none
framework: net5.0
framework: net8.0

nuget FSharp.Core ~> 5
nuget BlackFox.Fake.BuildTask
Expand Down
Loading