Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Format F# code with Fantomas #769

Merged
merged 28 commits into from
Dec 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b8a3330
Format F# code with Fantomas
Dec 7, 2020
b6ef84a
Set fsharp_max_infix_operator_expression = 100
Dec 8, 2020
f5a496f
Set fsharp_max_value_binding_width = 80
Dec 8, 2020
b979510
Set fsharp_max_dot_get_expression_width = 100
Dec 8, 2020
8181e4a
Set fsharp_max_record_width = 80
Dec 8, 2020
c087cbd
Reformat based on main
Dec 8, 2020
fdfa21c
Apply trim_trailing_whitespace to *, indent_size = 4 to *.fs
Dec 8, 2020
90a47cb
Remove unneeded new line
Dec 8, 2020
2473f18
Merge remote-tracking branch 'origin/main' into samarsha/fantomas
Dec 9, 2020
d94a764
Replace "x |> function" with "match x with"
Dec 9, 2020
3de974d
Reformat ClassicalControlTests.fs
Dec 9, 2020
4a970a0
Merge branch 'main' into samarsha/fantomas
bamarsha Dec 9, 2020
92d8d86
Merge remote-tracking branch 'origin/main' into samarsha/fantomas
Dec 10, 2020
8b5128a
Reformat CompilationTrackerTests.fs
Dec 10, 2020
83c5c95
fsharp_multiline_block_brackets_on_same_column = true; fsharp_max_arr…
Dec 10, 2020
81c8d78
Work around Fantomas bugs
Dec 11, 2020
2c6a9fd
Refactor to work around Fantomas bugs
Dec 11, 2020
ff4f053
Update to Fantomas 4.3.0-alpha-001
Dec 11, 2020
670f54f
Add Fantomas check to CI
Dec 11, 2020
3820c6c
Bad style test
Dec 11, 2020
9bde4e7
Revert "Bad style test"
Dec 11, 2020
182d972
Restore .NET tools from init.yml instead of bootstrap.ps1
Dec 11, 2020
3ebaea2
fsharp_max_record_number_of_items = 2
Dec 11, 2020
ca19314
Revert workarounds no longer needed with Fantomas 4.3
Dec 11, 2020
fd3c676
Simpler workaround for CheckDeclarations
Dec 11, 2020
a79d6fb
fsharp_max_value_binding_width = 100
Dec 11, 2020
6d86ec5
Remove un-needed newline
Dec 11, 2020
cf66037
Re-add missing comment
Dec 12, 2020
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
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"fantomas-tool": {
"version": "4.3.0-alpha-001",
"commands": [
"fantomas"
]
}
}
}
13 changes: 12 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ root = true
[*]
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.cs]
indent_size = 4
trim_trailing_whitespace = true

dotnet_style_qualification_for_event = true:suggestion
dotnet_style_qualification_for_field = true:suggestion
Expand Down Expand Up @@ -54,3 +54,14 @@ dotnet_diagnostic.SA1629.severity = none # Documentation text should end
dotnet_diagnostic.SA1633.severity = none # File should have header
dotnet_diagnostic.SA1642.severity = none # Constructor summary documentation should begin with standard text
dotnet_diagnostic.SA1649.severity = none # File name should match first type name

[*.fs]
indent_size = 4

fsharp_max_array_or_list_width = 80
fsharp_max_dot_get_expression_width = 100
fsharp_max_infix_operator_expression = 100
fsharp_max_record_number_of_items = 2
fsharp_max_value_binding_width = 100
fsharp_multiline_block_brackets_on_same_column = true
fsharp_record_multiline_formatter = number_of_items
5 changes: 4 additions & 1 deletion build/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ steps:
displayName: 'Use .NET Core SDK 3.1.300'
inputs:
packageType: sdk
version: '3.1.300'
version: '3.1.300'

- script: dotnet tool restore
displayName: 'Restore .NET tools'
4 changes: 4 additions & 0 deletions build/steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ steps:
- template: init.yml


- script: dotnet tool run fantomas -- --check --recurse .
displayName: "Check style"


- pwsh: ./build.ps1
displayName: "Build all"
workingDirectory: $(System.DefaultWorkingDirectory)/build
Expand Down
36 changes: 18 additions & 18 deletions src/Common/DelaySign.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@

module internal SigningConstants

open System.Reflection
open System.Reflection

#if SIGNED
// Attributes for delay-signing
[<assembly:AssemblyKeyFile("..\\..\\..\\build\\267DevDivSNKey2048.snk")>]
[<assembly:AssemblyDelaySign(true)>]
// Attributes for delay-signing
[<assembly: AssemblyKeyFile("..\\..\\..\\build\\267DevDivSNKey2048.snk")>]
[<assembly: AssemblyDelaySign(true)>]

do
()
do ()
#endif

#if SIGNED
[<Literal>]
let PUBLIC_KEY = ", PublicKey=" +
"002400000c800000140100000602000000240000525341310008000001000100613399aff18ef1" +
"a2c2514a273a42d9042b72321f1757102df9ebada69923e2738406c21e5b801552ab8d200a65a2" +
"35e001ac9adc25f2d811eb09496a4c6a59d4619589c69f5baf0c4179a47311d92555cd006acc8b" +
"5959f2bd6e10e360c34537a1d266da8085856583c85d81da7f3ec01ed9564c58d93d713cd0172c" +
"8e23a10f0239b80c96b07736f5d8b022542a4e74251a5f432824318b3539a5a087f8e53d2f135f" +
"9ca47f3bb2e10aff0af0849504fb7cea3ff192dc8de0edad64c68efde34c56d302ad55fd6e80f3" +
"02d5efcdeae953658d3452561b5f36c542efdbdd9f888538d374cef106acf7d93a4445c3c73cd9" +
"11f0571aaf3d54da12b11ddec375b3"
[<Literal>]
let PUBLIC_KEY =
", PublicKey="
+ "002400000c800000140100000602000000240000525341310008000001000100613399aff18ef1"
+ "a2c2514a273a42d9042b72321f1757102df9ebada69923e2738406c21e5b801552ab8d200a65a2"
+ "35e001ac9adc25f2d811eb09496a4c6a59d4619589c69f5baf0c4179a47311d92555cd006acc8b"
+ "5959f2bd6e10e360c34537a1d266da8085856583c85d81da7f3ec01ed9564c58d93d713cd0172c"
+ "8e23a10f0239b80c96b07736f5d8b022542a4e74251a5f432824318b3539a5a087f8e53d2f135f"
+ "9ca47f3bb2e10aff0af0849504fb7cea3ff192dc8de0edad64c68efde34c56d302ad55fd6e80f3"
+ "02d5efcdeae953658d3452561b5f36c542efdbdd9f888538d374cef106acf7d93a4445c3c73cd9"
+ "11f0571aaf3d54da12b11ddec375b3"
#else
[<Literal>]
let PUBLIC_KEY = ""
[<Literal>]
let PUBLIC_KEY = ""
#endif
2 changes: 1 addition & 1 deletion src/QsCompiler/Core/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ open System.Runtime.CompilerServices

[<assembly: InternalsVisibleTo("Tests.Microsoft.Quantum.QsCompiler" + SigningConstants.PUBLIC_KEY)>]

do ()
do ()
Loading