Skip to content

Commit da22e76

Browse files
committed
🚧 WIP: .NET 10 update
1 parent 86e2647 commit da22e76

27 files changed

+532
-218
lines changed

.editorconfig

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
# -------------------------------------------------------------------
2+
# Common Editor Config
3+
# Repository : https://github.com/jonas-merkle/Common-Editor-Config
4+
# Author : Jonas Merkle
5+
# License : GNU Lesser General Public License v3.0 (LGPLv3)
6+
# Versioning : Semantic Versioning (SemVer) via Git tags
7+
# Version : v1.0.0
8+
# Description: Cross-language editor style configuration.
9+
# © 2025 Jonas Merkle. Licensed under the LGPLv3.
10+
# -------------------------------------------------------------------
11+
12+
# -------------------------------------------------------------------
13+
# Root EditorConfig
14+
# -------------------------------------------------------------------
15+
root = true
16+
17+
# -------------------------------------------------------------------
18+
# GLOBAL DEFAULTS (apply to all files unless overridden below)
19+
# -------------------------------------------------------------------
20+
[*]
21+
charset = utf-8
22+
end_of_line = lf
23+
insert_final_newline = true
24+
trim_trailing_whitespace = true
25+
26+
# Use spaces by default; override where tabs are required (e.g. Makefiles)
27+
indent_style = space
28+
indent_size = 4
29+
tab_width = 4
30+
31+
# Not an official core property, but widely respected by many tools.
32+
# Use 'off' for prose-heavy formats where hard-wrapping is unhelpful.
33+
max_line_length = 100
34+
35+
# -------------------------------------------------------------------
36+
# TEXT & DOCS
37+
# -------------------------------------------------------------------
38+
[*.{md,mdx,txt,adoc,rst}]
39+
indent_style = space
40+
indent_size = 2
41+
# Trailing spaces at line ends are meaningful in Markdown for hard line breaks
42+
trim_trailing_whitespace = false
43+
max_line_length = off
44+
45+
# -------------------------------------------------------------------
46+
# MARKUP (HTML, XML) & STYLES (CSS, SCSS)
47+
# -------------------------------------------------------------------
48+
[*.{html,htm,xml,xaml,vue}]
49+
indent_style = space
50+
indent_size = 2
51+
52+
[*.{css,scss,less}]
53+
indent_style = space
54+
indent_size = 2
55+
56+
# -------------------------------------------------------------------
57+
# JAVASCRIPT / TYPESCRIPT
58+
# (Core formatting via EditorConfig; lint/format specifics typically come from ESLint/Prettier)
59+
# -------------------------------------------------------------------
60+
[*.{js,mjs,cjs,jsx}]
61+
indent_style = space
62+
indent_size = 2
63+
max_line_length = 100
64+
65+
[*.{ts,tsx,cts,mts}]
66+
indent_style = space
67+
indent_size = 2
68+
max_line_length = 100
69+
70+
# JSON & JSON with Comments (VS Code, etc.)
71+
[*.{json,jsonc}]
72+
indent_style = space
73+
indent_size = 2
74+
# Keep whitespace strict in data files
75+
trim_trailing_whitespace = true
76+
insert_final_newline = true
77+
78+
# -------------------------------------------------------------------
79+
# YAML / TOML / INI
80+
# -------------------------------------------------------------------
81+
[*.{yml,yaml}]
82+
indent_style = space
83+
indent_size = 2
84+
85+
[*.{toml,ini}]
86+
indent_style = space
87+
indent_size = 2
88+
89+
# -------------------------------------------------------------------
90+
# CSV / TSV / DATA
91+
# -------------------------------------------------------------------
92+
[*.{csv,tsv}]
93+
# Keep trailing whitespace (sometimes significant for empty columns)
94+
trim_trailing_whitespace = false
95+
insert_final_newline = true
96+
indent_style = space
97+
indent_size = 2
98+
end_of_line = lf
99+
100+
# -------------------------------------------------------------------
101+
# C / C++
102+
# (Detailed code style usually comes from .clang-format; here we set editor basics.)
103+
# -------------------------------------------------------------------
104+
[*.{c,cc,cpp,cxx,h,hpp,hxx,ixx}]
105+
indent_style = space
106+
indent_size = 4
107+
tab_width = 4
108+
# Keep preprocessor columns neat; editors will still respect spaces
109+
trim_trailing_whitespace = true
110+
max_line_length = 100
111+
112+
# -------------------------------------------------------------------
113+
# C#
114+
# Includes Roslyn/.NET code-style options supported in .editorconfig
115+
# Severity levels: suggestion, warning, error (tune to your preference)
116+
# -------------------------------------------------------------------
117+
[*.cs]
118+
indent_style = space
119+
indent_size = 4
120+
tab_width = 4
121+
max_line_length = 100
122+
123+
# usings
124+
dotnet_sort_system_directives_first = true:suggestion
125+
dotnet_separate_import_directive_groups = true:suggestion
126+
dotnet_style_qualification_for_field = false:suggestion
127+
dotnet_style_qualification_for_property = false:suggestion
128+
dotnet_style_qualification_for_method = false:suggestion
129+
dotnet_style_qualification_for_event = false:suggestion
130+
131+
# var preferences
132+
csharp_style_var_for_built_in_types = true:suggestion
133+
csharp_style_var_when_type_is_apparent = true:suggestion
134+
csharp_style_var_elsewhere = false:suggestion
135+
136+
# expression-bodied members
137+
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
138+
csharp_style_expression_bodied_constructors = when_on_single_line:suggestion
139+
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
140+
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
141+
142+
# pattern matching & modern features
143+
csharp_style_prefer_switch_expression = true:suggestion
144+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
145+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
146+
csharp_style_inlined_variable_declaration = true:suggestion
147+
csharp_style_prefer_index_operator = true:suggestion
148+
csharp_style_prefer_range_operator = true:suggestion
149+
csharp_style_prefer_tuple_swap = true:suggestion
150+
csharp_style_deconstructed_variable_declaration = true:suggestion
151+
152+
# nullability & coalescing
153+
csharp_style_throw_expression = true:suggestion
154+
csharp_style_prefer_null_check_over_type_check = true:suggestion
155+
csharp_style_prefer_conditional_expression_over_assignment = true:suggestion
156+
csharp_style_prefer_conditional_expression_over_return = true:suggestion
157+
dotnet_style_coalesce_expression = true:suggestion
158+
dotnet_style_null_propagation = true:suggestion
159+
160+
# braces, newlines, and layout
161+
csharp_prefer_braces = true:warning
162+
csharp_new_line_before_open_brace = all
163+
csharp_new_line_between_query_expression_clauses = true
164+
165+
# modifiers & accessibility
166+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
167+
dotnet_style_readonly_field = true:suggestion
168+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
169+
dotnet_style_predefined_type_for_member_access = true:suggestion
170+
171+
# using directives placement (outside namespace is common in modern .NET)
172+
csharp_using_directive_placement = outside_namespace:suggestion
173+
174+
# file-scoped namespaces
175+
csharp_style_namespace_declarations = file_scoped:suggestion
176+
177+
# prefer 'new()' target-typed
178+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
179+
180+
# analyzers: common hygiene
181+
dotnet_diagnostic.IDE0005.severity = warning # Remove unnecessary usings
182+
dotnet_diagnostic.IDE0060.severity = suggestion # Remove unused parameter
183+
dotnet_diagnostic.IDE0044.severity = suggestion # Make field readonly
184+
dotnet_diagnostic.IDE0051.severity = suggestion # Remove unused private members
185+
dotnet_diagnostic.IDE0090.severity = suggestion # 'new()' with target-typed
186+
187+
# -------------------------------------------------------------------
188+
# LaTeX (TeX/LaTeX/BibTeX)
189+
# Trailing spaces can be meaningful (line breaks with two spaces), so keep them.
190+
# -------------------------------------------------------------------
191+
[*.{tex,sty,cls,bib,latex}]
192+
indent_style = space
193+
indent_size = 2
194+
trim_trailing_whitespace = false
195+
max_line_length = off
196+
197+
# -------------------------------------------------------------------
198+
# SHELL / SCRIPTS / MAKE
199+
# -------------------------------------------------------------------
200+
[*.{sh,bash,zsh}]
201+
indent_style = space
202+
indent_size = 2
203+
204+
# Makefiles require tabs
205+
[Makefile]
206+
indent_style = tab
207+
tab_width = 8
208+
209+
# -------------------------------------------------------------------
210+
# PROJECT / SOLUTION / MSBUILD & XML-LIKE
211+
# -------------------------------------------------------------------
212+
[*.{sln,props,targets,csproj,vcxproj,nuspec,resx,config}]
213+
indent_style = space
214+
indent_size = 2
215+
216+
# -------------------------------------------------------------------
217+
# PYTHON (if present in repo)
218+
# -------------------------------------------------------------------
219+
[*.py]
220+
indent_style = space
221+
indent_size = 4
222+
max_line_length = 100
223+
224+
# -------------------------------------------------------------------
225+
# BATCH / POWERSHELL (Windows scripting)
226+
# -------------------------------------------------------------------
227+
[*.{bat,cmd}]
228+
end_of_line = crlf
229+
230+
[*.ps1]
231+
indent_style = space
232+
indent_size = 2
233+
234+
# -------------------------------------------------------------------
235+
# GIT & DOTFILES
236+
# -------------------------------------------------------------------
237+
[*.{gitattributes,gitignore,gitmodules}]
238+
indent_style = space
239+
indent_size = 2
240+
241+
# -------------------------------------------------------------------
242+
# MISC: SVG (XML), SQL, CSV variants, lockfiles
243+
# -------------------------------------------------------------------
244+
[*.svg]
245+
indent_style = space
246+
indent_size = 2
247+
248+
[*.sql]
249+
indent_style = space
250+
indent_size = 2
251+
max_line_length = off
252+
253+
# Common lockfiles prefer 2 spaces and no trimming surprises
254+
[*.{lock,lockb,package-lock.json,pnpm-lock.yaml,yarn.lock}]
255+
indent_style = space
256+
indent_size = 2
257+
trim_trailing_whitespace = false
258+
insert_final_newline = true

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
4+
title: ""
55
labels: bug
66
assignees: jonas-merkle
7-
87
---
98

109
**Describe the bug**
@@ -20,8 +19,9 @@ A clear and concise description of what you expected to happen.
2019
If applicable, add screenshots to help explain your problem.
2120

2221
**Desktop (please complete the following information):**
23-
- OS: [e.g. Windows 10]
24-
- Version [e.g. 1.0.0]
22+
23+
- OS: [e.g. Windows 10]
24+
- Version [e.g. 1.0.0]
2525

2626
**Additional context**
2727
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
4+
title: ""
55
labels: enhancement, question
66
assignees: jonas-merkle
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/workflows/codeql.yml

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
18-
branches: [ "main" ]
18+
branches: ["main"]
1919
schedule:
20-
- cron: '00 4 * * 1'
20+
- cron: "00 4 * * 1"
2121

2222
jobs:
2323
analyze:
@@ -37,45 +37,44 @@ jobs:
3737
strategy:
3838
fail-fast: false
3939
matrix:
40-
language: [ 'csharp' ]
40+
language: ["csharp"]
4141
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
4242
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
4343
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
4444
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
4545

4646
steps:
47-
- name: Checkout repository
48-
uses: actions/checkout@v4
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
4949

50-
# Initializes the CodeQL tools for scanning.
51-
- name: Initialize CodeQL
52-
uses: github/codeql-action/init@v3
53-
with:
54-
languages: ${{ matrix.language }}
55-
# If you wish to specify custom queries, you can do so here or in a config file.
56-
# By default, queries listed here will override any specified in a config file.
57-
# Prefix the list here with "+" to use these queries and those in the config file.
50+
# Initializes the CodeQL tools for scanning.
51+
- name: Initialize CodeQL
52+
uses: github/codeql-action/init@v3
53+
with:
54+
languages: ${{ matrix.language }}
55+
# If you wish to specify custom queries, you can do so here or in a config file.
56+
# By default, queries listed here will override any specified in a config file.
57+
# Prefix the list here with "+" to use these queries and those in the config file.
5858

59-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
60-
# queries: security-extended,security-and-quality
59+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
60+
# queries: security-extended,security-and-quality
6161

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

63-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
64-
# If this step fails, then you should remove it and run the build manually (see below)
65-
- name: Autobuild
66-
uses: github/codeql-action/autobuild@v3
67+
# ℹ️ Command-line programs to run using the OS shell.
68+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6769

68-
# ℹ️ Command-line programs to run using the OS shell.
69-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
70+
# If the Autobuild fails above, remove it and uncomment the following three lines.
71+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
7072

71-
# If the Autobuild fails above, remove it and uncomment the following three lines.
72-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
73+
# - run: |
74+
# echo "Run, Build Application using script"
75+
# ./location_of_script_within_repo/buildscript.sh
7376

74-
# - run: |
75-
# echo "Run, Build Application using script"
76-
# ./location_of_script_within_repo/buildscript.sh
77-
78-
- name: Perform CodeQL Analysis
79-
uses: github/codeql-action/analyze@v3
80-
with:
81-
category: "/language:${{matrix.language}}"
77+
- name: Perform CodeQL Analysis
78+
uses: github/codeql-action/analyze@v3
79+
with:
80+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)