Skip to content

Commit 8718d1d

Browse files
Merge pull request #338 from notion-dotnet/336-add-lint-step-in-build-pipeline
Add lint step in build pipeline 💚
2 parents 97b6562 + 00cbcbc commit 8718d1d

File tree

105 files changed

+418
-507
lines changed

Some content is hidden

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

105 files changed

+418
-507
lines changed

.editorconfig

Lines changed: 10 additions & 174 deletions
Large diffs are not rendered by default.

.github/scripts/check.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
dotnet jb inspectcode Notion.sln -f="Text" --no-build --include="**.cs" -o=".lint/CodeWarningResults.txt"
4+
5+
totalLines=$(file .lint/CodeWarningResults.txt | nl | wc -l)
6+
7+
if [[ "$totalLines" -gt 1 ]]; then
8+
echo "There are few linter warnings - please fix them before running the pipeline"
9+
cat .lint/CodeWarningResults.txt
10+
exit 1
11+
fi

.github/workflows/ci-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ jobs:
2121
- name: Restore dependencies
2222
run: dotnet restore
2323

24-
# Format the output of dotnet format
25-
- name: Add dotnet-format problem matcher
26-
uses: xt0rted/dotnet-format-problem-matcher@v1
27-
2824
# Install dotnet format as a global tool
29-
- name: Install dotnet format
25+
- name: Install dotnet tools
26+
run: dotnet tool restore
27+
28+
- name: Run Linter
3029
run: |
31-
dotnet tool install --global dotnet-format
32-
dotnet format --verify-no-changes --verbosity diagnostic
30+
sudo chmod +x ./.github/scripts/check.sh
31+
./.github/scripts/check.sh
32+
shell: bash
3333

3434
- name: Build
3535
run: dotnet build --no-restore

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,9 @@ MigrationBackup/
348348

349349
# Ionide (cross platform F# VS Code tools) working folder
350350
.ionide/
351+
352+
# Resharper linter
353+
.lint/
354+
355+
# Rider
356+
.idea/

Notion.sln.DotSettings

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PDF/@EntryIndexedValue">PDF</s:String>
3+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=API/@EntryIndexedValue">API</s:String>
4+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JSON/@EntryIndexedValue">JSON</s:String>
5+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue">URL</s:String></wpf:ResourceDictionary>

Src/Notion.Client/Api/ApiEndpoints.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ public static string Retrieve(string databaseId)
1111
return $"/v1/databases/{databaseId}";
1212
}
1313

14-
public static string List()
15-
{
16-
return "/v1/databases";
17-
}
18-
1914
public static string Query(string databaseId)
2015
{
2116
return $"/v1/databases/{databaseId}/query";
@@ -40,9 +35,9 @@ public static string List()
4035
}
4136

4237
/// <summary>
43-
/// Get the <see cref="uri string" /> for retrieve your token's bot user.
38+
/// Get the Uri <see cref="string" /> for retrieve your token's bot user.
4439
/// </summary>
45-
/// <returns>Returns a <see cref="uri string" /> retrieve your token's bot user.</returns>
40+
/// <returns>Returns a Uri <see cref="string" /> retrieve your token's bot user.</returns>
4641
public static string Me()
4742
{
4843
return "/v1/users/me";
@@ -62,10 +57,10 @@ public static string Update(string blockId)
6257
}
6358

6459
/// <summary>
65-
/// Get the <see cref="uri string" /> for deleting a block.
60+
/// Get the Uri <see cref="string" /> for deleting a block.
6661
/// </summary>
6762
/// <param name="blockId">Identifier for a Notion block</param>
68-
/// <returns>Returns a <see cref="uri string" /> for deleting a block.</returns>
63+
/// <returns>Returns a Uri <see cref="string" /> for deleting a block.</returns>
6964
public static string Delete(string blockId)
7065
{
7166
return $"/v1/blocks/{blockId}";
@@ -105,11 +100,11 @@ public static string UpdateProperties(string pageId)
105100
}
106101

107102
/// <summary>
108-
/// Get the <see cref="uri string" /> for retrieve page property item
103+
/// Get the Uri <see cref="string" /> for retrieve page property item
109104
/// </summary>
110105
/// <param name="pageId">Identifier for a Notion Page</param>
111106
/// <param name="propertyId">Identifier for a Notion Property</param>
112-
/// <returns></returns>
107+
/// <returns>Returns a Uri <see cref="string" /> for Retrieve page property item</returns>
113108
public static string RetrievePropertyItem(string pageId, string propertyId)
114109
{
115110
return $"/v1/pages/{pageId}/properties/{propertyId}";

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/AudioUpdateBlock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Notion.Client
44
{
5-
public class AudioUpdateBlock : UpdateBlock, IUpdateBlock
5+
public class AudioUpdateBlock : UpdateBlock
66
{
77
[JsonProperty("audio")]
88
public IFileObjectInput Audio { get; set; }

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/BulletedListItemUpdateBlock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Notion.Client
55
{
6-
public class BulletedListItemUpdateBlock : UpdateBlock, IUpdateBlock
6+
public class BulletedListItemUpdateBlock : UpdateBlock
77
{
88
[JsonProperty("bulleted_list_item")]
99
public Info BulletedListItem { get; set; }

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/CalloutUpdateBlock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Notion.Client
55
{
6-
public class CalloutUpdateBlock : UpdateBlock, IUpdateBlock
6+
public class CalloutUpdateBlock : UpdateBlock
77
{
88
[JsonProperty("callout")]
99
public Info Callout { get; set; }

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/CodeUpdateBlock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Notion.Client
55
{
6-
public class CodeUpdateBlock : UpdateBlock, IUpdateBlock
6+
public class CodeUpdateBlock : UpdateBlock
77
{
88
[JsonProperty("code")]
99
public Info Code { get; set; }

0 commit comments

Comments
 (0)