Skip to content

Commit b899754

Browse files
authored
.NET 9 (#13)
(signed) +semver:major
1 parent 9ece67f commit b899754

File tree

72 files changed

+670
-797
lines changed

Some content is hidden

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

72 files changed

+670
-797
lines changed

source/.editorconfig renamed to .editorconfig

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ root = true
33

44
[*]
55
charset = utf-8
6+
insert_final_newline = true
67

78
# C# files
89
[*.cs]
@@ -15,8 +16,8 @@ indent_style = space
1516
tab_width = 4
1617

1718
# New line preferences
18-
end_of_line = crlf
19-
insert_final_newline = true
19+
trim_trailing_whitespace = true
20+
2021

2122
#### .NET Coding Conventions ####
2223

@@ -37,7 +38,7 @@ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
3738
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
3839

3940
# Modifier preferences
40-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
41+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
4142

4243
# Expression-level preferences
4344
csharp_style_deconstructed_variable_declaration = true:suggestion
@@ -65,9 +66,9 @@ dotnet_code_quality_unused_parameters = all:suggestion
6566
#### C# Coding Conventions ####
6667

6768
# var preferences
68-
csharp_style_var_elsewhere = false:silent
69-
csharp_style_var_for_built_in_types = false:silent
70-
csharp_style_var_when_type_is_apparent = false:silent
69+
csharp_style_var_elsewhere = true:silent
70+
csharp_style_var_for_built_in_types = true:silent
71+
csharp_style_var_when_type_is_apparent = true:silent
7172

7273
# Expression-bodied members
7374
csharp_style_expression_bodied_accessors = true:silent
@@ -87,7 +88,7 @@ csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
8788
csharp_style_conditional_delegate_call = true:suggestion
8889

8990
# Modifier preferences
90-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
91+
csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async
9192

9293
# Code-block preferences
9394
csharp_prefer_braces = true:silent
@@ -100,6 +101,12 @@ csharp_style_prefer_range_operator = true:suggestion
100101
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
101102
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
102103

104+
# C# 10
105+
csharp_style_namespace_declarations = file_scoped:error
106+
csharp_style_prefer_primary_constructors = true
107+
dotnet_diagnostic.IDE0290.severity = error
108+
109+
103110
#### C# Formatting Rules ####
104111

105112
# New line preferences
@@ -146,3 +153,9 @@ csharp_space_between_square_brackets = false
146153
# Wrapping preferences
147154
csharp_preserve_single_line_blocks = true
148155
csharp_preserve_single_line_statements = true
156+
157+
158+
[*.csproj]
159+
indent_size = 2
160+
indent_style = space
161+
tab_width = 2

.github/workflows/CI.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Setup .NET
21-
uses: actions/setup-dotnet@v3
21+
uses: actions/setup-dotnet@v4
2222
with:
23-
dotnet-version: 8.0.x
23+
dotnet-version: 9.0.x
2424
- name: Restore dependencies
2525
run: dotnet restore source
2626
- name: Build

.github/workflows/PreRelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
1414
- run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup .NET
2020
uses: actions/setup-dotnet@v3
2121
with:
22-
dotnet-version: "8.0.x"
22+
dotnet-version: "9.0.x"
2323
- name: Determine Version
2424
id: gitversion
2525
uses: gittools/actions/gitversion/execute@v0

.github/workflows/Release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
1414
- run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup .NET
2020
uses: actions/setup-dotnet@v3
2121
with:
22-
dotnet-version: "8.0.x"
22+
dotnet-version: "9.0.x"
2323
- name: Determine Version
2424
id: gitversion
2525
uses: gittools/actions/gitversion/execute@v0

Samples/HelloWorld/HelloWorld.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<LangVersion>latest</LangVersion>

readme.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Slackbot.NET
22

3-
43
[![Build](https://github.com/slackbot-net/slackbot.net/workflows/CI/badge.svg)](https://github.com/slackbot.net/slackbot.net/actions)
54

6-
75
## What?
6+
87
An opinionated ASP.NET Core middleware to create simple Slackbots using the Slack event API.
98

109
### Install
11-
Download it from NuGet:[![NuGet](https://img.shields.io/nuget/dt/slackbot.net.endpoints.svg)](https://www.nuget.org/packages/slackbot.net.endpoints/)
10+
11+
Download it from
12+
NuGet:[![NuGet](https://img.shields.io/nuget/dt/slackbot.net.endpoints.svg)](https://www.nuget.org/packages/slackbot.net.endpoints/)
1213

1314
### Docs
1415

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
namespace Slackbot.Net.Endpoints.Abstractions;
22

3-
public class EventHandledResponse
3+
public class EventHandledResponse(string response)
44
{
5-
public string Response { get; }
6-
7-
public EventHandledResponse(string response)
8-
{
9-
Response = response;
10-
}
11-
}
5+
public string Response { get; } = response;
6+
}

source/src/Slackbot.Net.Endpoints/Abstractions/IHandleAppHomeOpened.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ namespace Slackbot.Net.Endpoints.Abstractions;
55
public interface IHandleAppHomeOpened
66
{
77
Task<EventHandledResponse> Handle(EventMetaData eventMetadata, AppHomeOpenedEvent payload);
8-
}
8+
}

source/src/Slackbot.Net.Endpoints/Abstractions/IHandleAppMentions.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ namespace Slackbot.Net.Endpoints.Abstractions;
55
public interface IHandleAppMentions
66
{
77
Task<EventHandledResponse> Handle(EventMetaData eventMetadata, AppMentionEvent slackEvent);
8-
bool ShouldHandle(AppMentionEvent slackEvent) => true;
9-
(string HandlerTrigger, string Description) GetHelpDescription() => ("", "");
10-
}
8+
9+
bool ShouldHandle(AppMentionEvent slackEvent)
10+
{
11+
return true;
12+
}
13+
14+
(string HandlerTrigger, string Description) GetHelpDescription()
15+
{
16+
return ("", "");
17+
}
18+
}

source/src/Slackbot.Net.Endpoints/Abstractions/IHandleInteractiveBlockActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ namespace Slackbot.Net.Endpoints.Abstractions;
55
public interface IHandleInteractiveBlockActions
66
{
77
Task<EventHandledResponse> Handle(BlockActionInteraction blockActionEvent);
8-
}
8+
}

0 commit comments

Comments
 (0)