Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# .editorconfig
# https://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,xml,yml,yaml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.cs]
# Organize usings
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

# this. preferences
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
dotnet_style_readonly_field = true:suggestion

# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion

# Null-checking preferences
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion

# C# style rules
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:suggestion

# Expression-bodied members
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_constructors = false:suggestion
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
csharp_style_expression_bodied_lambdas = when_on_single_line:suggestion
csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion

# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion

# Null-checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Code-block preferences
csharp_prefer_braces = true:suggestion

# Using directive preferences
csharp_using_directive_placement = outside_namespace:suggestion

# Namespace preferences
csharp_style_namespace_declarations = file_scoped:suggestion

# Formatting rules
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

# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true

# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
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_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false

# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
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
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.severity = suggestion
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.style = camel_case_with_underscore

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

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.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.camel_case_with_underscore.required_prefix = _
dotnet_naming_style.camel_case_with_underscore.capitalization = camel_case
120 changes: 120 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: PR Build & Test

on:
pull_request:
branches: [main]
push:
branches: [main]

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
build:
name: Build & Test
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'

# .NET Framework 4.8 is pre-installed on windows-latest

- name: Restore dependencies
run: dotnet restore

- name: Build Core Library
run: dotnet build src/SVNPathCopy.Core/SVNPathCopy.Core.csproj --configuration Release --no-restore

- name: Build Shell Extension (.NET Framework 4.8)
run: dotnet build src/SVNPathCopy.ShellExtension/SVNPathCopy.ShellExtension.csproj --configuration Release --no-restore

- name: Build Configuration App
run: dotnet build src/SVNPathCopy.Configuration/SVNPathCopy.Configuration.csproj --configuration Release --no-restore

- name: Build Tests
run: dotnet build tests/SVNPathCopy.Tests/SVNPathCopy.Tests.csproj --configuration Release --no-restore

- name: Run Tests with Coverage
run: dotnet test tests/SVNPathCopy.Tests/SVNPathCopy.Tests.csproj --configuration Release --no-build --verbosity normal --results-directory tests/SVNPathCopy.Tests/TestResults --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage"

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: tests/SVNPathCopy.Tests/TestResults/*.trx

- name: DeepSource Code Coverage
if: success() && env.DEEPSOURCE_DSN != ''
shell: pwsh
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
run: |
# Install DeepSource CLI (drops ./bin/deepsource.exe on Windows)
curl https://deepsource.io/cli | sh

$coverageRoot = "tests/SVNPathCopy.Tests/TestResults"
if (-not (Test-Path $coverageRoot)) {
throw "Coverage results directory not found: $coverageRoot"
}

# dotnet test --collect:"XPlat Code Coverage" produces Cobertura at coverage.cobertura.xml
$coverageFiles = Get-ChildItem -Path $coverageRoot -Recurse -File -Filter "coverage.cobertura.xml"
if (-not $coverageFiles -or $coverageFiles.Count -eq 0) {
Write-Host "No coverage.cobertura.xml found under $coverageRoot. Directory contents:";
Get-ChildItem -Path $coverageRoot -Recurse | Select-Object FullName | Format-Table -AutoSize | Out-String | Write-Host
throw "No coverage files found."
}

foreach ($file in $coverageFiles) {
Write-Host "Reporting coverage: $($file.FullName)"
./bin/deepsource.exe report --analyzer test-coverage --key csharp --value-file "$($file.FullName)"
}

build-installer:
name: Build Installer
runs-on: windows-latest
needs: build

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

- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'

- name: Install WiX Toolset
run: dotnet tool install --global wix

- name: Add WiX extensions
run: |
wix extension add WixToolset.UI.wixext
wix extension add WixToolset.Util.wixext

- name: Restore dependencies
run: dotnet restore

- name: Build Solution (Release)
run: dotnet build --configuration Release

- name: Build Installer
run: dotnet build src/SVNPathCopy.Installer/SVNPathCopy.Installer.wixproj --configuration Release --no-restore

- name: Upload MSI artifact
uses: actions/upload-artifact@v4
with:
name: SVNPathCopy-Installer
path: src/SVNPathCopy.Installer/bin/x64/Release/*.msi
2 changes: 0 additions & 2 deletions .travis.yml

This file was deleted.

Loading