Skip to content

Commit

Permalink
Merge pull request #18 from RenanCarlosPereira/reverse_back_changes
Browse files Browse the repository at this point in the history
Reverse back changes without braking changes and all fixes from the original project and add cancellation token
  • Loading branch information
asulwer authored Jun 29, 2024
2 parents b30cb0a + 13b3e13 commit 0bafdaf
Show file tree
Hide file tree
Showing 114 changed files with 2,413 additions and 866 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "5.1.23",
"commands": [
"reportgenerator"
]
}
}
}
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "RulesEngine Codespace",
"image": "mcr.microsoft.com/vscode/devcontainers/dotnet:0-6.0",
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
},
"extensions": [
"eamodio.gitlens",
"ms-dotnettools.csharp",
"VisualStudioExptTeam.vscodeintellicode",
"ms-vscode.powershell",
"cschleiden.vscode-github-actions",
"redhat.vscode-yaml",
"bierner.markdown-preview-github-styles",
"coenraads.bracket-pair-colorizer",
"vscode-icons-team.vscode-icons",
"editorconfig.editorconfig",
"aliasadidev.nugetpackagemanagergui",
"formulahendry.dotnet-test-explorer"
],
"postCreateCommand": "dotnet restore RulesEngine.sln && dotnet build RulesEngine.sln --configuration Release --no-restore && dotnet test RulesEngine.sln --configuration Release --no-build --verbosity minimal",
"features": {
"powershell": "7.1"
},
}
// Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
134 changes: 134 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Rules in this file were initially inferred by Visual Studio IntelliCode from the C:\Users\abcy\source\repos\RulesEngine codebase based on best match to current usage at 22-12-2020
# You can modify the rules from these initially generated values to suit your own policies
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
[*.cs]


#Core editorconfig formatting - indentation

#use soft tabs (spaces) for indentation
indent_style = space

#Formatting - indentation options

#indent switch case contents.
csharp_indent_case_contents = true
#indent switch labels
csharp_indent_switch_labels = true

#Formatting - new line options

#place catch statements on a new line
csharp_new_line_before_catch = true
#place else statements on a new line
csharp_new_line_before_else = true
#require members of anonymous types to be on separate lines
csharp_new_line_before_members_in_anonymous_types = true
#require members of object intializers to be on separate lines
csharp_new_line_before_members_in_object_initializers = true
#require braces to be on a new line for methods, control_blocks, and types (also known as "Allman" style)
csharp_new_line_before_open_brace = methods, control_blocks, types

#Formatting - organize using options

#do not place System.* using directives before other using directives
dotnet_sort_system_directives_first = false

#Formatting - spacing options

#require NO space between a cast and the value
csharp_space_after_cast = false
#require a space before the colon for bases or interfaces in a type declaration
csharp_space_after_colon_in_inheritance_clause = true
#require a space after a keyword in a control flow statement such as a for loop
csharp_space_after_keywords_in_control_flow_statements = true
#require a space before the colon for bases or interfaces in a type declaration
csharp_space_before_colon_in_inheritance_clause = true
#remove space within empty argument list parentheses
csharp_space_between_method_call_empty_parameter_list_parentheses = false
#remove space between method call name and opening parenthesis
csharp_space_between_method_call_name_and_opening_parenthesis = false
#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
csharp_space_between_method_call_parameter_list_parentheses = false
#remove space within empty parameter list parentheses for a method declaration
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
csharp_space_between_method_declaration_parameter_list_parentheses = false

#Formatting - wrapping options

#leave code block on single line
csharp_preserve_single_line_blocks = true
#leave statements and member declarations on the same line
csharp_preserve_single_line_statements = true

#Style - Code block preferences

#prefer curly braces even for one line of code
csharp_prefer_braces = true:suggestion

#Style - expression bodied member options

#prefer block bodies for constructors
csharp_style_expression_bodied_constructors = false:suggestion
#prefer block bodies for methods
csharp_style_expression_bodied_methods = false:suggestion

#Style - expression level options

#prefer out variables to be declared inline in the argument list of a method call when possible
csharp_style_inlined_variable_declaration = true:suggestion
#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
dotnet_style_predefined_type_for_member_access = true:suggestion

#Style - Expression-level preferences

#prefer objects to be initialized using object initializers when possible
dotnet_style_object_initializer = true:suggestion
#prefer inferred anonymous type member names
dotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion

#Style - implicit and explicit types

#prefer var over explicit type in all cases, unless overridden by another code style rule
csharp_style_var_elsewhere = true:suggestion
#prefer var is used to declare variables with built-in system types such as int
csharp_style_var_for_built_in_types = true:suggestion
#prefer var when the type is already mentioned on the right-hand side of a declaration expression
csharp_style_var_when_type_is_apparent = true:suggestion

#Style - language keyword and framework type options

#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
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion

#Style - Miscellaneous preferences

#prefer anonymous functions over local functions
csharp_style_pattern_local_over_anonymous_function = false:suggestion

#Style - modifier options

#prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods.
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion

#Style - Modifier preferences

#when this rule is set to a list of modifiers, prefer the specified ordering.
csharp_preferred_modifier_order = public,private,internal,readonly,static,async,override,sealed:suggestion

#Style - qualification options

#prefer fields not to be prefaced with this. or Me. in Visual Basic
dotnet_style_qualification_for_field = false:suggestion
#prefer methods not to be prefaced with this. or Me. in Visual Basic
dotnet_style_qualification_for_method = false:suggestion
#prefer properties not to be prefaced with this. or Me. in Visual Basic
dotnet_style_qualification_for_property = false:suggestion


#file header
[*.{cs,vb}]
file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.
file_header_template_style = prepend:error
file_header_template_style = replace:suggestion
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# default location of `.github/workflows`
directory: "/"
open-pull-requests-limit: 3
schedule:
interval: "weekly"
# assignees:
# - assignee_one
# reviewers:
# - reviewer_one

- package-ecosystem: "nuget"
# location of package manifests
directory: "/"
open-pull-requests-limit: 3
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor"]
# assignees:
# - assignee_one
# reviewers:
# - reviewer_one

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
68 changes: 68 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main, develop ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '22 15 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

49 changes: 22 additions & 27 deletions .github/workflows/dotnetcore-build.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,41 @@
name: dotnetcore-build
name: build

on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main, develop ]
push:
branches: [ main ]
pull_request:
branches: [ main, develop ]

jobs:
build:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-quality: 'ga'

dotnet-version: 6.0.x

- name: Install dependencies
run: dotnet restore RulesEngine.sln

- name: Build
run: dotnet build RulesEngine.sln --configuration Debug --no-restore
run: dotnet build RulesEngine.sln --configuration Release --no-restore

- name: Test
run: dotnet test RulesEngine.sln --collect:"XPlat Code Coverage" --no-build --configuration Debug --verbosity m

- name: ReportGenerator
uses: danielpalme/[email protected]
with:
reports: tests\*\TestResults\*\coverage.cobertura.xml
targetdir: coveragereport
reporttypes: Html;Cobertura;lcov

run: dotnet test RulesEngine.sln --collect:"XPlat Code Coverage" --no-build --configuration Release --verbosity m

- name: Generate Report
shell: pwsh
run: ./scripts/generate-coverage-report.ps1

- name: Check Coverage
shell: pwsh
run: ./scripts/check-coverage.ps1 -reportPath coveragereport/Cobertura.xml -threshold 96

#- name: Coveralls GitHub Action
# uses: coverallsapp/[email protected]
# if: ${{ github.event_name == 'push' }}
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: ./coveragereport/lcov.info
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
if: ${{ github.event_name == 'push' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coveragereport/lcov.info
Loading

0 comments on commit 0bafdaf

Please sign in to comment.