diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 0000000..9b460c4 --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,5 @@ +version = 1 + +[[analyzers]] +name = "csharp" +enabled = true \ No newline at end of file diff --git a/.github/workflows/codesee-arch-diagram.yml b/.github/workflows/codesee-arch-diagram.yml new file mode 100644 index 0000000..56744ef --- /dev/null +++ b/.github/workflows/codesee-arch-diagram.yml @@ -0,0 +1,91 @@ +# This workflow was added by CodeSee. Learn more at https://codesee.io/ +# This is v2.0 of this workflow file +on: + push: + branches: + - main + pull_request_target: + types: [opened, synchronize, reopened] + +name: CodeSee Map + +permissions: read-all + +jobs: + test_map_action: + runs-on: ubuntu-latest + continue-on-error: true + name: Run CodeSee Map Analysis + steps: + - name: checkout + id: checkout + uses: actions/checkout@v3 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 + + # codesee-detect-languages has an output with id languages. + - name: Detect Languages + id: detect-languages + uses: Codesee-io/codesee-detect-languages-action@latest + + - name: Configure JDK 16 + uses: actions/setup-java@v3 + if: ${{ fromJSON(steps.detect-languages.outputs.languages).java }} + with: + java-version: '16' + distribution: 'zulu' + + # CodeSee Maps Go support uses a static binary so there's no setup step required. + + - name: Configure Node.js 16 + uses: actions/setup-node@v3 + if: ${{ fromJSON(steps.detect-languages.outputs.languages).javascript }} + with: + node-version: '16' + + - name: Configure Python 3.x + uses: actions/setup-python@v4 + if: ${{ fromJSON(steps.detect-languages.outputs.languages).python }} + with: + python-version: '3.x' + architecture: 'x64' + + - name: Configure Ruby '3.x' + uses: ruby/setup-ruby@v1 + if: ${{ fromJSON(steps.detect-languages.outputs.languages).ruby }} + with: + ruby-version: '3.0' + + # We need the rust toolchain because it uses rustc and cargo to inspect the package + - name: Configure Rust 1.x stable + uses: actions-rs/toolchain@v1 + if: ${{ fromJSON(steps.detect-languages.outputs.languages).rust }} + with: + toolchain: stable + + - name: Generate Map + id: generate-map + uses: Codesee-io/codesee-map-action@latest + with: + step: map + api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }} + github_ref: ${{ github.ref }} + languages: ${{ steps.detect-languages.outputs.languages }} + + - name: Upload Map + id: upload-map + uses: Codesee-io/codesee-map-action@latest + with: + step: mapUpload + api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }} + github_ref: ${{ github.ref }} + + - name: Insights + id: insights + uses: Codesee-io/codesee-map-action@latest + with: + step: insights + api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }} + github_ref: ${{ github.ref }} diff --git a/app/Spinner.Test/Cache/ParserTypeCacheTest.cs b/app/Spinner.Test/Cache/ParserTypeCacheTest.cs index cdabf73..7ddf41f 100644 --- a/app/Spinner.Test/Cache/ParserTypeCacheTest.cs +++ b/app/Spinner.Test/Cache/ParserTypeCacheTest.cs @@ -15,6 +15,7 @@ public void TryGet_WhenCalled_ShouldReturnParsedTypeFromCache() ITypeParse parser = new CacheParser(); ParserTypeCache.Add(key, parser); + // Act bool typeCached = ParserTypeCache.TryGet(key, out ITypeParse typeInCache); diff --git a/app/Spinner.Test/SpinnerReadTest.cs b/app/Spinner.Test/SpinnerReadTest.cs index 44b1d3c..b3eaf1d 100644 --- a/app/Spinner.Test/SpinnerReadTest.cs +++ b/app/Spinner.Test/SpinnerReadTest.cs @@ -53,7 +53,7 @@ public void ReadFromString_WhenCalled_ShouldValidateIfPropertyParseIsCached() Spinner spinnerReader = new Spinner(); string positionalString = spinnerWriter.WriteAsString(); - spinnerReader.ReadFromString(positionalString); + NothingDecimalReader nothingDecimalReader = spinnerReader.ReadFromString(positionalString); // Act bool decimalParserWasCached = ParserTypeCache.Parses.Any(c => c is DecimalParser);