Skip to content

Commit

Permalink
Merge branch 'main' into ivarne/GenericFormDataValidator-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
martinothamar committed May 30, 2024
2 parents b6c0cc6 + 8774f95 commit 7e0e6c8
Show file tree
Hide file tree
Showing 620 changed files with 33,257 additions and 26,129 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.28.1",
"version": "0.28.2",
"commands": [
"dotnet-csharpier"
]
Expand Down
113 changes: 75 additions & 38 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,74 +10,89 @@ indent_style = space
indent_size = 4
max_line_length = 120

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

[*.{cs,vb}]
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

#### Naming styles ####
end_of_line = crlf

# Naming rules
#### Naming styles ####

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
# Interfaces start with 'I'
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
# Types should be PascalCase
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum, namespace, delegate
dotnet_naming_rule.types_should_be_pascal_case.severity = warning
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
# Non-private members should be PascalCase
dotnet_naming_symbols.non_private_members.applicable_kinds = property, event, field
dotnet_naming_symbols.non_private_members.applicable_accessibilities = public, internal, protected, protected_internal
dotnet_naming_rule.non_private_members_should_be_pascal_case.severity = warning
dotnet_naming_rule.non_private_members_should_be_pascal_case.symbols = non_private_members
dotnet_naming_rule.non_private_members_should_be_pascal_case.style = pascal_case

# All methods should be PascalCase
dotnet_naming_symbols.methods.applicable_kinds = method, local_function
dotnet_naming_rule.methods_should_be_pascal_case.severity = warning
dotnet_naming_rule.methods_should_be_pascal_case.symbols = methods
dotnet_naming_rule.methods_should_be_pascal_case.style = pascal_case

# Private member should be '_' prefixed and camelCase
dotnet_naming_symbols.private_members.applicable_kinds = property, event, field
dotnet_naming_symbols.private_members.applicable_accessibilities = private, private_protected
dotnet_naming_style.__prefixed_camel_case.required_prefix = _
dotnet_naming_style.__prefixed_camel_case.required_suffix =
dotnet_naming_style.__prefixed_camel_case.word_separator =
dotnet_naming_style.__prefixed_camel_case.capitalization = camel_case
dotnet_naming_rule.private_members_should_be___prefixed_camel_case.severity = warning
dotnet_naming_rule.private_members_should_be___prefixed_camel_case.symbols = private_members
dotnet_naming_rule.private_members_should_be___prefixed_camel_case.style = __prefixed_camel_case

# Const fields should be PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const


# General naming styles

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
max_line_length = 160
end_of_line = crlf
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion

[*.cs]
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations= file_scoped:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_methods = false:silent
Expand All @@ -90,6 +105,28 @@ csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_indent_labels = one_less_than_current
csharp_style_prefer_primary_constructors = false:suggestion
csharp_style_namespace_declarations = file_scoped:error

# Naming rule violation
dotnet_diagnostic.IDE1006.severity = error

# Unused usings
dotnet_diagnostic.IDE0005.severity = suggestion

# CA1848: Use the LoggerMessage delegates
dotnet_diagnostic.CA1848.severity = none

# CA1727: Use PascalCase for named placeholders
dotnet_diagnostic.CA1727.severity = suggestion

# CA2254: Template should be a static expression
dotnet_diagnostic.CA2254.severity = none

# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = suggestion

# IDE0080: Remove unnecessary suppression operator
dotnet_diagnostic.IDE0080.severity = error

[Program.cs]
dotnet_diagnostic.CA1050.severity = none
Expand Down
20 changes: 20 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Run this command to always ignore formatting commits in `git blame`
# git config blame.ignoreRevsFile .git-blame-ignore-revs

# More info:
# https://www.stefanjudis.com/today-i-learned/how-to-exclude-commits-from-git-blame/
# Also, a horrible bash script to list out the 20 commits with the most files changed:
# git log --pretty='@%h' --shortstat | grep -v \| | tr "\n" " " | tr "@" "\n" | sed 's/,.*//' | sort -k2 -n | tail -n 20 | awk '{print "echo $(git log -1 --format=\"%H # %s\" " $1 ") - " $2 " files changed"}' | bash

c55ab47f969a67a054b70ee7c82201b2e1f17388 # Altinn app platform services renaming (#3146) - 99 files changed
9a75afa100f7635c18f82f5c821e281fb6495e2d # Remove BOM on C# files now that .editorconfig states that BOM should not be used (#620) - 137 files changed
7f562dd57fe7c0299d29f2312b7a84ef170fca78 # Add pipeline job to verify clean dotnet format (#455) - 186 files changed
5fa3778bd09ed608cdc563e8ee15ff1b9de31201 # Csharpier for more consistent formatting (#533) - 471 files changed
f1ed9343c6345cf3f72bd3b9b38946176c377013 # Misc project cleanup - props, editorconfig, refactorings, docs (#661) - 482 files changed

# Optional ignores. Stuff that absolutely do make code changes, but make a lot of code changes (which you might want
# to ignore, depending on what you're looking for). Comment these in if you need them to be ignored:
# c40e14cb84b571952981940f5871b6a349f3ad0d # merge main into v8 (#284) - 174 files changed
# f30340be522c3d6595ebc3b5a211efda439af126 # Enable nullable annotations on Api and Core.Tests (#447) - 171 files changed
# d9847039cbb79e1bac307c1cc004ff3d92243c4d # Feature/unittestcleanupapp (#3672) - 111 files changed
# 590e7751010bb7786f5b492b439100d387689b5f # Chore/90 appbase simplified (#18) - 255 files changed
10 changes: 5 additions & 5 deletions .github/workflows/dotnet-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
analyze:
strategy:
matrix:
os: [macos-latest,windows-latest,ubuntu-latest] # TODO: Fix test to run on ubuntu-latest also
os: [macos-latest, windows-latest, ubuntu-latest]
name: Run dotnet build and test
runs-on: ${{ matrix.os}}
env:
env:
DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE: false
steps:
- name: Setup .NET
Expand All @@ -25,10 +25,10 @@ jobs:
8.0.x
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Build
run: |
dotnet build AppLibDotnet.sln -v m
dotnet build AppLibDotnet.sln -v m
- name: Test
run: |
dotnet test AppLibDotnet.sln -v m
dotnet test AppLibDotnet.sln -v m --no-restore --no-build
3 changes: 1 addition & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ jobs:
dotnet build --configuration Release --no-restore -p:Deterministic=true -p:BuildNumber=${{ github.run_number }}
- name: Pack
run: |
dotnet pack AppLibDotnet.sln --configuration Release --no-restore --no-build -p:BuildNumber=${{ github.run_number }} -p:Deterministic=true
dotnet pack AppLibDotnet.sln --configuration Release --no-restore --no-build -p:Deterministic=true -p:BuildNumber=${{ github.run_number }}
- name: Versions
run: |
dotnet --version
- name: Publish
run: |
dotnet nuget push src/**/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"redhat.vscode-yaml",
"ms-dotnettools.csdevkit"
]
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"[csharp]": {
"editor.defaultFormatter": "csharpier.csharpier-vscode",
"editor.formatOnSave": true
}
},
"[github-actions-workflow]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
}
Loading

0 comments on commit 7e0e6c8

Please sign in to comment.