Skip to content

Commit 9c599d1

Browse files
committed
Apply oss template
1 parent 0bfff7e commit 9c599d1

26 files changed

+1246
-1
lines changed

.editorconfig

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# EditorConfig is awesome:http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Don't use tabs for indentation.
7+
[*]
8+
indent_style = space
9+
# (Please don't specify an indent_size here; that has too many unintended consequences.)
10+
11+
# Code files
12+
[*.{cs,csx,vb,vbx}]
13+
indent_size = 4
14+
15+
# Xml project files
16+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,msbuildproj,props,targets}]
17+
indent_size = 2
18+
19+
# Xml config files
20+
[*.{ruleset,config,nuspec,resx,vsixmanifest,vsct}]
21+
indent_size = 2
22+
23+
# YAML files
24+
[*.{yaml,yml}]
25+
indent_size = 2
26+
27+
# JSON files
28+
[*.json]
29+
indent_size = 2
30+
31+
# Dotnet code style settings:
32+
[*.{cs,vb}]
33+
# Sort using and Import directives with System.* appearing first
34+
dotnet_sort_system_directives_first = true
35+
# Avoid "this." and "Me." if not necessary
36+
dotnet_style_qualification_for_field = false:suggestion
37+
dotnet_style_qualification_for_property = false:suggestion
38+
dotnet_style_qualification_for_method = false:suggestion
39+
dotnet_style_qualification_for_event = false:suggestion
40+
41+
# Use language keywords instead of framework type names for type references
42+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
43+
dotnet_style_predefined_type_for_member_access = true:suggestion
44+
45+
# Suggest more modern language features when available
46+
dotnet_style_object_initializer = true:suggestion
47+
dotnet_style_collection_initializer = true:suggestion
48+
dotnet_style_coalesce_expression = true:suggestion
49+
dotnet_style_null_propagation = true:suggestion
50+
dotnet_style_explicit_tuple_names = true:suggestion
51+
52+
# CSharp code style settings:
53+
54+
# IDE0040: Add accessibility modifiers
55+
dotnet_style_require_accessibility_modifiers = omit_if_default:error
56+
57+
# IDE0040: Add accessibility modifiers
58+
dotnet_diagnostic.IDE0040.severity = error
59+
60+
[*.cs]
61+
# Top-level files are definitely OK
62+
csharp_using_directive_placement = outside_namespace:silent
63+
csharp_style_namespace_declarations = block_scoped:silent
64+
csharp_prefer_simple_using_statement = true:suggestion
65+
csharp_prefer_braces = true:silent
66+
67+
# Prefer "var" everywhere
68+
csharp_style_var_for_built_in_types = true:suggestion
69+
csharp_style_var_when_type_is_apparent = true:suggestion
70+
csharp_style_var_elsewhere = true:suggestion
71+
72+
# Prefer method-like constructs to have an expression-body
73+
csharp_style_expression_bodied_methods = true:none
74+
csharp_style_expression_bodied_constructors = true:none
75+
csharp_style_expression_bodied_operators = true:none
76+
77+
# Prefer property-like constructs to have an expression-body
78+
csharp_style_expression_bodied_properties = true:none
79+
csharp_style_expression_bodied_indexers = true:none
80+
csharp_style_expression_bodied_accessors = true:none
81+
82+
# Suggest more modern language features when available
83+
csharp_style_pattern_matching_over_is_with_cast_check = true:error
84+
csharp_style_pattern_matching_over_as_with_null_check = true:error
85+
csharp_style_inlined_variable_declaration = true:suggestion
86+
csharp_style_throw_expression = true:suggestion
87+
csharp_style_conditional_delegate_call = true:suggestion
88+
89+
# Newline settings
90+
csharp_new_line_before_open_brace = all
91+
csharp_new_line_before_else = true
92+
csharp_new_line_before_catch = true
93+
csharp_new_line_before_finally = true
94+
csharp_new_line_before_members_in_object_initializers = true
95+
csharp_new_line_before_members_in_anonymous_types = true
96+
97+
# Test settings
98+
[**/*Tests*/**{.cs,.vb}]
99+
# xUnit1013: Public method should be marked as test. Allows using records as test classes
100+
dotnet_diagnostic.xUnit1013.severity = none
101+
102+
# CS9113: Parameter is unread (usually, ITestOutputHelper)
103+
dotnet_diagnostic.CS9113.severity = none
104+
105+
# Default severity for analyzer diagnostics with category 'Style'
106+
dotnet_analyzer_diagnostic.category-Style.severity = none
107+
108+
# VSTHRD200: Use "Async" suffix for async methods
109+
dotnet_diagnostic.VSTHRD200.severity = none

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# normalize by default
2+
* text=auto encoding=UTF-8
3+
*.sh text eol=lf
4+
5+
# These are windows specific files which we may as well ensure are
6+
# always crlf on checkout
7+
*.bat text eol=crlf
8+
*.cmd text eol=crlf

.github/dependabot.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Please see the documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: nuget
7+
directory: /
8+
schedule:
9+
interval: daily
10+
groups:
11+
Azure:
12+
patterns:
13+
- "Azure*"
14+
- "Microsoft.Azure*"
15+
Identity:
16+
patterns:
17+
- "System.IdentityModel*"
18+
- "Microsoft.IdentityModel*"
19+
System:
20+
patterns:
21+
- "System*"
22+
exclude-patterns:
23+
- "System.IdentityModel*"
24+
Extensions:
25+
patterns:
26+
- "Microsoft.Extensions*"
27+
Web:
28+
patterns:
29+
- "Microsoft.AspNetCore*"
30+
Tests:
31+
patterns:
32+
- "Microsoft.NET.Test*"
33+
- "xunit*"
34+
- "coverlet*"
35+
ThisAssembly:
36+
patterns:
37+
- "ThisAssembly*"
38+
ProtoBuf:
39+
patterns:
40+
- "protobuf-*"

.github/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- bydesign
5+
- dependencies
6+
- duplicate
7+
- question
8+
- invalid
9+
- wontfix
10+
- need info
11+
- techdebt
12+
authors:
13+
- devlooped-bot
14+
- dependabot
15+
- github-actions
16+
categories:
17+
- title: ✨ Implemented enhancements
18+
labels:
19+
- enhancement
20+
- title: 🐛 Fixed bugs
21+
labels:
22+
- bug
23+
- title: 📝 Documentation updates
24+
labels:
25+
- docs
26+
- documentation
27+
- title: 🔨 Other
28+
labels:
29+
- '*'
30+
exclude:
31+
labels:
32+
- dependencies

.github/workflows/build.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Builds and runs tests in all three supported OSes
2+
# Pushes CI feed if secrets.SLEET_CONNECTION is provided
3+
4+
name: build
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
configuration:
9+
type: choice
10+
description: Configuration
11+
options:
12+
- Release
13+
- Debug
14+
push:
15+
branches: [ main, dev, 'dev/*', 'feature/*', 'rel/*' ]
16+
paths-ignore:
17+
- changelog.md
18+
- readme.md
19+
pull_request:
20+
types: [opened, synchronize, reopened]
21+
22+
env:
23+
DOTNET_NOLOGO: true
24+
PackOnBuild: true
25+
GeneratePackageOnBuild: true
26+
VersionPrefix: 42.42.${{ github.run_number }}
27+
VersionLabel: ${{ github.ref }}
28+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
29+
MSBUILDTERMINALLOGGER: auto
30+
Configuration: ${{ github.event.inputs.configuration || 'Release' }}
31+
SLEET_FEED_URL: ${{ vars.SLEET_FEED_URL }}
32+
33+
defaults:
34+
run:
35+
shell: bash
36+
37+
jobs:
38+
os-matrix:
39+
runs-on: ubuntu-latest
40+
outputs:
41+
matrix: ${{ steps.lookup.outputs.matrix }}
42+
steps:
43+
- name: 🤘 checkout
44+
uses: actions/checkout@v4
45+
46+
- name: 🔎 lookup
47+
id: lookup
48+
shell: pwsh
49+
run: |
50+
$path = './.github/workflows/os-matrix.json'
51+
$os = if (test-path $path) { cat $path } else { '["ubuntu-latest"]' }
52+
echo "matrix=$os" >> $env:GITHUB_OUTPUT
53+
54+
build:
55+
needs: os-matrix
56+
name: build-${{ matrix.os }}
57+
runs-on: ${{ matrix.os }}
58+
strategy:
59+
matrix:
60+
os: ${{ fromJSON(needs.os-matrix.outputs.matrix) }}
61+
steps:
62+
- name: 🤘 checkout
63+
uses: actions/checkout@v4
64+
with:
65+
submodules: recursive
66+
fetch-depth: 0
67+
68+
- name: ⚙ dotnet
69+
uses: actions/setup-dotnet@v4
70+
with:
71+
dotnet-version: |
72+
6.x
73+
8.x
74+
9.x
75+
76+
- name: 🙏 build
77+
run: dotnet build -m:1 -bl:build.binlog
78+
79+
- name: 🧪 test
80+
run: |
81+
dotnet tool update -g dotnet-retest
82+
dotnet retest -- --no-build
83+
84+
- name: 🐛 logs
85+
uses: actions/upload-artifact@v4
86+
if: runner.debug && always()
87+
with:
88+
name: logs
89+
path: '*.binlog'
90+
91+
- name: 🚀 sleet
92+
env:
93+
SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }}
94+
if: env.SLEET_CONNECTION != ''
95+
run: |
96+
dotnet tool update sleet -g --allow-downgrade --version $(curl -s --compressed ${{ vars.SLEET_FEED_URL }} | jq '.["sleet:version"]' -r)
97+
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found"
98+
99+
dotnet-format:
100+
runs-on: ubuntu-latest
101+
steps:
102+
- name: 🤘 checkout
103+
uses: actions/checkout@v4
104+
with:
105+
submodules: recursive
106+
fetch-depth: 0
107+
108+
- name: ⚙ dotnet
109+
uses: actions/setup-dotnet@v4
110+
with:
111+
dotnet-version: |
112+
6.x
113+
8.x
114+
9.x
115+
116+
- name: ✓ ensure format
117+
run: |
118+
dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget
119+
dotnet format style --verify-no-changes -v:diag --exclude ~/.nuget

.github/workflows/changelog.config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
usernames-as-github-logins=true
2+
issues_wo_labels=true
3+
pr_wo_labels=true
4+
exclude-labels=bydesign,dependencies,duplicate,discussion,question,invalid,wontfix,need info,docs
5+
enhancement-label=:sparkles: Implemented enhancements:
6+
bugs-label=:bug: Fixed bugs:
7+
issues-label=:hammer: Other:
8+
pr-label=:twisted_rightwards_arrows: Merged:
9+
unreleased=false

.github/workflows/changelog.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: changelog
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
changelog:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: 🤖 defaults
12+
uses: devlooped/actions-bot@v1
13+
with:
14+
name: ${{ secrets.BOT_NAME }}
15+
email: ${{ secrets.BOT_EMAIL }}
16+
gh_token: ${{ secrets.GH_TOKEN }}
17+
github_token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: 🤘 checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
ref: main
24+
token: ${{ env.GH_TOKEN }}
25+
26+
- name: ⚙ ruby
27+
uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: 3.0.3
30+
31+
- name: ⚙ changelog
32+
run: |
33+
gem install github_changelog_generator
34+
github_changelog_generator --user ${GITHUB_REPOSITORY%/*} --project ${GITHUB_REPOSITORY##*/} --token $GH_TOKEN --o changelog.md --config-file .github/workflows/changelog.config
35+
36+
- name: 🚀 changelog
37+
run: |
38+
git add changelog.md
39+
(git commit -m "🖉 Update changelog with ${GITHUB_REF#refs/*/}" && git push) || echo "Done"

.github/workflows/dotnet-file.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Synchronizes .netconfig-configured files with dotnet-file
2+
name: dotnet-file
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * *"
7+
push:
8+
branches: [ 'dotnet-file' ]
9+
10+
env:
11+
DOTNET_NOLOGO: true
12+
13+
jobs:
14+
run:
15+
permissions:
16+
contents: write
17+
uses: devlooped/oss/.github/workflows/dotnet-file-core.yml@main
18+
secrets:
19+
BOT_NAME: ${{ secrets.BOT_NAME }}
20+
BOT_EMAIL: ${{ secrets.BOT_EMAIL }}
21+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)