Skip to content

Commit

Permalink
Allow '_' and '-' in named placeholders. (#71)
Browse files Browse the repository at this point in the history
Fixes 69
  • Loading branch information
dawedawe authored Jan 31, 2024
1 parent cea87fa commit 10808cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

* Removed the PartialAppAnalyzer. [#68](https://github.com/G-Research/fsharp-analyzers/issues/68)

### Fixed
* Fixed a false positive of LoggingTemplateMissingValuesAnalyzer. [#69](https://github.com/G-Research/fsharp-analyzers/issues/69)

## 0.8.0 - 2024-01-30

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let analyze (typedTree : FSharpImplementationFileContents) =
"Microsoft.Extensions.Logging.LoggerExtensions.LogWarning"
]

let pattern = @"(?<opening>{+)[a-zA-Z0-9]*(?<closing>}+)"
let pattern = @"(?<opening>{+)[a-zA-Z0-9_-]*(?<closing>}+)"
let regex = Regex pattern

let walker =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module M

open Microsoft.Extensions.Logging

let testlog () =
use factory = LoggerFactory.Create(fun b -> b.AddConsole() |> ignore)
let logger: ILogger = factory.CreateLogger("Program")

logger.Log(LogLevel.Information, "xxx {o-ne} yyy {t_wo}", 23, 42)

0 comments on commit 10808cb

Please sign in to comment.