diff --git a/.editorconfig b/.editorconfig index ef69bbe..c434eb5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,11 +13,11 @@ indent_style = space indent_size = 4 # Xml project files -[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,msbuildproj,props,targets}] indent_size = 2 # Xml config files -[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] +[*.{ruleset,config,nuspec,resx,vsixmanifest,vsct}] indent_size = 2 # YAML files @@ -50,16 +50,23 @@ dotnet_style_null_propagation = true:suggestion dotnet_style_explicit_tuple_names = true:suggestion # CSharp code style settings: + +# IDE0040: Add accessibility modifiers +dotnet_style_require_accessibility_modifiers = omit_if_default:error + +# IDE0040: Add accessibility modifiers +dotnet_diagnostic.IDE0040.severity = error + [*.cs] # Prefer "var" everywhere csharp_style_var_for_built_in_types = true:suggestion csharp_style_var_when_type_is_apparent = true:suggestion csharp_style_var_elsewhere = true:suggestion -# Prefer method-like constructs to have a block body -csharp_style_expression_bodied_methods = false:none -csharp_style_expression_bodied_constructors = false:none -csharp_style_expression_bodied_operators = false:none +# Prefer method-like constructs to have an expression-body +csharp_style_expression_bodied_methods = true:none +csharp_style_expression_bodied_constructors = true:none +csharp_style_expression_bodied_operators = true:none # Prefer property-like constructs to have an expression-body csharp_style_expression_bodied_properties = true:none @@ -67,8 +74,8 @@ csharp_style_expression_bodied_indexers = true:none csharp_style_expression_bodied_accessors = true:none # Suggest more modern language features when available -csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion -csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:error +csharp_style_pattern_matching_over_as_with_null_check = true:error csharp_style_inlined_variable_declaration = true:suggestion csharp_style_throw_expression = true:suggestion csharp_style_conditional_delegate_call = true:suggestion @@ -80,6 +87,3 @@ csharp_new_line_before_catch = true csharp_new_line_before_finally = true csharp_new_line_before_members_in_object_initializers = true csharp_new_line_before_members_in_anonymous_types = true - -# RS2008: Enable analyzer release tracking -dotnet_diagnostic.RS2008.severity = none diff --git a/.gitattributes b/.gitattributes index 1ff0c42..7c37579 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,63 +1,24 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### -* text=auto +# sln, csproj files (and friends) are always CRLF, even on linux +*.sln text eol=crlf +*.proj text eol=crlf +*.csproj text eol=crlf -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp +# These are windows specific files which we may as well ensure are +# always crlf on checkout +*.bat text eol=crlf +*.cmd text eol=crlf -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary +# Opt in known filetypes to always normalize line endings on checkin +# and always use native endings on checkout +*.c text +*.config text +*.h text +*.cs text +*.md text +*.tt text +*.txt text -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain +# Some must always be checked out as lf so enforce that for those files +# If these are not lf then bash/cygwin on windows will not be able to +# excute the files +*.sh text eol=lf \ No newline at end of file diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..a105ac5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: devlooped diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..67f7595 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,50 @@ +--- +name: Bug Report +about: Create a report to help us fix a problem. +title: '' +labels: 'bug' +assignees: '' +--- + +## Describe the Bug + + + +## Steps to Reproduce + + + +```c# +public class ReproTest +{ + [Fact] + public void Repro() + { + // arrange + + // act + + // assert + } +} +``` + +## Expected Behavior + + + +## Exception with Stack Trace + + + +```text +Put the exception with stack trace here. +``` + +## Version Info + + + +## Additional Info + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..d29d9bf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Questions + url: https://github.com/kzu/oss/discussions?discussions_q=category%3AQ%26A + about: Want to know how to do something? Check out the Discussions > Q&A area! + - name: Ideas + url: https://github.com/kzu/oss/discussions?discussions_q=category%3AIdeas + about: Suggest an idea to make the project better through the Discussions > Ideas area! diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c8ca9b7..9bd9700 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,6 @@ +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + version: 2 updates: - package-ecosystem: nuget diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ed592f..1b62350 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,10 @@ -ο»Ώname: build +ο»Ώ# Builds and runs tests in all three supported OSes +# Pushes CI feed if secrets.SLEET_CONNECTION is provided + +name: build on: push: - branches: ['*'] + branches: [ main, dev, 'feature/*', 'rel/*' ] pull_request: types: [opened, synchronize, reopened] @@ -9,20 +12,58 @@ env: DOTNET_NOLOGO: true MSBUILDDISABLENODEREUSE: 1 +defaults: + run: + shell: bash + jobs: - build: + dotnet-format: runs-on: ubuntu-latest steps: - name: 🀘 checkout uses: actions/checkout@v2 - - name: βš™ dotnet 5.0.x - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.x + - name: βœ“ ensure format + run: | + dotnet tool update -g dotnet-format --version 5.0.* --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json + dotnet format --check -v:diag + + build: + name: build-${{ matrix.os }} + needs: dotnet-format + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + steps: + - name: 🀘 checkout + uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - name: πŸ™ build - run: dotnet build -p:versionsuffix="$(git name-rev --name-only --refs=refs/heads/* HEAD).$GITHUB_RUN_NUMBER" + run: dotnet build -m:1 -bl:build.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/} + + - name: πŸ§ͺ test + run: dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m -d $GITHUB_WORKSPACE/logs/${{ matrix.os }}.txt -r $GITHUB_WORKSPACE/logs + + - name: πŸ“¦ pack + run: dotnet pack -m:1 -bl:pack.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/} + + - name: πŸ”Ό logs + if: always() + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }} + path: | + **/*.binlog + logs/**/*.* + + # Only push CI package to sleet feed if building on ubuntu (fastest) - name: πŸš€ sleet - if: ${{ !github.event.pull_request.head.repo.fork }} + env: + SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }} + if: matrix.os == 'ubuntu-latest' && env.SLEET_CONNECTION != '' run: | dotnet tool install -g --version 3.2.0 sleet - sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" \ No newline at end of file + sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..5bf5c0d --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,37 @@ +ο»Ώname: changelog +on: + release: + types: [released] + +env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - name: πŸ” GH_TOKEN + if: env.GH_TOKEN == '' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV + + - name: 🀘 checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: main + token: ${{ env.GH_TOKEN }} + + - name: βš™ changelog + uses: faberNovel/github-changelog-generator-action@master + with: + options: --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md + + - name: πŸš€ changelog + run: | + git config --local user.name github-actions + git config --local user.email github-actions@github.com + git add changelog.md + git commit -m "πŸ–‰ Update changelog with ${GITHUB_REF#refs/*/}" + git push \ No newline at end of file diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..eea5601 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,44 @@ +name: pages +on: + push: + branches: + - main + - pages + +jobs: + gh-pages: + runs-on: ubuntu-latest + steps: + - name: 🀘 checkout + uses: actions/checkout@v2 + + - name: βš™ jekyll + run: | + sudo gem install bundler + bundle install + + - name: πŸ–‰ repo + run: echo "REPOSITORY=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV + + - name: πŸ™ build + run: bundle exec jekyll build -b ${{ env.REPOSITORY }} + env: + JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: βœ“ commit + run: | + cd _site + git init + git add -A + git config --local user.email "hello@clarius.org" + git config --local user.name "GitHub Action" + git commit -m "Publish pages from ${GITHUB_REPOSITORY}@${GITHUB_SHA:0:9}" + + - name: πŸš€ push + uses: ad-m/github-push-action@v0.6.0 + with: + github_token: ${{ secrets.CLARIUS_ACCESS_TOKEN }} + repository: clarius/${{ env.REPOSITORY }} + branch: gh-pages + force: true + directory: ./_site \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f1e4867 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,40 @@ +ο»Ώ# Builds a final release version and pushes to nuget.org +# whenever a release is published. +# Requires: secrets.NUGET_API_KEY + +name: publish +on: + release: + types: [released] + +env: + DOTNET_NOLOGO: true + Configuration: Release + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: 🀘 checkout + uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + + - name: πŸ™ build + run: dotnet build -m:1 -bl:build.binlog -p:version=${GITHUB_REF#refs/*/v} -p:RepositoryBranch=${GITHUB_REF#refs/*/} + + - name: πŸ§ͺ test + run: dotnet test --no-build -m:1 + + - name: πŸ“¦ pack + run: dotnet pack -m:1 -bl:pack.binlog -p:version=${GITHUB_REF#refs/*/v} -p:RepositoryBranch=${GITHUB_REF#refs/*/} + + - name: πŸ”Ό logs + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + path: '**/*.binlog' + + - name: πŸš€ nuget + run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml new file mode 100644 index 0000000..9f96526 --- /dev/null +++ b/.github/workflows/release-artifacts.yml @@ -0,0 +1,49 @@ +# Builds a release version of the project and uploads +# as artifacts of the release for verification/history + +name: release-artifacts +on: + release: + types: [published] + +jobs: + release-artifacts: + runs-on: ubuntu-latest + steps: + - name: 🀘 checkout + uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + + - name: 🏷 current + run: echo "CURRENT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: πŸ™ build + run: dotnet build -m:1 -bl:build.binlog -p:version=${GITHUB_REF#refs/*/v} -p:RepositoryBranch=${GITHUB_REF#refs/*/} + + - name: πŸ§ͺ test + run: dotnet test --no-build -m:1 + + - name: πŸ“¦ pack + run: dotnet pack -m:1 -bl:pack.binlog -p:version=${GITHUB_REF#refs/*/v} -p:RepositoryBranch=${GITHUB_REF#refs/*/} + + - name: πŸ”Ό logs + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + path: '**/*.binlog' + + - name: πŸ”½ gh + run: | + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 + sudo apt-add-repository https://cli.github.com/packages + sudo apt update + sudo apt install gh + + - name: πŸ”Ό artifacts + shell: pwsh + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gci .\bin -Recurse -Filter *.nupkg | %{ gh release upload --clobber $env:CURRENT_TAG $_ } \ No newline at end of file diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml new file mode 100644 index 0000000..5781dd6 --- /dev/null +++ b/.github/workflows/release-notes.yml @@ -0,0 +1,56 @@ +# Updates a release with release notes +name: release-notes + +on: + release: + types: [published] + +jobs: + release-notes: + runs-on: ubuntu-latest + steps: + - name: 🀘 checkout + uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + + - name: 🏷 current + run: echo "CURRENT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: 🏷 since + run: echo "SINCE_TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))" >> $GITHUB_ENV + + - name: βš™ changelog + uses: faberNovel/github-changelog-generator-action@master + if: env.SINCE_TAG != '' + with: + options: --token ${{ secrets.GITHUB_TOKEN }} --since-tag ${{ env.SINCE_TAG }} --o changelog.md + + - name: βš™ changelog + uses: faberNovel/github-changelog-generator-action@master + if: env.SINCE_TAG == '' + with: + options: --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md + + - name: πŸ–‰ release + shell: pwsh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + $id = iwr "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/releases/tags/$env:CURRENT_TAG" | + select -ExpandProperty Content | + ConvertFrom-Json | + select -ExpandProperty id + + $notes = (Get-Content .\changelog.md | where { !($_ -like '\*') } | %{ $_.replace('\', '\\') }) -join '\n' + $headers = @{ 'Accept'='application/vnd.github.v3+json;charset=utf-8'; 'Authorization' = "bearer $env:GITHUB_TOKEN" } + $body = '{ "body":"' + $notes + '" }' + + # ensure we can convert to json + $body | ConvertFrom-Json | ConvertTo-Json + + # patch & render response nicely + iwr -Body $body "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/releases/$id" -Method PATCH -Headers $headers | + select -ExpandProperty Content | + ConvertFrom-Json | + ConvertTo-Json \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 07824bf..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,23 +0,0 @@ -ο»Ώname: release -on: - release: - types: [created] - -env: - DOTNET_NOLOGO: true - MSBUILDDISABLENODEREUSE: 1 - -jobs: - push: - runs-on: ubuntu-latest - steps: - - name: 🀘 checkout - uses: actions/checkout@v2 - - name: βš™ dotnet 5.0.x - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.x - - name: πŸ™ build - run: dotnet build -p:version=${GITHUB_REF#refs/*/v} - - name: πŸš€ push - run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate \ No newline at end of file diff --git a/.github/workflows/sponsors.ps1 b/.github/workflows/sponsors.ps1 new file mode 100644 index 0000000..52fe688 --- /dev/null +++ b/.github/workflows/sponsors.ps1 @@ -0,0 +1,57 @@ +$event = Get-Content -Path $env:GITHUB_EVENT_PATH | ConvertFrom-Json +$author = $event.issue ? $event.issue.user.node_id : $event.pull_request.user.node_id + +if ($author -eq $null) { + throw 'No user id found' +} + +echo "Looking up sponsorship from $env:GITHUB_ACTOR ..." + +$query = gh api graphql --paginate -f owner='devlooped' -f query=' +query($owner: String!, $endCursor: String) { + organization (login: $owner) { + sponsorshipsAsMaintainer (first: 100, after: $endCursor) { + nodes { + sponsorEntity { + ... on Organization { id, name } + ... on User { id, name } + } + tier { monthlyPriceInDollars } + } + pageInfo { + hasNextPage + endCursor + } + } + } +} +' + +$amount = + $query | + ConvertFrom-Json | + select @{ Name='nodes'; Expression={$_.data.organization.sponsorshipsAsMaintainer.nodes}} | + select -ExpandProperty nodes | + where { $_.sponsorEntity.id -eq $author } | + select -ExpandProperty tier | + select -ExpandProperty monthlyPriceInDollars + +if ($null -eq $amount) { + echo "Author is not a sponsor! Nothing left to do." + return +} + +echo "Author is a sponsor!" + +$headers = @{ 'Accept'='application/vnd.github.v3+json;charset=utf-8'; 'Authorization' = "bearer $env:GH_TOKEN" } + +# Try creating the labels, ignore errors (i.e. already created) +iwr -Body '{ "name":"sponsor :purple_heart:", "color":"ea4aaa", "description":"sponsor" }' "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/labels" -Method Post -Headers $headers -SkipHttpErrorCheck -UseBasicParsing | select -ExpandProperty StatusCode +iwr -Body '{ "name":"sponsor :yellow_heart:", "color":"ea4aaa", "description":"sponsor++" }' "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/labels" -Method Post -Headers $headers -SkipHttpErrorCheck -UseBasicParsing | select -ExpandProperty StatusCode + +$number = $event.issue ? $event.issue.number : $event.pull_request.number +$labels = $amount -ge 100 ? '{"labels":["sponsor :yellow_heart:"]}' : '{"labels":["sponsor :purple_heart:"]}' + +iwr -Body $labels "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/issues/$number/labels" -Method Post -Headers $headers -SkipHttpErrorCheck -UseBasicParsing | select -ExpandProperty StatusCode + +echo 'Label applied' \ No newline at end of file diff --git a/.github/workflows/sponsors.yml b/.github/workflows/sponsors.yml new file mode 100644 index 0000000..3e909f6 --- /dev/null +++ b/.github/workflows/sponsors.yml @@ -0,0 +1,25 @@ +# Runs on new issues/PRs and applies sponsor labels + +name: sponsors +on: + pull_request: + types: [opened] + issues: + types: [opened] + +jobs: + sponsors: + runs-on: windows-latest + steps: + - name: 🀘 checkout + uses: actions/checkout@v2 + + - name: πŸ”½ gh + run: | + iwr -useb get.scoop.sh | iex + scoop install gh + + - name: πŸ’› sponsors + run: ./.github/workflows/sponsors.ps1 + env: + GH_TOKEN: ${{ secrets.DEVLOOPED_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7fa12b6..043c7d4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,29 @@ -.nuget -.vs -.idea -out bin obj -*.nupkg -*.lock.json -*.nuget.props -*.nuget.targets -dotnet-nugetize.items +artifacts +pack +.vs +.vscode + *.suo +*.sdf +*.userprefs *.user +*.nupkg +*.metaproj +*.tmp *.cache -*.log *.binlog -*.rsp \ No newline at end of file +*.zip + +.nuget +*.lock.json +*.nuget.props +*.nuget.targets + +node_modules +_site +.jekyll-metadata +.jekyll-cache +Gemfile.lock +package-lock.json \ No newline at end of file diff --git a/.netconfig b/.netconfig new file mode 100644 index 0000000..ad8019d --- /dev/null +++ b/.netconfig @@ -0,0 +1,131 @@ +[file] + url = https://github.com/devlooped/oss + url = https://github.com/devlooped/.github +[file ".editorconfig"] + url = https://github.com/devlooped/oss/blob/main/.editorconfig + etag = 985aa022503959d35b03c870f07ae604cead7580d260775235ef6665aa9a6cbe + weak +[file ".gitattributes"] + url = https://github.com/devlooped/oss/blob/main/.gitattributes + etag = 7acb32f5fa6d4ccd9c824605a7c2b8538497f0068c165567807d393dcf4d6bb7 + weak +[file ".github/FUNDING.yml"] + url = https://github.com/devlooped/.github/blob/main/.github/FUNDING.yml + etag = a944c728facd033bbdfb4ff8d0ef10d0b3a457c277dc499458df0ffc7e6409da + weak +[file ".github/ISSUE_TEMPLATE/bug.md"] + url = https://github.com/devlooped/oss/blob/main/.github/ISSUE_TEMPLATE/bug.md + etag = 026852ba1f1921f3a043bb5e09cd7a2c3d9a33ec51f48e524dc3a2ab72de3141 + weak +[file ".github/ISSUE_TEMPLATE/config.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/ISSUE_TEMPLATE/config.yml + etag = b5ce64e6967276086eb89f86f57364da9c4deac988c7e0e04810a4f8caaa1400 + weak +[file ".github/dependabot.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml + etag = 2fc8a0d2b47091b058ae3e1f68333492044b49a684621f4939a0bce5bff869d5 + weak +[file ".github/workflows/build.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml + etag = 337666cc9f17f0cf395df950370967381f6de5134cc215f61035d36f38fed3a3 + weak +[file ".github/workflows/changelog.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.yml + etag = 7f5bb52dff2908e4a4b60e06b4f8f1d497864554076f916aa6e5e8c9b2c6b2d2 + weak +[file ".github/workflows/publish.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml + etag = 8067230717247263ad661c69780fdfdf4b6f140287517fee9c5d4e64d4b737af + weak +[file ".github/workflows/release-artifacts.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/release-artifacts.yml + etag = 8be10a2fbeb9e6924d8b08e58a61a0f69138352c6f5477b53dcd34c26d8d35ef + weak +[file ".github/workflows/release-notes.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/release-notes.yml + etag = c987e5b93b002c5a2a63304f677eb969b7b6e274b77ef4392aeef4d9ca7e10dd + weak +[file ".github_changelog_generator"] + url = https://github.com/devlooped/oss/blob/main/.github_changelog_generator + etag = a724e0cbbad99a04e6cd3738a5f3ec5416dd5f29ae7073e7afe5471e73107e42 + weak +[file ".gitignore"] + url = https://github.com/devlooped/oss/blob/main/.gitignore + etag = 925782b685859e07040442303b411bebd1c75b4fe4e075f547e067f33f323814 + weak +[file ".netconfig"] + url = https://github.com/devlooped/oss/blob/main/.netconfig + etag = 02de46ea12aee590c29d9c824b5a9ad067aa9d06b22c81d44505f1345d74fd81 + weak +[file "Directory.Build.rsp"] + url = https://github.com/devlooped/oss/blob/main/Directory.Build.rsp + etag = 6a6c6e1d3895df953abf14c82b0899e3eea75cdcd679f6212dcfea15183d73d6 + weak +[file "_config.yml"] + url = https://github.com/devlooped/oss/blob/main/_config.yml + etag = 9139148f845adf503fd3c3c140eb64421fc476a1f9c027fc50825c0efb05f557 + weak +[file "assets/css/style.scss"] + url = https://github.com/devlooped/oss/blob/main/assets/css/style.scss + etag = 2c86a074a6c8c2f6af806908a57215439fad563830b4af8fbed1a3aabaede0cf + weak +[file "assets/images/sponsors.png"] + url = https://github.com/devlooped/oss/blob/main/assets/images/sponsors.png + etag = f152d1038eb04cb1596a13377b032f18f2402c969130601384fb377ce5ddefbd + weak +[file "assets/images/sponsors.svg"] + url = https://github.com/devlooped/oss/blob/main/assets/images/sponsors.svg + etag = 182780a2d68bdba9069000aef75712ab81c307eee1317bcd29d35563f523ba98 + weak +[file "code-of-conduct.md"] + url = https://github.com/devlooped/oss/blob/main/code-of-conduct.md + etag = 4857c01bb695f09bf6912d778951c3065d9dd565e5de3d0827f40432d0e4c613 + weak +[file "license.txt"] + url = https://github.com/devlooped/oss/blob/main/license.txt + etag = 2c6335b37e4ae05eea7c01f5d0c9d82b49c488f868a8b5ba7bff7c6ff01f3994 + weak +[file "readme.md"] + url = https://github.com/devlooped/oss/blob/main/readme.md + etag = fb40c68e1ac60f454d9a87050b8bd8b6a0890d4c6949055d3eb04e260e4927a6 + weak +[file "security.md"] + url = https://github.com/devlooped/oss/blob/main/security.md + etag = fc8101fd914820db3e6b42d608dc46aefbc60c830ac721ed3917daead3727dbd + weak +[file "src/Directory.Build.props"] + url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props + etag = 16762b7a7fbdc00c1912c469962131c912856115826db7628167517eea918324 + weak +[file "src/Directory.Build.targets"] + url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets + etag = f90be354c63f82bcfac68246648aee9a5a2842f1e4b66421b850939635610532 + weak +[file "src/icon.png"] + url = https://github.com/devlooped/oss/blob/main/src/icon.png + etag = 8b42109e3bd1da0fc50c67679c6d20aeac98f922870675e127cf19b8f2919971 + weak +[file "src/kzu.snk"] + url = https://github.com/devlooped/oss/blob/main/src/kzu.snk + etag = b8d789b5b6bea017cdcc8badcea888ad78de3e34298efca922054e9fb0e7b6b9 + weak +[file "support.md"] + url = https://github.com/devlooped/oss/blob/main/support.md + etag = 2d47e2fc4fdfa3515203d452674566e3df507461f9938f451a06d79deb687d24 + weak +[file ".github/workflows/pages.yml"] + url = https://github.com/devlooped/.github/blob/main/.github/workflows/pages.yml + etag = f2bc91354dc634de00aa9f502eb69e34368c315bcdbe422cde95ddd850d31669 + weak +[file ".github/workflows/sponsors.ps1"] + url = https://github.com/devlooped/.github/blob/main/.github/workflows/sponsors.ps1 + etag = 5e29155d35ab142150e900df391363e03e5a15a8be46e4adeeb4c6fd34013289 + weak +[file ".github/workflows/sponsors.yml"] + url = https://github.com/devlooped/.github/blob/main/.github/workflows/sponsors.yml + etag = 0142be767cd24215b54631593cfab08d711001b71ba4fc358e412f27c434a227 + weak +[file "Gemfile"] + url = https://github.com/devlooped/.github/blob/main/Gemfile + etag = d45832acd078778ffebf260000f6d25172a131f51684744d7e982da2a47170ce + weak diff --git a/Directory.Build.rsp b/Directory.Build.rsp new file mode 100644 index 0000000..7c0dbc1 --- /dev/null +++ b/Directory.Build.rsp @@ -0,0 +1,5 @@ +# See https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-response-files +-nr:false +-m:1 +-v:m +-clp:Summary;ForceNoAlign \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..025f43f --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'github-pages', '~> 209', group: :jekyll_plugins \ No newline at end of file diff --git a/SmallSharp.sln b/SmallSharp.sln index f620560..0f8204d 100644 --- a/SmallSharp.sln +++ b/SmallSharp.sln @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .github\dependabot.yml = .github\dependabot.yml src\Directory.Build.props = src\Directory.Build.props src\Directory.Build.targets = src\Directory.Build.targets + src\Directory.props = src\Directory.props global.json = global.json README.md = README.md EndProjectSection @@ -18,10 +19,16 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{FFAB61A4-707D-4C79-A364-BF259FA865BB}" ProjectSection(SolutionItems) = preProject .github\workflows\build.yml = .github\workflows\build.yml - .github\workflows\release.yml = .github\workflows\release.yml + .github\workflows\changelog.yml = .github\workflows\changelog.yml + .github\workflows\pages.yml = .github\workflows\pages.yml + .github\workflows\publish.yml = .github\workflows\publish.yml + .github\workflows\release-artifacts.yml = .github\workflows\release-artifacts.yml + .github\workflows\release-notes.yml = .github\workflows\release-notes.yml + .github\workflows\sponsors.ps1 = .github\workflows\sponsors.ps1 + .github\workflows\sponsors.yml = .github\workflows\sponsors.yml EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmallSharp.Build", "src\SmallSharp.Build\SmallSharp.Build.csproj", "{62834B0C-A2C2-4449-9E2A-00CC390A79BE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmallSharp.Build", "src\SmallSharp.Build\SmallSharp.Build.csproj", "{62834B0C-A2C2-4449-9E2A-00CC390A79BE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/_config.yml b/_config.yml index f980e76..a61f7e0 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1,3 @@ theme: jekyll-theme-slate + +exclude: [ 'src/', '*.sln', 'Gemfile*', '*.rsp' ] \ No newline at end of file diff --git a/assets/css/style.scss b/assets/css/style.scss new file mode 100644 index 0000000..f83369c --- /dev/null +++ b/assets/css/style.scss @@ -0,0 +1,17 @@ +--- +--- + +@import "jekyll-theme-slate"; + +.inner { + max-width: 960px; +} + +pre, code { + background-color: unset; + font-size: unset; +} + + code { + font-size: 0.80em; +} \ No newline at end of file diff --git a/assets/images/sponsors.png b/assets/images/sponsors.png new file mode 100644 index 0000000..f82f5bd Binary files /dev/null and b/assets/images/sponsors.png differ diff --git a/assets/images/sponsors.svg b/assets/images/sponsors.svg new file mode 100644 index 0000000..1a1d80f --- /dev/null +++ b/assets/images/sponsors.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/code-of-conduct.md b/code-of-conduct.md new file mode 100644 index 0000000..775f221 --- /dev/null +++ b/code-of-conduct.md @@ -0,0 +1,6 @@ +# Code of Conduct + +This project has adopted the code of conduct defined by the Contributor Covenant +to clarify expected behavior in our community. + +For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct). diff --git a/global.json b/global.json deleted file mode 100644 index 16a4432..0000000 --- a/global.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "sdk": { - "version": "5.0.100-rc.1.20452.10" - }, - "tools": { - "dotnet": "5.0.100-rc.1.20452.10" - } -} \ No newline at end of file diff --git a/LICENSE b/license.txt similarity index 93% rename from LICENSE rename to license.txt index 0498a9a..83969dc 100644 --- a/LICENSE +++ b/license.txt @@ -1,6 +1,6 @@ -MIT License +The MIT License (MIT) -Copyright (c) 2020 Daniel Cazzulino +Copyright (c) Daniel Cazzulino and Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/README.md b/readme.md similarity index 100% rename from README.md rename to readme.md diff --git a/security.md b/security.md new file mode 100644 index 0000000..01b219a --- /dev/null +++ b/security.md @@ -0,0 +1,9 @@ +# Security Policy + +## Reporting a Vulnerability + +Security issues and bugs should be reported privately by emailing security@devlooped.com. +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your +original message and ping [@devlooped](https://twitter.com/devlooped) on Twitter. + +Please do not open issues for anything you think might have a security implication. \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 0d83ca7..f3523ae 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,44 +1,132 @@ + + + + false + + true + + + $(CI) + + + kzu - Copyright 2020 - Daniel Cazzulino + Copyright (C) Daniel Cazzulino and Contributors. All rights reserved. false MIT icon.png - dotnet - https://www.cazzulino.com/SmallSharp/ - - 42.42.42 - $(Version) true true - $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\bin)) + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\bin')) - true + + true + + https://pkg.kzu.io/index.json;https://api.nuget.org/v3/index.json;$(RestoreSources) + + + + + + + + + Release + Latest + + + false + embedded true - Preview enable - false - $(DefaultItemExcludes);*.binlog;*.zip + + + $(MSBuildProjectName) + $(MSBuildProjectName.IndexOf('.')) + $(MSBuildProjectName.Substring(0, $(RootNamespaceDot))) + + + $(DefaultItemExcludes);*.binlog;*.zip;*.rsp;*.items;**/TestResults/**/*.* + + + $(MSBuildThisFileDirectory)kzu.snk + + 002400000480000094000000060200000024000052534131000400000100010051155fd0ee280be78d81cc979423f1129ec5dd28edce9cd94fd679890639cad54c121ebdb606f8659659cd313d3b3db7fa41e2271158dd602bb0039a142717117fa1f63d93a2d288a1c2f920ec05c4858d344a45d48ebd31c1368ab783596b382b611d8c92f9c1b3d338296aa21b12f3bc9f34de87756100c172c52a24bad2db + 00352124762f2aa5 + true + + true + true + true + true + + + true + + + false + + + NU5105;$(NoWarn) + + true - - false - true + + + 42.42.42 - - - - - - - - + + <_VersionLabel>$(VersionLabel.Replace('refs/heads/', '')) + + <_VersionLabel Condition="$(_VersionLabel.Contains('refs/pull/'))">$(VersionLabel.TrimEnd('.0123456789')) + + <_VersionLabel>$(_VersionLabel.Replace('refs/pull/', 'pr')) + + <_VersionLabel>$(_VersionLabel.Replace('/merge', '')) + + <_VersionLabel>$(_VersionLabel.Replace('/', '-')) + + + $(_VersionLabel) + + + + + + + + + - + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 3277fb2..018b2e5 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,25 +1,151 @@ + + + + + false + true + + + + + 1.0.0 + $(VersionPrefix)-$(VersionSuffix) + $(VersionPrefix) + + + + + $(PackFolder) + $(PackFolderPath.Replace('\$(TargetFramework)', '')) + $(IntermediateOutputPath)$(PackFolderPath)\ + $(OutputPath)$(PackFolderPath)\ + $(OutputPath) + + + + + $(DefineConstants);$(TargetFramework.ToUpperInvariant().TrimEnd('0').TrimEnd('.').Replace('.', '')) + - <_PackageFiles Include="$(MSBuildThisFileDirectory)_._" PackagePath="lib/netstandard2.0/_._" /> - + + + + - + + + + + + + + + + + + + + + + + + $(PrivateRepositoryUrl) + + + + $(SourceRevisionId) + $(SourceRevisionId.Substring(0, 9)) + + $(RepositorySha) + + + + + + - - $(Description) + $(RepositoryUrl) + $(Description) -Built from $(RepositoryUrl)/tree/$(SourceRevisionId.Substring(0, 9)) +Built from $(RepositoryUrl)/tree/$(RepositorySha) - $(Description) + $(Description) + $(RepositoryUrl)/blob/main/changelog.md - + + + + + + + + + + + + + + + + + + + + + i.ItemSpec)) + { + Log.LogMessage(MessageImportance.High, "{0}: {1}", itemName, item.ItemSpec); + foreach (var name in item.MetadataNames.OfType().OrderBy(_ => _)) + { + try + { + Log.LogMessage(MessageImportance.High, "\t{0}={1}", name, item.GetMetadata(name)); + } + catch { } + } + } + ]]> + + + + diff --git a/src/Directory.props b/src/Directory.props new file mode 100644 index 0000000..d242123 --- /dev/null +++ b/src/Directory.props @@ -0,0 +1,10 @@ + + + + false + dotnet csharp + true + NU1702;$(NoWarn) + + + diff --git a/src/SmallSharp.Build/ActiveDocumentMonitor.cs b/src/SmallSharp.Build/ActiveDocumentMonitor.cs index f770f77..900cba8 100644 --- a/src/SmallSharp.Build/ActiveDocumentMonitor.cs +++ b/src/SmallSharp.Build/ActiveDocumentMonitor.cs @@ -65,7 +65,7 @@ void ReloadProfiles() try { var json = JObject.Parse(File.ReadAllText(launchProfilesPath)); - if (json.Property("profiles") is not JProperty prop || + if (json.Property("profiles") is not JProperty prop || prop.Value is not JObject profiles) return; diff --git a/src/SmallSharp.Build/OpenStartupFile.cs b/src/SmallSharp.Build/OpenStartupFile.cs index 45b89ab..41e614f 100644 --- a/src/SmallSharp.Build/OpenStartupFile.cs +++ b/src/SmallSharp.Build/OpenStartupFile.cs @@ -10,7 +10,7 @@ public class OpenStartupFile : Task { [Required] public string? FlagFile { get; set; } - + public string? StartupFile { get; set; } public override bool Execute() diff --git a/src/SmallSharp.Build/SmallSharp.Build.csproj b/src/SmallSharp.Build/SmallSharp.Build.csproj index a9393f9..320f250 100644 --- a/src/SmallSharp.Build/SmallSharp.Build.csproj +++ b/src/SmallSharp.Build/SmallSharp.Build.csproj @@ -6,6 +6,7 @@ + diff --git a/src/SmallSharp/AnalyzerConfigOptionsExtensions.cs b/src/SmallSharp/AnalyzerConfigOptionsExtensions.cs index f2e1939..4875954 100644 --- a/src/SmallSharp/AnalyzerConfigOptionsExtensions.cs +++ b/src/SmallSharp/AnalyzerConfigOptionsExtensions.cs @@ -4,7 +4,7 @@ namespace SmallSharp { static class AnalyzerConfigOptionsExtensions { - public static bool IsEnabled(this AnalyzerOptions options, string optionName) + public static bool IsEnabled(this AnalyzerOptions options, string optionName) => IsEnabled(options.AnalyzerConfigOptionsProvider.GlobalOptions, optionName); public static bool IsEnabled(this AnalyzerConfigOptionsProvider options, string optionName) diff --git a/src/SmallSharp/SmallSharp.csproj b/src/SmallSharp/SmallSharp.csproj index cacedd4..016c170 100644 --- a/src/SmallSharp/SmallSharp.csproj +++ b/src/SmallSharp/SmallSharp.csproj @@ -4,7 +4,7 @@ netstandard2.0 SmallSharp Create, edit and run multiple C# 9.0 top-level programs in the same project 😍 - analyzers\cs + analyzers\dotnet\cs @@ -20,6 +20,7 @@ + diff --git a/src/icon.png b/src/icon.png new file mode 100644 index 0000000..ac8dc3f Binary files /dev/null and b/src/icon.png differ diff --git a/src/kzu.snk b/src/kzu.snk new file mode 100644 index 0000000..8e181ae Binary files /dev/null and b/src/kzu.snk differ diff --git a/support.md b/support.md new file mode 100644 index 0000000..cfde22d --- /dev/null +++ b/support.md @@ -0,0 +1,9 @@ +# Support + +Support is typically available thorugh GitHub Discussions and Issues. + +**Found a bug? File an issue.** If you found something that isn't working as expected and you can reproduce it, go to the repo Issues tab and file an issue. + +**Want a new feature? Start a discussion.** It's always good to start a discussion (Discussion tab in the project, Ideas category) to explain the problem you're trying to solve before jumping in with the pull request. We may already have a solution in place or have an idea on ways to solve that issue. After the details are nailed down, we will migrate the discussion to a proper Issue (with the `enhancement`) label. At that point, we'd love to see your PRs :). + +Consider [sponsoring](https://github.com/sponsors/devlooped) the project to get priority support and many other perks!