Skip to content

Commit a1c38b5

Browse files
cleanup, multi-targeting, hooks, GitHub actions (#24)
* rework w/.NET Core and multitargeting * formatting * add pre-commit hook * add GitHub test job * update pre-push hook
1 parent 77a26b1 commit a1c38b5

30 files changed

Lines changed: 1207 additions & 933 deletions

.config/dotnet-tools.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-format": {
6+
"version": "5.1.250801",
7+
"commands": [
8+
"dotnet-format"
9+
]
10+
}
11+
}
12+
}

.config/hooks/pre-push

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
echo 'Running pre-push hook...'
2+
3+
set -e
4+
5+
echo
6+
echo 'Building and testing...'
7+
dotnet test
8+
9+
echo
10+
echo 'Formatting code...'
11+
dotnet format
12+
13+
if [ `git status --porcelain=v1 2>/dev/null | wc -l` -gt 0 ]; then
14+
echo
15+
echo 'Found uncommitted changes (perhaps due to auto-formatting). Please commit or stash your changes and try again.'
16+
exit 1
17+
fi

.config/init-hooks

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
echo 'Initializing Git hooks...'
4+
ln -s ../../.config/hooks/pre-push ./.git/hooks/pre-push

.config/omnisharp.json

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"FormattingOptions": {
3+
"NewLine": "\n",
4+
"UseTabs": false,
5+
"TabSize": 4,
6+
"IndentationSize": 4,
7+
8+
"OrganizeImports": true,
9+
10+
"SpacingAfterMethodDeclarationName": false,
11+
"SpaceWithinMethodDeclarationParenthesis": false,
12+
"SpaceBetweenEmptyMethodDeclarationParentheses": false,
13+
14+
"SpaceAfterMethodCallName": false,
15+
"SpaceWithinMethodCallParentheses": false,
16+
"SpaceBetweenEmptyMethodCallParentheses": false,
17+
18+
"SpaceAfterControlFlowStatementKeyword": true,
19+
"SpaceWithinExpressionParentheses": false,
20+
"SpaceWithinOtherParentheses": false,
21+
22+
"SpaceWithinCastParentheses": false,
23+
"SpaceAfterCast": false,
24+
25+
"SpaceBeforeOpenSquareBracket": false,
26+
"SpaceWithinSquareBrackets": false,
27+
"SpaceBetweenEmptySquareBrackets": false,
28+
29+
"SpaceBeforeColonInBaseTypeDeclaration": true,
30+
"SpaceAfterColonInBaseTypeDeclaration": true,
31+
32+
"SpaceBeforeComma": false,
33+
"SpaceAfterComma": true,
34+
35+
"SpaceBeforeDot": false,
36+
"SpaceAfterDot": false,
37+
38+
"SpaceAfterSemicolonsInForStatement": true,
39+
"SpaceBeforeSemicolonsInForStatement": false,
40+
41+
"SpacingAroundBinaryOperator": "single",
42+
43+
"IndentBraces": false,
44+
"IndentBlock": true,
45+
46+
"IndentSwitchSection": true,
47+
"IndentSwitchCaseSection": true,
48+
"IndentSwitchCaseSectionWhenBlock": true,
49+
50+
"LabelPositioning": "oneLess",
51+
52+
"WrappingPreserveSingleLine": true,
53+
"WrappingKeepStatementsOnSingleLine": true,
54+
55+
"NewLinesForBracesInTypes": false,
56+
"NewLinesForBracesInMethods": false,
57+
"NewLinesForBracesInProperties": false,
58+
"NewLinesForBracesInAccessors": false,
59+
"NewLinesForBracesInAnonymousMethods": false,
60+
"NewLinesForBracesInAnonymousTypes": false,
61+
"NewLinesForBracesInControlBlocks": false,
62+
"NewLinesForBracesInObjectCollectionArrayInitializers": false,
63+
"NewLinesForBracesInLambdaExpressionBody": false,
64+
65+
"NewLineForElse": true,
66+
"NewLineForCatch": true,
67+
"NewLineForFinally": true,
68+
69+
"NewLineForMembersInObjectInit": true,
70+
"NewLineForMembersInAnonymousTypes": true,
71+
72+
"NewLineForClausesInQuery": true
73+
}
74+
}

.editorconfig

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 4
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
11+
[*.cs]
12+
# Organize usings
13+
dotnet_sort_system_directives_first = true
14+
15+
# this. preferences
16+
dotnet_style_qualification_for_field = false:silent
17+
dotnet_style_qualification_for_property = false:silent
18+
dotnet_style_qualification_for_method = false:silent
19+
dotnet_style_qualification_for_event = false:silent
20+
21+
# Language keywords vs BCL types preferences
22+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
23+
dotnet_style_predefined_type_for_member_access = true:silent
24+
25+
# Parentheses preferences
26+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
27+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
28+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
29+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
30+
31+
# Modifier preferences
32+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
33+
dotnet_style_readonly_field = true:silent
34+
35+
# Expression-level preferences
36+
dotnet_style_object_initializer = true:suggestion
37+
dotnet_style_collection_initializer = true:suggestion
38+
dotnet_style_explicit_tuple_names = true:suggestion
39+
dotnet_style_null_propagation = true:suggestion
40+
dotnet_style_coalesce_expression = true:suggestion
41+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
42+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
43+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
44+
dotnet_style_prefer_auto_properties = true:silent
45+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
46+
dotnet_style_prefer_conditional_expression_over_return = true:silent
47+
48+
# Style Definitions
49+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
50+
51+
# Use PascalCase for constant fields
52+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
53+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
54+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
55+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
56+
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
57+
dotnet_naming_symbols.constant_fields.required_modifiers = const
58+
csharp_style_var_for_built_in_types = true:silent
59+
csharp_style_var_when_type_is_apparent = true:silent
60+
csharp_style_var_elsewhere = true:silent
61+
62+
# Expression-bodied members
63+
csharp_style_expression_bodied_methods = true:silent
64+
csharp_style_expression_bodied_constructors = true:silent
65+
csharp_style_expression_bodied_operators = true:silent
66+
csharp_style_expression_bodied_properties = true:silent
67+
csharp_style_expression_bodied_indexers = true:silent
68+
csharp_style_expression_bodied_accessors = true:silent
69+
70+
# Pattern matching preferences
71+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
72+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
73+
74+
# Null-checking preferences
75+
csharp_style_throw_expression = true:suggestion
76+
csharp_style_conditional_delegate_call = true:suggestion
77+
78+
# Modifier preferences
79+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
80+
81+
# Expression-level preferences
82+
csharp_prefer_braces = true:silent
83+
csharp_style_deconstructed_variable_declaration = true:suggestion
84+
csharp_prefer_simple_default_expression = true:suggestion
85+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
86+
csharp_style_inlined_variable_declaration = true:suggestion
87+
88+
# New line preferences
89+
csharp_new_line_before_open_brace = all
90+
csharp_new_line_before_else = true
91+
csharp_new_line_before_catch = true
92+
csharp_new_line_before_finally = true
93+
csharp_new_line_before_members_in_object_initializers = true
94+
csharp_new_line_before_members_in_anonymous_types = true
95+
csharp_new_line_between_query_expression_clauses = true
96+
97+
# Indentation preferences
98+
csharp_indent_case_contents = true
99+
csharp_indent_switch_labels = true
100+
csharp_indent_labels = flush_left
101+
102+
# Space preferences
103+
csharp_space_after_cast = false
104+
csharp_space_after_keywords_in_control_flow_statements = true
105+
csharp_space_between_method_call_parameter_list_parentheses = false
106+
csharp_space_between_method_declaration_parameter_list_parentheses = false
107+
csharp_space_between_parentheses = false
108+
csharp_space_before_colon_in_inheritance_clause = true
109+
csharp_space_after_colon_in_inheritance_clause = true
110+
csharp_space_around_binary_operators = before_and_after
111+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
112+
csharp_space_between_method_call_name_and_opening_parenthesis = false
113+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
114+
115+
# Wrapping preferences
116+
csharp_preserve_single_line_statements = true
117+
csharp_preserve_single_line_blocks = true

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
on: push
2+
jobs:
3+
build-and-test:
4+
name: Build & Test
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/setup-dotnet@v2.1.0
9+
with:
10+
dotnet-version: 6.x
11+
- run: dotnet test

.vscode/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.
2+
!tasks.json

.vscode/tasks.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "build",
8+
"command": "dotnet",
9+
"type": "shell",
10+
"args": [
11+
"build",
12+
// Ask dotnet build to generate full paths for file names.
13+
"/property:GenerateFullPaths=true",
14+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
15+
"/consoleloggerparameters:NoSummary"
16+
],
17+
"group": "build",
18+
"presentation": {
19+
"reveal": "silent"
20+
},
21+
"problemMatcher": "$msCompile"
22+
},
23+
{
24+
"label": "test",
25+
"command": "dotnet",
26+
"type": "shell",
27+
"args": [
28+
"test",
29+
"tests/Tests.csproj"
30+
],
31+
"group": "test"
32+
},
33+
{
34+
"label": "test & watch",
35+
"command": "dotnet",
36+
"type": "shell",
37+
"args": [
38+
"watch",
39+
"test",
40+
"tests/Tests.csproj"
41+
],
42+
"group": "test"
43+
},
44+
{
45+
"label": "pack",
46+
"command": "dotnet",
47+
"type": "shell",
48+
"args": [
49+
"pack",
50+
"-c",
51+
"Release",
52+
"--include-symbols",
53+
"--include-source",
54+
"src/STLdotNET.csproj"
55+
],
56+
"problemMatcher": "$msCompile"
57+
}
58+
]
59+
}

LICENSE.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GNU AFFERO GENERAL PUBLIC LICENSE
22
Version 3, 19 November 2007
33

4-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
4+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
55
Everyone is permitted to copy and distribute verbatim copies
66
of this license document, but changing it is not allowed.
77

@@ -643,7 +643,7 @@ the "copyright" line and a pointer to where the full notice is found.
643643
GNU Affero General Public License for more details.
644644

645645
You should have received a copy of the GNU Affero General Public License
646-
along with this program. If not, see <http://www.gnu.org/licenses/>.
646+
along with this program. If not, see <https://www.gnu.org/licenses/>.
647647

648648
Also add information on how to contact you by electronic and paper mail.
649649

@@ -658,4 +658,4 @@ specific requirements.
658658
You should also get your employer (if you work as a programmer) or school,
659659
if any, to sign a "copyright disclaimer" for the program, if necessary.
660660
For more information on this, and how to apply and follow the GNU AGPL, see
661-
<http://www.gnu.org/licenses/>.
661+
<https://www.gnu.org/licenses/>.

QuantumConcepts.Formats.STL.dll.nuspec

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)