Upgrade Fantomas and add Woodpecker build

This commit is contained in:
Smaug123
2023-08-04 21:34:13 +01:00
parent a67ff75dc4
commit 2fe35b4ab6
6 changed files with 34 additions and 6 deletions

View File

@@ -13,12 +13,13 @@ indent_style=space
indent_size=2
[*.{fs,fsi}]
fsharp_bar_before_discriminated_union_declaration=true
fsharp_space_before_uppercase_invocation=true
fsharp_space_before_class_constructor=true
fsharp_space_before_member=true
fsharp_space_before_colon=true
fsharp_space_before_semicolon=true
fsharp_multiline_block_brackets_on_same_column=true
fsharp_multiline_bracket_style=aligned
fsharp_newline_between_type_definition_and_members=true
fsharp_align_function_signature_to_indentation=true
fsharp_alternative_long_member_definitions=true
@@ -26,6 +27,6 @@ fsharp_multi_line_lambda_closing_newline=true
fsharp_experimental_keep_indent_in_branch=true
fsharp_max_value_binding_width=80
fsharp_max_record_width=0
fsharp_bar_before_discriminated_union_declaration=true
max_line_length=120
end_of_line=lf

View File

@@ -26,4 +26,4 @@ jobs:
- name: Install Fantomas
run: dotnet tool restore
- name: Run Fantomas
run: dotnet tool run fantomas --check -r .
run: dotnet tool run fantomas --check .

View File

@@ -0,0 +1,10 @@
steps:
echo:
image: alpine
commands:
- echo "All required checks complete"
depends_on:
- build
skip_clone: true

17
.woodpecker/.build.yml Normal file
View File

@@ -0,0 +1,17 @@
steps:
build:
image: nixos/nix
commands:
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
# Lint
- nix develop --command dotnet -- tool restore
- nix develop --command ./hooks/pre-push
# Test
- nix develop --command dotnet -- test
- nix develop --command dotnet -- test --configuration Release
# Perform build
- "pushd RaftFable && nix develop --command npm -- install && popd"
- "pushd RaftFable && nix develop --command npm -- run-script webpack && popd"
when:
evaluate: '(CI_PIPELINE_EVENT == "push" && CI_COMMIT_BRANCH == CI_REPO_DEFAULT_BRANCH) || (CI_PIPELINE_EVENT == "pull_request")'

View File

@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"fantomas": {
"version": "5.1.0",
"version": "6.1.2",
"commands": [
"fantomas"
]

View File

@@ -3,10 +3,10 @@
import subprocess
def check_fantomas():
result = subprocess.run(["dotnet", "tool", "run", "fantomas", "--check", "-r", "."])
result = subprocess.run(["dotnet", "tool", "run", "fantomas", "--check", "."])
if result.returncode != 0:
print(result.stdout)
raise Exception(f"Formatting incomplete (return code: {result.returncode}). Consider running `dotnet tool run fantomas -r .`")
raise Exception(f"Formatting incomplete (return code: {result.returncode}). Consider running `dotnet tool run fantomas .`")
def check_alejandra():