From 17d1fb37a77c33292fb9947debd19a7e82fd9911 Mon Sep 17 00:00:00 2001 From: Gitii Date: Sun, 12 Jun 2022 16:06:46 +0200 Subject: [PATCH] Update config (#13) --- .config/dotnet-tools.json | 2 +- .editorconfig | 21 ++++++++++++------ .github/workflows/release.yml | 2 +- .gitignore | 41 +++-------------------------------- .onsaveconfig | 17 ++++++++++++++- .prettierignore | 4 ++++ Directory.Build.props | 6 ++--- 7 files changed, 42 insertions(+), 51 deletions(-) create mode 100644 .prettierignore diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index d6491df..c0c170f 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "csharpier": { - "version": "0.14.0", + "version": "0.16.0", "commands": ["dotnet-csharpier"] }, "packedprettier": { diff --git a/.editorconfig b/.editorconfig index efba069..5d170ba 100644 --- a/.editorconfig +++ b/.editorconfig @@ -51,8 +51,8 @@ dotnet_style_readonly_field = true:suggestion dotnet_style_object_initializer = true:suggestion dotnet_style_collection_initializer = true:suggestion dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_null_propagation =true:error -dotnet_style_coalesce_expression =true:error +dotnet_style_null_propagation = true:error +dotnet_style_coalesce_expression = true:error dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion @@ -67,7 +67,7 @@ dotnet_naming_style.pascal_case_style.capitalization = pascal_case # Use PascalCase for constant fields dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields -dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style dotnet_naming_symbols.constant_fields.applicable_kinds = field dotnet_naming_symbols.constant_fields.applicable_accessibilities = * dotnet_naming_symbols.constant_fields.required_modifiers = const @@ -76,7 +76,9 @@ dotnet_diagnostic.CA1823.severity=error dotnet_diagnostic.CA1836.severity=error dotnet_style_namespace_match_folder=true:error dotnet_style_allow_multiple_blank_lines_experimental=true:error -dotnet_diagnostic.VSTHRD111.severity=error +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion ############################### # C# Coding Conventions # ############################### @@ -101,7 +103,7 @@ csharp_style_conditional_delegate_call = true:suggestion # Modifier preferences csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion # Expression-level preferences -csharp_prefer_braces =true:error +csharp_prefer_braces = true:error csharp_style_deconstructed_variable_declaration = true:suggestion csharp_prefer_simple_default_expression = true:suggestion csharp_style_pattern_local_over_anonymous_function = true:suggestion @@ -155,7 +157,7 @@ dotnet_diagnostic.VSTHRD200.severity = error dotnet_diagnostic.MA0048.severity = error # MA0004: Use Task.ConfigureAwait(false) -dotnet_diagnostic.MA0004.severity =silent +dotnet_diagnostic.MA0004.severity = error # CS8618: Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. dotnet_diagnostic.CS8618.severity = error @@ -171,8 +173,13 @@ dotnet_diagnostic.MA0044.severity=error # VSTHRD001: Avoid legacy thread switching APIs dotnet_diagnostic.VSTHRD001.severity = none -csharp_style_namespace_declarations=file_scoped:error +csharp_style_namespace_declarations= file_scoped:error csharp_style_unused_value_assignment_preference=discard_variable:error +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent [*.vb] # Modifier preferences diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 011555a..c960d19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: uses: softprops/action-gh-release@v1 with: files: "./nuget/*.nupkg" - prerelease: ${{ endsWith(steps.tagName.outputs.tag, '[-][\w\d]+') }} + prerelease: ${{ contains(steps.tagName.outputs.tag, '-') }} - name: Push packages to Nuget registry run: dotnet nuget push $(Get-ChildItem -Path ./nuget -Filter "*.nupkg").FullName --source "https://api.nuget.org/v3/index.json" --api-key "$env:NUGET_API_KEY" --skip-duplicate env: diff --git a/.gitignore b/.gitignore index f1d86b2..d1fd628 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +/wsl-sdk-dotnet + # User-specific files *.rsuser *.suo @@ -23,7 +25,6 @@ mono_crash.* [Rr]eleases/ x64/ x86/ -[Ww][Ii][Nn]32/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ @@ -62,9 +63,6 @@ project.lock.json project.fragment.lock.json artifacts/ -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - # StyleCop StyleCopReport.xml @@ -90,7 +88,6 @@ StyleCopReport.xml *.tmp_proj *_wpftmp.csproj *.log -*.tlog *.vspscc *.vssscc .builds @@ -147,7 +144,6 @@ coverage*.json coverage*.xml coverage*.info CoverageReport - # Visual Studio code coverage results *.coverage *.coveragexml @@ -185,7 +181,7 @@ publish/ *.azurePubxml # Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted -# *.pubxml # <- should be included! +*.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to @@ -207,9 +203,6 @@ PublishScripts/ *.nuget.props *.nuget.targets -# Nuget personal access tokens and Credentials -nuget.config - # Microsoft Azure Build Output csx/ *.build.csdef @@ -362,31 +355,3 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -# VS Code files for those working on multiple tools -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace - -# Local History for Visual Studio Code -.history/ - -# Windows Installer files from build outputs -*.cab -*.msi -*.msix -*.msm -*.msp - -# JetBrains Rider -.idea/ -*.sln.iml - -runtimes -ref diff --git a/.onsaveconfig b/.onsaveconfig index 5e3bbc5..fba8841 100644 --- a/.onsaveconfig +++ b/.onsaveconfig @@ -1,4 +1,19 @@ -# run dotnet csharpier on C# files, whenever they're saved. [*.cs] command = dotnet arguments = csharpier "{file}" +always_run = true + +[*.{js,ts,css,less,scss,vue,json,gql,md,yml,yaml,html,htm}] +command = dotnet +arguments = pprettier --write "{file}" +always_run = true + +[*.{xml,csproj,xaml,appxmanifest,props,wapproj}] +command = dotnet +arguments = pprettier --write "{file}" --plugin "/@prettier/plugin-xml" --parser "xml" --print-width 120 --xml-whitespace-sensitivity "ignore" --tab-width 4 +always_run = true + +[*.sh] +command = dotnet +arguments = pprettier --write "{file}" --plugin "/prettier-plugin-sh" +always_run = true diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..5e8cbf6 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +bin/ +obj/ +.vs/ +.git/ diff --git a/Directory.Build.props b/Directory.Build.props index 111f08a..65dfc20 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -12,15 +12,15 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers - + all runtime; build; native; contentfiles; analyzers