diff --git a/.editorconfig b/.editorconfig index 8f5d99704ba..a1a89b95ae4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -74,3 +74,52 @@ indent_size = 4 end_of_line = crlf trim_trailing_whitespace = true insert_final_newline = false + +# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/formatting-rules +[*.cs] +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true +# indentation options +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = one_less_than_current +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents_when_block = false +# spacing +csharp_space_after_cast = false +csharp_space_after_keywords_in_control_flow_statements = true +#csharp_space_between_parentheses = control_flow_statements, type_casts, expressions +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_after_comma = true +csharp_space_before_comma = false +csharp_space_after_dot = false +csharp_space_before_dot = false +csharp_space_after_semicolon_in_for_statement = true +csharp_space_before_semicolon_in_for_statement = false +csharp_space_around_declaration_statements = false +csharp_space_before_open_square_brackets = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_square_brackets = false +# wrap options +csharp_preserve_single_line_statements = true +csharp_preserve_single_line_blocks = true +# using directives +#csharp_using_directive_placement = outside_namespace +# dotnet options +#dotnet_sort_system_directives_first = true + +#dotnet_separate_import_directive_groups = false diff --git a/.repoconfig b/.repoconfig index 2c1ef5c283b..6c57a0e1d9c 100644 --- a/.repoconfig +++ b/.repoconfig @@ -1,5 +1,6 @@ [version] -repoconfig=5 +repoconfig=7 +minimum-unity-meta=47 [format] path-ignore=< ~/.hgrc" - - hg clone -u stable http://hg-mirror-slo.hq.unity3d.com/unity-extra/unity-meta ~/unity-meta - - perl ~/unity-meta/Tools/Format/format.pl --reporoot $(pwd) --preview . - - cat ./format.patch - - perl ~/unity-meta/Tools/Format/format.pl --reporoot $(pwd) --dry-run . # Run a 2nd time to actually "fail" the job if there are formatting diffs (--preview always exits with 0) - timeout: 1 - triggers: - expression: pull_request.target eq "master" - artifacts: - diff: - paths: - - format.patch + name: Formatting + agent: + type: Unity::VM + image: package-ci/ubuntu:v1.3.1-719011 + flavor: b1.small + commands: + - "echo -e \"[extensions]\nlargefiles=\n\" > ~/.hgrc" + - hg clone -u beta http://hg-mirror-slo.hq.unity3d.com/unity-extra/unity-meta ~/unity-meta + - perl ~/unity-meta/Tools/Format/format.pl --nobackups . + - git diff --output ./format.patch + - cat ./format.patch + - | # Checking if there is a diff, to fail the job if yes (-s check means does the file contain something) + if [ -s format.patch ]; then exit 1; fi + timeout: 1 + triggers: + expression: pull_request.target eq "master" + artifacts: + diff: + paths: + - format.patch formatting_apply: - name: Formatting (Apply requested changes) - agent: - type: Unity::VM - image: package-ci/ubuntu:v1.3.1-719011 - flavor: b1.small - commands: - - git config --global user.name "noreply@unity3d.com" - - git config --global user.email "noreply@unity3d.com" - - git checkout $GIT_BRANCH - - git pull origin $GIT_BRANCH # In case the job was not run on the latest commit, attempt to get it. There may be situations with merge conflicts, in that case wait for everyone to push their changes and then only run the formatting job on HEAD. - - "echo -e \"[extensions]\nlargefiles=\n\" > ~/.hgrc" - - hg clone -u stable http://hg-mirror-slo.hq.unity3d.com/unity-extra/unity-meta ~/unity-meta - - perl ~/unity-meta/Tools/Format/format.pl --reporoot $(pwd) --nobackups . - - git add . - - git commit -m "Apply formatting changes" - - git push --set-upstream origin $GIT_BRANCH - timeout: 1 + name: Formatting (Apply requested changes) + agent: + type: Unity::VM + image: package-ci/ubuntu:v1.3.1-719011 + flavor: b1.small + commands: + - git config --global user.name "noreply@unity3d.com" + - git config --global user.email "noreply@unity3d.com" + - git checkout $GIT_BRANCH + - git pull origin $GIT_BRANCH # In case the job was not run on the latest commit, attempt to get it. There may be situations with merge conflicts, in that case wait for everyone to push their changes and then only run the formatting job on HEAD. + - "echo -e \"[extensions]\nlargefiles=\n\" > ~/.hgrc" + - hg clone -u beta http://hg-mirror-slo.hq.unity3d.com/unity-extra/unity-meta ~/unity-meta + - perl ~/unity-meta/Tools/Format/format.pl --nobackups . + - git add . + - git commit -m "Apply formatting changes" + - git push --set-upstream origin $GIT_BRANCH + timeout: 1 diff --git a/com.unity.render-pipelines.universal/Editor/Converter/ReadonlyMaterialConverter.cs b/com.unity.render-pipelines.universal/Editor/Converter/ReadonlyMaterialConverter.cs index 497e8a8fba0..0bd6694463a 100644 --- a/com.unity.render-pipelines.universal/Editor/Converter/ReadonlyMaterialConverter.cs +++ b/com.unity.render-pipelines.universal/Editor/Converter/ReadonlyMaterialConverter.cs @@ -48,7 +48,7 @@ public override void OnInitialize(InitializeConverterContext ctx, Action callbac { var context = Search.SearchService.CreateContext("asset", "urp:convert-readonly"); - Search.SearchService.Request(context, (c, items) => + Search.SearchService.Request(context, (c, items) => { // we're going to do this step twice in order to get them ordered, but it should be fast var orderedRequest = items.OrderBy(req =>