Skip to content

Commit 6ee9cf0

Browse files
authored
Merge pull request #232 from hangy/align-infra
chore: Align config and build scripts to match Serilog
2 parents 74d46ea + c948263 commit 6ee9cf0

10 files changed

Lines changed: 358 additions & 143 deletions

File tree

.editorconfig

Lines changed: 38 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,51 @@
1-
[*.cs]
1+
root = true
22

3-
#Core editorconfig formatting - indentation
4-
5-
#use soft tabs (spaces) for indentation
3+
[*]
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true
66
indent_style = space
7+
indent_size = 4
8+
charset = utf-8
9+
end_of_line = lf
10+
11+
[*.{csproj,json,config,yml,props}]
12+
indent_size = 2
713

8-
#Formatting - new line options
14+
# Do not insert newline for ApiApprovalTests
15+
[*.txt]
16+
insert_final_newline = false
917

10-
#place catch statements on a new line
11-
csharp_new_line_before_catch = true
12-
#place else statements on a new line
13-
csharp_new_line_before_else = true
14-
#require finally statements to be on a new line after the closing brace
15-
csharp_new_line_before_finally = true
16-
#require braces to be on a new line for methods, control_blocks, types, object_collection, and properties (also known as "Allman" style)
17-
csharp_new_line_before_open_brace = methods, control_blocks, types, object_collection, properties
18+
[*.sh]
19+
end_of_line = lf
1820

19-
#Formatting - organize using options
21+
[*.{cmd, bat}]
22+
end_of_line = crlf
2023

21-
#sort System.* using directives alphabetically, and place them before other usings
22-
dotnet_sort_system_directives_first = true
24+
# C# formatting settings - Namespace options
25+
csharp_style_namespace_declarations = file_scoped:suggestion
2326

24-
#Formatting - spacing options
27+
csharp_style_prefer_switch_expression = true:suggestion
2528

26-
#require NO space between a cast and the value
29+
# C# formatting settings - Spacing options
2730
csharp_space_after_cast = false
28-
#require a space before the colon for bases or interfaces in a type declaration
29-
csharp_space_after_colon_in_inheritance_clause = true
30-
#require a space after a keyword in a control flow statement such as a for loop
3131
csharp_space_after_keywords_in_control_flow_statements = true
32-
#require a space before the colon for bases or interfaces in a type declaration
32+
csharp_space_between_parentheses = false
3333
csharp_space_before_colon_in_inheritance_clause = true
34-
#remove space within empty argument list parentheses
34+
csharp_space_after_colon_in_inheritance_clause = true
35+
csharp_space_around_binary_operators = before_and_after
36+
csharp_space_between_method_declaration_parameter_list_parentheses = false
37+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
38+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
39+
csharp_space_between_method_call_parameter_list_parentheses = false
3540
csharp_space_between_method_call_empty_parameter_list_parentheses = false
36-
#remove space between method call name and opening parenthesis
3741
csharp_space_between_method_call_name_and_opening_parenthesis = false
38-
#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
39-
csharp_space_between_method_call_parameter_list_parentheses = false
40-
#remove space within empty parameter list parentheses for a method declaration
41-
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
42-
#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
43-
csharp_space_between_method_declaration_parameter_list_parentheses = false
44-
45-
#Formatting - wrapping options
46-
47-
#leave code block on single line
48-
csharp_preserve_single_line_blocks = true
49-
#leave statements and member declarations on the same line
50-
csharp_preserve_single_line_statements = true
51-
52-
#Style - expression bodied member options
53-
54-
#prefer expression-bodied members for accessors
55-
csharp_style_expression_bodied_accessors = true:suggestion
56-
#prefer block bodies for methods
57-
csharp_style_expression_bodied_methods = false:suggestion
58-
#prefer expression-bodied members for properties
59-
csharp_style_expression_bodied_properties = true:suggestion
60-
61-
#Style - expression level options
62-
63-
#prefer out variables to be declared inline in the argument list of a method call when possible
64-
csharp_style_inlined_variable_declaration = true:suggestion
65-
#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
66-
dotnet_style_predefined_type_for_member_access = true:suggestion
67-
68-
#Style - implicit and explicit types
69-
70-
#prefer var is used to declare variables with built-in system types such as int
71-
csharp_style_var_for_built_in_types = true:suggestion
72-
#prefer var when the type is already mentioned on the right-hand side of a declaration expression
73-
csharp_style_var_when_type_is_apparent = true:suggestion
74-
75-
#Style - language keyword and framework type options
76-
77-
#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them
78-
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
79-
80-
#Style - qualification options
81-
82-
#prefer fields not to be prefaced with this. or Me. in Visual Basic
83-
dotnet_style_qualification_for_field = false:suggestion
84-
#prefer methods not to be prefaced with this. or Me. in Visual Basic
85-
dotnet_style_qualification_for_method = false:suggestion
86-
#prefer properties not to be prefaced with this. or Me. in Visual Basic
87-
dotnet_style_qualification_for_property = false:suggestion
42+
csharp_space_after_comma = true
43+
csharp_space_before_comma = false
44+
csharp_space_after_dot = false
45+
csharp_space_before_dot = false
46+
csharp_space_after_semicolon_in_for_statement = true
47+
csharp_space_before_semicolon_in_for_statement = false
48+
csharp_space_around_declaration_statements = false
49+
csharp_space_before_open_square_brackets = false
50+
csharp_space_between_empty_square_brackets = false
51+
csharp_space_between_square_brackets = false

.github/workflows/build.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# If this file is renamed, the incrementing run attempt number will be reset.
2+
3+
name: CI
4+
5+
on:
6+
push:
7+
branches: [ "dev", "main" ]
8+
pull_request:
9+
branches: [ "dev", "main" ]
10+
11+
env:
12+
CI_BUILD_NUMBER_BASE: ${{ github.run_number }}
13+
CI_TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
14+
15+
jobs:
16+
build:
17+
18+
# The build must run on Windows so that .NET Framework targets can be built and tested.
19+
runs-on: windows-latest
20+
21+
permissions:
22+
contents: write
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Setup
27+
uses: actions/setup-dotnet@v4
28+
with:
29+
global-json-file: global.json
30+
- name: Compute build number
31+
shell: bash
32+
run: |
33+
echo "CI_BUILD_NUMBER=$(($CI_BUILD_NUMBER_BASE+2300))" >> $GITHUB_ENV
34+
- name: Build and Publish
35+
env:
36+
DOTNET_CLI_TELEMETRY_OPTOUT: true
37+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
38+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
shell: pwsh
40+
run: |
41+
./Build.ps1

0 commit comments

Comments
 (0)