Skip to content

Commit

Permalink
CI: add a fantomas step
Browse files Browse the repository at this point in the history
To avoid, from the start, potential bikeshedding debates about
style in PRs.
  • Loading branch information
siwatanejo committed Mar 14, 2024
1 parent aeb150c commit e737fea
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .editorconfig
@@ -0,0 +1,45 @@
[*]
insert_final_newline=true

[*.{fs,fsx,ts}]
end_of_line=lf
indent_size=4
max_line_length=80
fsharp_semicolon_at_end_of_line=false
fsharp_space_before_parameter=false
fsharp_space_before_lowercase_invocation=false
fsharp_space_before_uppercase_invocation=false
fsharp_space_before_class_constructor=false
fsharp_space_before_member=false
fsharp_space_before_colon=false
fsharp_space_after_comma=true
fsharp_space_before_semicolon=false
fsharp_space_after_semicolon=true
fsharp_indent_on_try_with=false
fsharp_space_around_delimiter=true
fsharp_max_if_then_else_short_width=0
fsharp_max_infix_operator_expression=80
fsharp_max_record_width=0
fsharp_max_function_binding_width=0
fsharp_max_value_binding_width=80
fsharp_multiline_block_brackets_on_same_column=true
fsharp_newline_between_type_definition_and_members=true
fsharp_keep_if_then_in_same_line=true
fsharp_strict_mode=false
fsharp_multi_line_lambda_closing_newline=true
fsharp_disable_elmish_syntax=true

# Xml project files
[*.{csproj,fsproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
indent_size = 2

# Xml config files
[*.{props,targets,config,nuspec}]
indent_size = 2

# Shell scripts
[*.sh]
end_of_line = lf

[*.{cmd, bat}]
end_of_line = crlf
34 changes: 34 additions & 0 deletions .github/workflows/CI.yml
Expand Up @@ -92,3 +92,37 @@ jobs:
- name: Test snap
run: packwallet

conventions:
needs:
- integration_tests
- run_snap

runs-on: ubuntu-22.04
container:
image: "ubuntu:22.04"

steps:
- uses: actions/checkout@v1
- name: Install required dependencies
run: |
apt update
apt install --yes sudo
sudo apt install --yes --no-install-recommends git
# workaround for https://github.com/actions/runner/issues/2033
git config --global --add safe.directory '*'
- name: Setup .NET
run: |
# We need to install `ca-certificates`, otherwise we get these errors in the CI:
# Unable to load the service index for source https://api.nuget.org/v3/index.json.
# The SSL connection could not be established, see inner exception.
# The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot
apt install --yes --no-install-recommends ca-certificates
apt install --yes --no-install-recommends dotnet6
- name: fantomas
run: |
dotnet new tool-manifest
dotnet tool install fantomas --version 6.2.3
dotnet fantomas .
git diff --exit-code
5 changes: 3 additions & 2 deletions src/PackWallet/Program.fs
@@ -1,7 +1,8 @@
open System.Net.Http
open FSharp.Data

type CoindDeskProvider = JsonProvider<"""
type CoindDeskProvider =
JsonProvider<"""
{
"time": {
"updated": "Feb 25, 2024 12:27:26 UTC",
Expand Down Expand Up @@ -42,7 +43,7 @@ let address = "https://api.coindesk.com/v1/bpi/currentprice.json"

printfn "Retrieving contents of %s ...\n" address

let contents =
let contents =
webClient.GetStringAsync address
|> Async.AwaitTask
|> Async.RunSynchronously
Expand Down

0 comments on commit e737fea

Please sign in to comment.