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
142 changes: 142 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# EditorConfig for ArgusTransfer - states the conventions of CLAUDE.md and .github/CONTRIBUTING.md
# so that the editor shows them and 'dotnet format --verify-no-changes' and the build enforce them.
# https://editorconfig.org

root = true

##########################################
# All files
##########################################

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

[*.{cs,csproj,props,sln}]
# pinned to CRLF on every platform by .gitattributes
end_of_line = crlf

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

[*.md]
# two trailing spaces are a line break in Markdown
trim_trailing_whitespace = false

##########################################
# C# files
##########################################

[*.cs]
indent_size = 4
tab_width = 4

# --- file header (CLAUDE.md: License header); IDE0073 also checks the file name in the header ---
file_header_template = ------------------------------------------------------------------------------------------------\n<copyright file="{fileName}">\n\n Copyright (c) 2025-2026 Sam Gerené\n SPDX-License-Identifier: Apache-2.0\n\n</copyright>\n------------------------------------------------------------------------------------------------
dotnet_diagnostic.IDE0073.severity = warning

# --- layout: Allman braces ---
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
dotnet_diagnostic.IDE0055.severity = warning

# --- using directives: inside the namespace, System first, a blank line between groups ---
csharp_using_directive_placement = inside_namespace:warning
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true
dotnet_diagnostic.IDE0065.severity = warning

# --- block-scoped namespaces ---
csharp_style_namespace_declarations = block_scoped:warning
dotnet_diagnostic.IDE0160.severity = warning

# --- 'this.' for instance members ---
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_property = true:warning
dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_event = true:warning
dotnet_diagnostic.IDE0009.severity = warning

# --- language keywords instead of framework type names (int, string, not Int32, String) ---
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
dotnet_diagnostic.IDE0049.severity = warning

# --- always braces, also for a single line ---
csharp_prefer_braces = true:warning
dotnet_diagnostic.IDE0011.severity = warning

# --- 'var' unless the inferred type is not obvious ---
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# --- naming; Roslyn applies the first matching rule, so the specific ones come first ---
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.interface_style.capitalization = pascal_case
dotnet_naming_style.interface_style.required_prefix = I
dotnet_naming_style.type_parameter_style.capitalization = pascal_case
dotnet_naming_style.type_parameter_style.required_prefix = T

dotnet_naming_symbols.private_const_fields_symbols.applicable_kinds = field
dotnet_naming_symbols.private_const_fields_symbols.applicable_accessibilities = private, private_protected
dotnet_naming_symbols.private_const_fields_symbols.required_modifiers = const
dotnet_naming_symbols.private_static_readonly_fields_symbols.applicable_kinds = field
dotnet_naming_symbols.private_static_readonly_fields_symbols.applicable_accessibilities = private, private_protected
dotnet_naming_symbols.private_static_readonly_fields_symbols.required_modifiers = static, readonly
dotnet_naming_symbols.private_fields_symbols.applicable_kinds = field
dotnet_naming_symbols.private_fields_symbols.applicable_accessibilities = private, private_protected
dotnet_naming_symbols.non_private_fields_symbols.applicable_kinds = field
dotnet_naming_symbols.non_private_fields_symbols.applicable_accessibilities = public, internal, protected, protected_internal
dotnet_naming_symbols.interfaces_symbols.applicable_kinds = interface
dotnet_naming_symbols.interfaces_symbols.applicable_accessibilities = *
dotnet_naming_symbols.type_parameters_symbols.applicable_kinds = type_parameter
dotnet_naming_symbols.type_parameters_symbols.applicable_accessibilities = *
dotnet_naming_symbols.methods_symbols.applicable_kinds = method, local_function
dotnet_naming_symbols.methods_symbols.applicable_accessibilities = *
dotnet_naming_symbols.types_and_members_symbols.applicable_kinds = namespace, class, struct, enum, delegate, property, event
dotnet_naming_symbols.types_and_members_symbols.applicable_accessibilities = *
dotnet_naming_symbols.parameters_and_locals_symbols.applicable_kinds = parameter, local
dotnet_naming_symbols.parameters_and_locals_symbols.applicable_accessibilities = *

dotnet_naming_rule.private_const_fields_are_pascal_case.symbols = private_const_fields_symbols
dotnet_naming_rule.private_const_fields_are_pascal_case.style = pascal_case_style
dotnet_naming_rule.private_const_fields_are_pascal_case.severity = warning
dotnet_naming_rule.private_static_readonly_fields_are_pascal_case.symbols = private_static_readonly_fields_symbols
dotnet_naming_rule.private_static_readonly_fields_are_pascal_case.style = pascal_case_style
dotnet_naming_rule.private_static_readonly_fields_are_pascal_case.severity = warning
dotnet_naming_rule.private_fields_are_camel_case.symbols = private_fields_symbols
dotnet_naming_rule.private_fields_are_camel_case.style = camel_case_style
dotnet_naming_rule.private_fields_are_camel_case.severity = warning
dotnet_naming_rule.non_private_fields_are_pascal_case.symbols = non_private_fields_symbols
dotnet_naming_rule.non_private_fields_are_pascal_case.style = pascal_case_style
dotnet_naming_rule.non_private_fields_are_pascal_case.severity = warning
dotnet_naming_rule.interfaces_are_prefixed.symbols = interfaces_symbols
dotnet_naming_rule.interfaces_are_prefixed.style = interface_style
dotnet_naming_rule.interfaces_are_prefixed.severity = warning
dotnet_naming_rule.type_parameters_are_prefixed.symbols = type_parameters_symbols
dotnet_naming_rule.type_parameters_are_prefixed.style = type_parameter_style
dotnet_naming_rule.type_parameters_are_prefixed.severity = warning
dotnet_naming_rule.methods_are_pascal_case.symbols = methods_symbols
dotnet_naming_rule.methods_are_pascal_case.style = pascal_case_style
dotnet_naming_rule.methods_are_pascal_case.severity = warning
dotnet_naming_rule.types_and_members_are_pascal_case.symbols = types_and_members_symbols
dotnet_naming_rule.types_and_members_are_pascal_case.style = pascal_case_style
dotnet_naming_rule.types_and_members_are_pascal_case.severity = warning
dotnet_naming_rule.parameters_and_locals_are_camel_case.symbols = parameters_and_locals_symbols
dotnet_naming_rule.parameters_and_locals_are_camel_case.style = camel_case_style
dotnet_naming_rule.parameters_and_locals_are_camel_case.severity = warning
dotnet_diagnostic.IDE1006.severity = warning

##########################################
# Tests - test methods are named Verify_that_{scenario_in_snake_case} (CLAUDE.md: Testing Conventions)
##########################################

[ArgusTransfer.Tests/**.cs]
dotnet_naming_rule.methods_are_pascal_case.severity = none
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Line-ending policy, independent of a contributor's git configuration (core.autocrlf).
# Text files are stored with LF in the repository.
* text=auto

# C# sources and the project files are CRLF in the working tree on every platform. The .editorconfig
# states the same (end_of_line = crlf), so 'dotnet format --verify-no-changes' gives the same result
# on Windows, Linux and macOS.
*.cs text eol=crlf
*.csproj text eol=crlf
*.props text eol=crlf
*.sln text eol=crlf

*.png binary
18 changes: 16 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,19 @@ And remember; **A pull-request with tests is a pull-request that's likely to be
- Put `using` statements inside namespace.
- Pay attention to whitespace and extra blank lines
- Absolutely **no** regions

> If you are a ReSharper user, you can make use of our `.DotSettings` file to ensure you cover as many of our style guidelines as possible. There may be some style guidelines which are not covered by the file, so please pay attention to the style of existing code.
- Start every `.cs` file with the short copyright header shown below, with the `file="..."` attribute equal to the name of the file:

```csharp
// ------------------------------------------------------------------------------------------------
// <copyright file="MyClass.cs">
//
// Copyright (c) 2025-2026 Sam Gerené
// SPDX-License-Identifier: Apache-2.0
//
// </copyright>
// ------------------------------------------------------------------------------------------------
```

The `.editorconfig` in the root of the repository states these guidelines, so Visual Studio, Rider and VS Code show violations while you type. Before you send a pull request, run `dotnet format ArgusTransfer.sln` to apply them (it also adds the header to a new file) and `dotnet build ArgusTransfer.sln -warnaserror` to check them; the build of a pull request runs `dotnet format ArgusTransfer.sln --verify-no-changes`.

> If you are a ReSharper or Rider user, the `.DotSettings` file adds the file header template and the naming rules for ReSharper; ReSharper and Rider read the `.editorconfig` as well. Some style guidelines are not covered by either file (regions, descriptive names), so please pay attention to the style of existing code.
5 changes: 5 additions & 0 deletions .github/workflows/CodeQuality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN"

# Checks the rules of .editorconfig: whitespace, line endings, encoding, using order, the file header and code style.
# Last, so that a violation does not stop the analysis above.
- name: Verify formatting
run: dotnet format ArgusTransfer.sln --no-restore --verify-no-changes

# Named pipes behave differently on Windows (unbuffered pipe instances instead of Unix domain sockets), and some
# tests only run there ([Platform("Win")]). Analysis and coverage stay in the Linux job above.
test-windows:
Expand Down
23 changes: 6 additions & 17 deletions ArgusTransfer.Sample/JsonArgusBodySerializer.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="JsonArgusBodySerializer.cs">
// ------------------------------------------------------------------------------------------------
// <copyright file="JsonArgusBodySerializer.cs">
//
// Copyright (c) 2025-2026 Sam Gerené
// Copyright (c) 2025-2026 Sam Gerené
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------
// </copyright>
// ------------------------------------------------------------------------------------------------

namespace ArgusTransfer.Sample
{
Expand Down
23 changes: 6 additions & 17 deletions ArgusTransfer.Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="Program.cs">
// ------------------------------------------------------------------------------------------------
// <copyright file="Program.cs">
//
// Copyright (c) 2025-2026 Sam Gerené
// Copyright (c) 2025-2026 Sam Gerené
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------
// </copyright>
// ------------------------------------------------------------------------------------------------

namespace ArgusTransfer.Sample
{
Expand Down
23 changes: 6 additions & 17 deletions ArgusTransfer.Sample/SampleApiKeyAuthenticationHandler.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="SampleApiKeyAuthenticationHandler.cs">
// ------------------------------------------------------------------------------------------------
// <copyright file="SampleApiKeyAuthenticationHandler.cs">
//
// Copyright (c) 2025-2026 Sam Gerené
// Copyright (c) 2025-2026 Sam Gerené
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------
// </copyright>
// ------------------------------------------------------------------------------------------------

namespace ArgusTransfer.Sample
{
Expand Down
23 changes: 6 additions & 17 deletions ArgusTransfer.Sample/SampleClientService.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="SampleClientService.cs">
// ------------------------------------------------------------------------------------------------
// <copyright file="SampleClientService.cs">
//
// Copyright (c) 2025-2026 Sam Gerené
// Copyright (c) 2025-2026 Sam Gerené
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------
// </copyright>
// ------------------------------------------------------------------------------------------------

namespace ArgusTransfer.Sample
{
Expand Down Expand Up @@ -97,7 +86,7 @@
Console.WriteLine();

Console.WriteLine("--- Step 1: List all items; this endpoint allows anonymous callers ---");
var request = CreateRequest(ArgusVerb.GET, "/sampleitems", authenticate: false);

Check warning on line 89 in ArgusTransfer.Sample/SampleClientService.cs

View workflow job for this annotation

GitHub Actions / Build

Define a constant instead of using this literal '/sampleitems' 4 times.

Check warning on line 89 in ArgusTransfer.Sample/SampleClientService.cs

View workflow job for this annotation

GitHub Actions / Build

Define a constant instead of using this literal '/sampleitems' 4 times.

Check warning on line 89 in ArgusTransfer.Sample/SampleClientService.cs

View workflow job for this annotation

GitHub Actions / Build

Define a constant instead of using this literal '/sampleitems' 4 times.

Check warning on line 89 in ArgusTransfer.Sample/SampleClientService.cs

View workflow job for this annotation

GitHub Actions / Build

Define a constant instead of using this literal '/sampleitems' 4 times.
await this.SendAsync(request, ArgusStatusCode.Ok, stoppingToken);

Console.WriteLine("--- Step 2: Create an item without credentials (expect 401 problem details) ---");
Expand Down
23 changes: 6 additions & 17 deletions ArgusTransfer.Sample/SampleItem.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="SampleItem.cs">
// ------------------------------------------------------------------------------------------------
// <copyright file="SampleItem.cs">
//
// Copyright (c) 2025-2026 Sam Gerené
// Copyright (c) 2025-2026 Sam Gerené
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------
// </copyright>
// ------------------------------------------------------------------------------------------------

namespace ArgusTransfer.Sample
{
Expand Down
23 changes: 6 additions & 17 deletions ArgusTransfer.Sample/SampleItemModule.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="SampleItemModule.cs">
// ------------------------------------------------------------------------------------------------
// <copyright file="SampleItemModule.cs">
//
// Copyright (c) 2025-2026 Sam Gerené
// Copyright (c) 2025-2026 Sam Gerené
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------
// </copyright>
// ------------------------------------------------------------------------------------------------

namespace ArgusTransfer.Sample
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="ArgusAuthenticationResultTestFixture.cs">
// ------------------------------------------------------------------------------------------------
// <copyright file="ArgusAuthenticationResultTestFixture.cs">
//
// Copyright (c) 2025-2026 Sam Gerené
// Copyright (c) 2025-2026 Sam Gerené
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------
// </copyright>
// ------------------------------------------------------------------------------------------------

namespace ArgusTransfer.Tests.Authentication
{
Expand Down
Loading
Loading