Skip to content

Commit f984dbd

Browse files
authored
feat: full refactor (#67)
* feat: full refactor * fix: fix pr review comments * fix: fix README file * fix: fix tests * fix: fix integration test * fix: rebase to master * style: add stylecop to tests * test: refactor tests to smaller classes * docs: update README * fix: address PR comments
1 parent 17bf161 commit f984dbd

File tree

120 files changed

+5865
-6365
lines changed

Some content is hidden

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

120 files changed

+5865
-6365
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: wagoid/commitlint-github-action@v4
2424

2525
- name: Setup dotnet
26-
uses: actions/setup-dotnet@v1
26+
uses: actions/setup-dotnet@v2
2727
with:
2828
dotnet-version: 6.0.x
2929

@@ -32,14 +32,14 @@ jobs:
3232
id: cache
3333
with:
3434
path: ~/.nuget/packages
35-
key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/*.csproj') }}
35+
key: ${{ runner.os }}-nuget-${{ hashFiles('./**/*.csproj') }}
3636

3737
- name: Install dependencies
3838
if: steps.cache.outputs.cache-hit != 'true'
39-
run: dotnet restore ./src
39+
run: dotnet restore
4040

4141
- name: Run tests
42-
run: dotnet test ./src/stream-net-tests
42+
run: dotnet test
4343
env:
4444
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
4545
STREAM_API_KEY: ${{ secrets.STREAM_API_KEY }}

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ jobs:
2929
core.exportVariable('VERSION', version)
3030
3131
- name: Setup dotnet
32-
uses: actions/setup-dotnet@v1
32+
uses: actions/setup-dotnet@v2
3333
with:
3434
dotnet-version: "6.0.x"
3535

3636
- name: Create the package
3737
run: dotnet pack --configuration Release ./src
3838

3939
- name: Publish the package
40-
run: dotnet nuget push "./src/stream-net/bin/Release/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
40+
run: dotnet nuget push "./src/bin/Release/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
4141

4242
- name: Create release on GitHub
4343
uses: ncipollo/release-action@v1

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
*.suo
33
*.csproj.user
44
*.user
5-
*bin*
6-
*obj*
5+
bin
6+
obj
77
*.mdf
88
*.ldf
99
*.gitattributes

.stylecop.ruleset

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RuleSet Name="Rules for stream-chat-net" Description="Code analysis rules for stream-chat-net.csproj." ToolsVersion="14.0">
3+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.SpecialRules">
4+
<Rule Id="SA0001" Action="None" /> <!-- XML comment analysis is disabled due to project configuration -->
5+
</Rules>
6+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.ReadabilityRules">
7+
<Rule Id="SA1101" Action="None" /> <!-- Prefix local calls with this -->
8+
<Rule Id="SA1116" Action="None" /> <!-- The parameters should begin on the line after the declaration -->
9+
<Rule Id="SA1117" Action="None" /> <!-- The parameters should all be placed on the same line -->
10+
<Rule Id="SA1127" Action="None" /> <!-- Generic type constraints should be on their own line -->
11+
<Rule Id="SA1128" Action="None" /> <!-- Put constructor initializers on their own line -->
12+
</Rules>
13+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.OrderingRules">
14+
<Rule Id="SA1200" Action="None" /> <!-- Using directive should appear within a namespace declaration -->
15+
<Rule Id="SA1201" Action="None" /> <!-- A enum should not follow a class -->
16+
<Rule Id="SA1202" Action="None" /> <!-- 'public' members should come before 'internal' members -->
17+
<Rule Id="SA1204" Action="None" /> <!-- Static members should appear before non-static members -->
18+
</Rules>
19+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.NamingRules">
20+
<Rule Id="SA1306" Action="None" /> <!-- Field should begin with lower-case letter -->
21+
<Rule Id="SA1309" Action="None" /> <!-- Should not begin with an underscore -->
22+
</Rules>
23+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.MaintainabilityRules">
24+
<Rule Id="SA1402" Action="None" /> <!-- File may only contain a single type -->
25+
</Rules>
26+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.LayoutRules">
27+
<Rule Id="SA1503" Action="None" /> <!-- Braces should not be omitted -->
28+
<Rule Id="SA1516" Action="None" /> <!-- Elements should be separated by blank line -->
29+
<Rule Id="SA1518" Action="None" /> <!-- File may not end with a newline character -->
30+
<Rule Id="CS1591" Action="None" /> <!-- Missing XML comment for publicly visible type or member -->
31+
</Rules>
32+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.DocumentationRules">
33+
<Rule Id="SA1600" Action="None" /> <!-- Elements should be documented -->
34+
<Rule Id="SA1601" Action="None" /> <!-- Partial elements should be documented -->
35+
<Rule Id="SA1602" Action="None" /> <!-- Enumeration items should be documented -->
36+
<Rule Id="SA1611" Action="None" /> <!-- FThe documentation for parameter is missing -->
37+
<Rule Id="SA1615" Action="None" /> <!-- Element return value should be documented -->
38+
<Rule Id="SA1618" Action="None" /> <!-- TThe documentation for type parameter is missing -->
39+
<Rule Id="SA1623" Action="None" /> <!-- The property's documentation summary text should begin with: 'Gets or sets' -->
40+
<Rule Id="SA1629" Action="None" /> <!-- Documentation text should end with a period -->
41+
<Rule Id="SA1633" Action="None" /> <!-- The file header is missing or not located at the top of the file -->
42+
<Rule Id="SA1649" Action="None" /> <!-- File name should match first type name -->
43+
</Rules>
44+
</RuleSet>

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ It needs to look like this:
4242

4343
In CLI:
4444
```shell
45-
$ dotnet test -s .runsettings ./src/stream-net-tests
45+
$ dotnet test -s .runsettings
4646
```
4747

4848
Go to the next section to see how to use it in IDEs.
@@ -59,7 +59,7 @@ Recommended settings (`.vscode/settings.json`):
5959
```json
6060
{
6161
"omnisharp.testRunSettings": ".runsettings",
62-
"dotnet-test-explorer.testProjectPath": "./src/stream-net-tests",
62+
"dotnet-test-explorer.testProjectPath": "./tests",
6363
}
6464
```
6565

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2021 Stream.io Inc, and individual contributors.
1+
Copyright (c) 2015-2022 Stream.io Inc, and individual contributors.
22

33
All rights reserved.
44

0 commit comments

Comments
 (0)