Skip to content

Commit 03302a2

Browse files
authored
Merge pull request #1 from panoukos41/refactor
Refactor
2 parents e4cd9f1 + cfb16a2 commit 03302a2

52 files changed

Lines changed: 1650 additions & 1521 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,17 @@ indent_size = 2
2424
[*.json]
2525
indent_size = 2
2626

27+
# C# settings
2728
[*.cs]
28-
csharp_style_namespace_declarations = file_scoped:warning
29+
csharp_style_namespace_declarations = file_scoped:error
30+
csharp_new_line_before_open_brace = types,methods,properties,anonymous_methods,control_blocks,anonymous_types,object_collection_array_initializers,lambdas
31+
32+
# Verify settings
33+
[*.{received,verified}.{json,txt,xml}]
34+
charset = "utf-8-bom"
35+
end_of_line = lf
36+
indent_size = unset
37+
indent_style = unset
38+
insert_final_newline = false
39+
tab_width = unset
40+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 84 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,3 @@
1-
# Auto detect text files and perform LF normalization
2-
* text=auto
3-
4-
*.cs text diff=csharp
5-
*.cshtml text diff=html
6-
*.csx text diff=csharp
7-
*.sln text eol=crlf
8-
*.csproj text eol=crlf
9-
10-
###############################################################################
11-
# Set default behavior to automatically normalize line endings.
12-
###############################################################################
13-
* text=auto
14-
15-
###############################################################################
16-
# Set the merge driver for project and solution files
17-
#
18-
# Merging from the command prompt will add diff markers to the files if there
19-
# are conflicts (Merging from VS is not affected by the settings below, in VS
20-
# the diff markers are never inserted). Diff markers may cause the following
21-
# file extensions to fail to load in VS. An alternative would be to treat
22-
# these files as binary and thus will always conflict and require user
23-
# intervention with every merge. To do so, just comment the entries below and
24-
# uncomment the group further below
25-
###############################################################################
26-
27-
*.sln text eol=crlf
28-
*.csproj text eol=crlf
29-
*.vbproj text eol=crlf
30-
*.vcxproj text eol=crlf
31-
*.vcproj text eol=crlf
32-
*.dbproj text eol=crlf
33-
*.fsproj text eol=crlf
34-
*.lsproj text eol=crlf
35-
*.wixproj text eol=crlf
36-
*.modelproj text eol=crlf
37-
*.sqlproj text eol=crlf
38-
*.wwaproj text eol=crlf
39-
40-
*.xproj text eol=crlf
41-
*.props text eol=crlf
42-
*.filters text eol=crlf
43-
*.vcxitems text eol=crlf
44-
45-
46-
#*.sln merge=binary
47-
#*.csproj merge=binary
48-
#*.vbproj merge=binary
49-
#*.vcxproj merge=binary
50-
#*.vcproj merge=binary
51-
#*.dbproj merge=binary
52-
#*.fsproj merge=binary
53-
#*.lsproj merge=binary
54-
#*.wixproj merge=binary
55-
#*.modelproj merge=binary
56-
#*.sqlproj merge=binary
57-
#*.wwaproj merge=binary
58-
59-
#*.xproj merge=binary
60-
#*.props merge=binary
61-
#*.filters merge=binary
62-
#*.vcxitems merge=binary
63-
641
# Common settings that generally should always be used with your language specific settings
652

663
# Auto detect text files and perform LF normalization
@@ -144,3 +81,87 @@
14481
.gitattributes export-ignore
14582
.gitignore export-ignore
14683
.gitkeep export-ignore
84+
85+
# Auto detect text files and perform LF normalization
86+
* text=auto
87+
88+
*.cs text diff=csharp
89+
*.cshtml text diff=html
90+
*.csx text diff=csharp
91+
*.sln text eol=crlf
92+
*.csproj text eol=crlf
93+
94+
# Apply override to all files in the directory
95+
*.md linguist-detectable
96+
97+
###############################################################################
98+
# Set default behavior to automatically normalize line endings.
99+
###############################################################################
100+
* text=auto
101+
102+
###############################################################################
103+
# Set the merge driver for project and solution files
104+
#
105+
# Merging from the command prompt will add diff markers to the files if there
106+
# are conflicts (Merging from VS is not affected by the settings below, in VS
107+
# the diff markers are never inserted). Diff markers may cause the following
108+
# file extensions to fail to load in VS. An alternative would be to treat
109+
# these files as binary and thus will always conflict and require user
110+
# intervention with every merge. To do so, just comment the entries below and
111+
# uncomment the group further below
112+
###############################################################################
113+
114+
*.sln text eol=crlf
115+
*.csproj text eol=crlf
116+
*.vbproj text eol=crlf
117+
*.vcxproj text eol=crlf
118+
*.vcproj text eol=crlf
119+
*.dbproj text eol=crlf
120+
*.fsproj text eol=crlf
121+
*.lsproj text eol=crlf
122+
*.wixproj text eol=crlf
123+
*.modelproj text eol=crlf
124+
*.sqlproj text eol=crlf
125+
*.wwaproj text eol=crlf
126+
127+
*.xproj text eol=crlf
128+
*.props text eol=crlf
129+
*.filters text eol=crlf
130+
*.vcxitems text eol=crlf
131+
132+
133+
#*.sln merge=binary
134+
#*.csproj merge=binary
135+
#*.vbproj merge=binary
136+
#*.vcxproj merge=binary
137+
#*.vcproj merge=binary
138+
#*.dbproj merge=binary
139+
#*.fsproj merge=binary
140+
#*.lsproj merge=binary
141+
#*.wixproj merge=binary
142+
#*.modelproj merge=binary
143+
#*.sqlproj merge=binary
144+
#*.wwaproj merge=binary
145+
146+
#*.xproj merge=binary
147+
#*.props merge=binary
148+
#*.filters merge=binary
149+
#*.vcxitems merge=binary
150+
151+
# Basic .gitattributes for a PowerShell repo.
152+
153+
# Source files
154+
# ============
155+
*.ps1 text eol=crlf
156+
*.ps1x text eol=crlf
157+
*.psm1 text eol=crlf
158+
*.psd1 text eol=crlf
159+
*.ps1xml text eol=crlf
160+
*.pssc text eol=crlf
161+
*.psrc text eol=crlf
162+
*.cdxml text eol=crlf
163+
164+
# Verify
165+
*.verified.txt text eol=lf working-tree-encoding=UTF-8
166+
*.verified.xml text eol=lf working-tree-encoding=UTF-8
167+
*.verified.json text eol=lf working-tree-encoding=UTF-8

.github/workflows/_.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI/CD
2+
env: { DOTNET_NOLOGO: true }
3+
on:
4+
workflow_call:
5+
inputs:
6+
test: { type: boolean, default: false, description: Run tests. }
7+
publish: { type: boolean, default: false, description: Publish to nuget. Will run all tests too. }
8+
secrets:
9+
nuget-key:
10+
jobs:
11+
pipeline:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Read .NET Version
20+
shell: pwsh
21+
id: dotnet-version
22+
run: |
23+
$version = (Get-Content .\global.json -Raw | ConvertFrom-Json).sdk.version.TrimEnd('0') + 'x'
24+
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
25+
26+
- name: Setup .NET
27+
uses: actions/setup-dotnet@v4
28+
with: { dotnet-version: "${{ steps.dotnet-version.outputs.version }}" }
29+
30+
- name: Build
31+
working-directory: src
32+
shell: pwsh
33+
run: dotnet build NoSQLite -c Release
34+
35+
- name: Test
36+
if: inputs.test || inputs.publish
37+
working-directory: test
38+
run: dotnet test --project NoSQLite.Test -c Release
39+
40+
- name: Pack
41+
if: inputs.publish
42+
working-directory: src
43+
run: dotnet pack NoSQLite --no-restore --no-build
44+
45+
- name: Push
46+
if: inputs.publish
47+
working-directory: artifacts/src/package/release
48+
env:
49+
SOURCE_URL: https://api.nuget.org/v3/index.json
50+
NUGET_AUTH_TOKEN: ${{ secrets.nuget-key }}
51+
run: dotnet nuget push *.nupkg --skip-duplicate -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }}

.github/workflows/build.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: build
2+
env: { DOTNET_NOLOGO: true }
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- src/**
9+
- test/**
10+
types:
11+
- opened
12+
- ready_for_review
13+
- review_requested
14+
jobs:
15+
pipeline:
16+
uses: panoukos41/NoSQLite/.github/workflows/_.yaml@main
17+
with:
18+
test: true

.github/workflows/publish.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: publish
2+
env: { DOTNET_NOLOGO: true }
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- v[0-9]+.[0-9]+.[0-9]+ # Only matches vX.X.X where X is a number
10+
paths:
11+
- src/**
12+
- test/**
13+
jobs:
14+
pipeline:
15+
uses: panoukos41/NoSQLite/.github/workflows/_.yaml@main
16+
with:
17+
publish: true
18+
secrets:
19+
nuget-key: ${{ secrets.NUGET_API_KEY }}

.github/workflows/release.yaml

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

0 commit comments

Comments
 (0)