Skip to content

Commit

Permalink
FSharpLint: upgrade to latest version 0.21.3 (#53)
Browse files Browse the repository at this point in the history
Enabling FavourStaticEmptyFields rule (new in this version).
  • Loading branch information
parhamsaremi authored Nov 24, 2022
1 parent 3b8649f commit eb0fd5f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: dotnet build --configuration Release --no-restore
- name: fsharpLint
run: |
dotnet tool install --global dotnet-fsharplint --version 0.21.2
dotnet tool install --global dotnet-fsharplint --version 0.21.3
# path taken from https://stackoverflow.com/a/65367006/544947
$HOME/.dotnet/tools/dotnet-fsharplint lint NOnion.sln
Expand Down
2 changes: 1 addition & 1 deletion NOnion/Cells/CellAuthChallenge.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type CellAuthChallenge =

let challenge = reader.ReadBytes Constants.ChallangeLength
let methodsCount = ReadBigEndianUInt16 reader |> int
let methods = readMethod [] methodsCount
let methods = readMethod List.Empty methodsCount

{
Challenge = challenge
Expand Down
6 changes: 3 additions & 3 deletions NOnion/Http/TorHttpClient.fs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type TorHttpClient(stream: TorStream, host: string) =
"Accept-Encoding", supportedCompressionAlgorithms
]
|> List.map(fun (k, v) -> sprintf "%s: %s\r\n" k v)
|> String.concat ""
|> String.concat String.Empty

do!
sprintf "GET %s HTTP/1.0\r\n%s\r\n" path headers
Expand Down Expand Up @@ -134,7 +134,7 @@ type TorHttpClient(stream: TorStream, host: string) =
"Content-Length", payload.Length.ToString()
]
|> List.map(fun (k, v) -> sprintf "%s: %s\r\n" k v)
|> String.concat ""
|> String.concat String.Empty

do!
sprintf "POST %s HTTP/1.0\r\n%s\r\n%s" path headers payload
Expand Down Expand Up @@ -187,7 +187,7 @@ type TorHttpClient(stream: TorStream, host: string) =
|> Map.ofArray

match headersMap.TryGetValue "Content-Encoding" with
| false, _ when body.Length = 0 -> return ""
| false, _ when body.Length = 0 -> return String.Empty
| false, _ ->
return failwith "PostString: Content-Encoding header is missing"
| true, "identity" -> return body |> Encoding.UTF8.GetString
Expand Down
8 changes: 6 additions & 2 deletions NOnion/Utility/Base32Util.fs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ module Base32Util =
| x0 :: [] -> result @ quintupletToList 1 (x0, 0uy, 0uy, 0uy, 0uy)
| [] -> result

data |> Array.toList |> parse [] |> List.toArray |> System.String.Concat
data
|> Array.toList
|> parse List.Empty
|> List.toArray
|> System.String.Concat

/// Decodes a Base32 string to a UTF8 string
let DecodeBase32 text =
Expand Down Expand Up @@ -163,4 +167,4 @@ module Base32Util =
tail
| _ -> result

[ for c in text -> c ] |> parse [] |> List.toArray
[ for c in text -> c ] |> parse List.Empty |> List.toArray
1 change: 1 addition & 0 deletions fsharplint.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
"tupleOfWildcards": { "enabled": true },
"favourTypedIgnore": { "enabled": true },
"favourReRaise": { "enabled": true },
"favourStaticEmptyFields": { "enabled": true },
"favourConsistentThis": {
"enabled": true,
"config": {
Expand Down

0 comments on commit eb0fd5f

Please sign in to comment.