浏览代码

Implemented automatic linter

/main
Miley Hollenberg 4 年前
当前提交
cd634c11
共有 4 个文件被更改,包括 67 次插入2 次删除
  1. 3
      UOP1_Project/Assets/Scripts/Characters/Character.cs
  2. 38
      .editorconfig
  3. 28
      .github/workflows/linter.yml

3
UOP1_Project/Assets/Scripts/Characters/Character.cs


turnSmoothTime);
}
}
private void OnControllerColliderHit(ControllerColliderHit hit)
{
hitNormal = hit.normal;

}
}
}

38
.editorconfig


[*.cs]
indent_style = tab
indent_size = tab
indent_with_tabs = 2
align_with_tabs = true
align_keep_tabs = true
insert_final_newline = true
trim_trailing_whitespace = true
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_between_query_expression_clauses = true
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_case_contents_when_block = false
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
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
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true
csharp_using_directive_placement = outside_namespace

28
.github/workflows/linter.yml


name: Linter
# Run this workflow every time a new commit pushed to your repository
on: push
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
super-lint:
# Name the Job
name: Lint code base
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git pull
- run: dotnet tool install -g dotnet-format
- run: dotnet-format -f UOP1_Project/Assets/Scripts -v d
- name: Commit changes
uses: EndBug/add-and-commit@v5
with:
author_name: github-actions[bot]
author_email: 41898282+github-actions[bot]@users.noreply.github.com
message: "Automated dotnet-format update Co-authored-by ${{ github.event.comment.user.login }} <${{ github.event.comment.user.id }}+${{ github.event.comment.user.login }}@users.noreply.github.com>"
add: "*.cs"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
正在加载...
取消
保存