From 88eb303c9fe7b52c2e0ddd2a76ef04f22ce17efb Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Wed, 19 Jul 2023 01:35:08 +0100 Subject: [PATCH 01/16] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From f6149cdd4972b5eca786d154f3686872676d3f52 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sun, 23 Jul 2023 23:48:29 +0100 Subject: [PATCH 02/16] Fix files --- .config/dotnet-tools.json | 12 ++++++++++ .deepsource.toml | 8 +++++++ .githooks/pre-commit | 16 ++++++++++++++ .github/ISSUE_TEMPLATE/bug_report.md | 17 ++++++++------ .github/dependabot.yml | 30 +++++++++++++++++-------- .github/workflows/deep-source.yml | 33 ++++++++++++++++++++++++++++ .github/workflows/linter.yml | 24 ++++++++++++++++++++ .github/workflows/size-label.yml | 11 ++++++++++ 8 files changed, 135 insertions(+), 16 deletions(-) create mode 100644 .config/dotnet-tools.json create mode 100644 .deepsource.toml create mode 100644 .githooks/pre-commit create mode 100644 .github/workflows/deep-source.yml create mode 100644 .github/workflows/linter.yml diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..50bf6c3 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "csharpier": { + "version": "0.25.0", + "commands": [ + "dotnet-csharpier" + ] + } + } +} diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 0000000..9a88a97 --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,8 @@ +version = 1 + +[[analyzers]] +name = "csharp" + +[[analyzers]] +name = "test-coverage" +enabled = true diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100644 index 0000000..e05ac7a --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +LC_ALL=C + +local_branch="$(git rev-parse --abbrev-ref HEAD)" + +valid_branch_regex="^(feature|fix|docs|style|refactor|perf|hotfix|test|chore|create)\/[a-zA-Z0-9._-]+$" + +message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name and try again." + +if [[ ! $local_branch =~ $valid_branch_regex ]] +then + echo "$message" + exit 1 +fi + +dotnet tool restore && dotnet csharpier . --check diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea7..3205926 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,6 +12,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -24,15 +25,17 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] **Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] + +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] **Additional context** Add any other context about the problem here. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3d3fd5a..7ed6df2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,19 +1,31 @@ version: 2 + updates: -- package-ecosystem: "docker" - directory: "/" - schedule: - interval: weekly - open-pull-requests-limit: 10 - + - package-ecosystem: "nuget" directory: "/" schedule: interval: weekly - open-pull-requests-limit: 10 - + open-pull-requests-limit: 50 + assignees: + - "guibranco" + reviewers: + - "guibranco" + labels: + - "nuget" + - "packages" + - ".NET" + - "dependencies" + - package-ecosystem: "github-actions" directory: "/" schedule: interval: weekly - open-pull-requests-limit: 10 + open-pull-requests-limit: 50 + assignees: + - "guibranco" + reviewers: + - "guibranco" + labels: + - "github-actions" + - "dependencies" \ No newline at end of file diff --git a/.github/workflows/deep-source.yml b/.github/workflows/deep-source.yml new file mode 100644 index 0000000..0f5b215 --- /dev/null +++ b/.github/workflows/deep-source.yml @@ -0,0 +1,33 @@ +name: Deep Source + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + DeepSource: + name: Deep Source Coverage report + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Install DeepSource scanner + run: curl https://deepsource.io/cli | sh + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '7.0.x' + + - name: Build and analyze + env: + DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} + run: | + dotnet build -c Debug --verbosity minimal + dotnet test -c Debug --verbosity minimal --no-build --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura" + ./bin/deepsource report --analyzer test-coverage --key csharp --value-file ./Tests/ViaCep.Tests/coverage.cobertura.xml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..7d9127f --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,24 @@ +name: Linter check + +on: + workflow_dispatch: + pull_request: + +jobs: + linter-check: + runs-on: ubuntu-latest + steps: + + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + + - name: Dotnet restore + run: dotnet tool restore + + - name: CSharpier format check + run: | + dotnet csharpier . --check + echo "run 'dotnet build' to fix the formatting of the code automatically" diff --git a/.github/workflows/size-label.yml b/.github/workflows/size-label.yml index 22bce94..90bd95b 100644 --- a/.github/workflows/size-label.yml +++ b/.github/workflows/size-label.yml @@ -2,6 +2,7 @@ name: Label based on PR size on: pull_request: + pull_request_target: workflow_dispatch: jobs: @@ -12,6 +13,16 @@ jobs: steps: - name: size-label + if: >- + ( + github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name == github.repository + ) || ( + github.event_name == 'pull_request_target' && + github.event.pull_request.head.repo.full_name != github.repository + ) || ( + github.event_name == 'workflow_dispatch' + ) uses: "pascalgn/size-label-action@v0.5.0" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" From 0b6ad509f75a087f08dc7895b172afcc370cf0a3 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sun, 23 Jul 2023 23:50:35 +0100 Subject: [PATCH 03/16] Fix spaces --- .github/dependabot.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7ed6df2..c4a1c9a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,9 +7,9 @@ updates: schedule: interval: weekly open-pull-requests-limit: 50 - assignees: + assignees: - "guibranco" - reviewers: + reviewers: - "guibranco" labels: - "nuget" @@ -22,9 +22,9 @@ updates: schedule: interval: weekly open-pull-requests-limit: 50 - assignees: + assignees: - "guibranco" - reviewers: + reviewers: - "guibranco" labels: - "github-actions" From 3e6d4797ab36fe69149398c5ce256caeab989501 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sun, 23 Jul 2023 23:52:28 +0100 Subject: [PATCH 04/16] Fix action runner --- .github/workflows/deep-source.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/deep-source.yml b/.github/workflows/deep-source.yml index 0f5b215..743c3fd 100644 --- a/.github/workflows/deep-source.yml +++ b/.github/workflows/deep-source.yml @@ -6,6 +6,8 @@ on: - main pull_request: types: [opened, synchronize, reopened] + pull_request_target: + types: [opened, synchronize, reopened] jobs: DeepSource: @@ -25,6 +27,16 @@ jobs: dotnet-version: '7.0.x' - name: Build and analyze + if: >- + ( + github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name == github.repository + ) || ( + github.event_name == 'pull_request_target' && + github.event.pull_request.head.repo.full_name != github.repository + ) || ( + github.event_name == 'workflow_dispatch' + ) env: DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} run: | From a2ce2990825a47f29e3a855c4b83dac6392ac1c6 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sun, 23 Jul 2023 23:53:19 +0100 Subject: [PATCH 05/16] Add DeepSource badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7a99c3a..7aa3504 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ A .NET client wrapper for both .NET Core & .NET Framework projects of [Via CEP A [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=bugs)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +[![DeepSource](https://app.deepsource.com/gh/guibranco/ViaCEP.svg/?label=active+issues&show_trend=true&token=84Hhxk-J1hIHiVC_ojm17J3q)](https://app.deepsource.com/gh/guibranco/ViaCEP/?ref=repository-badge) + --- ## Installation From 9628e28e5a35a6ba1d7bc42e4b9497ee878b3d2a Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sun, 23 Jul 2023 23:55:05 +0100 Subject: [PATCH 06/16] FIx hook --- .githooks/pre-commit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index e05ac7a..c1d95e4 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -13,4 +13,6 @@ then exit 1 fi -dotnet tool restore && dotnet csharpier . --check +dotnet tool restore + +dotnet csharpier . --check From 10f5f2c0f40dc399bf81e3c9e80dad8f6316e2bf Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sun, 23 Jul 2023 23:55:45 +0100 Subject: [PATCH 07/16] Test --- .githooks/pre-commit | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index c1d95e4..22df1d3 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -16,3 +16,5 @@ fi dotnet tool restore dotnet csharpier . --check + +exit 1 \ No newline at end of file From f33b086dc11e0a83946332caef97f4af49e78a18 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Mon, 24 Jul 2023 00:09:41 +0100 Subject: [PATCH 08/16] Linter --- .githooks/pre-commit | 4 +-- Src/ViaCep/IViaCepClient.cs | 7 ++++- Src/ViaCep/ViaCepClient.cs | 27 +++++++++++++---- Tests/ViaCep.Tests/AddressTests.cs | 45 +++++++++++++++++++++++----- Tests/ViaCep.Tests/CoverageTests.cs | 19 ++++++------ Tests/ViaCep.Tests/ResultsFixture.cs | 2 +- Tests/ViaCep.Tests/ZipCodeTests.cs | 5 ++-- 7 files changed, 78 insertions(+), 31 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 22df1d3..4a3fd89 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -15,6 +15,4 @@ fi dotnet tool restore -dotnet csharpier . --check - -exit 1 \ No newline at end of file +dotnet csharpier . --check \ No newline at end of file diff --git a/Src/ViaCep/IViaCepClient.cs b/Src/ViaCep/IViaCepClient.cs index 1f9627b..0b086fe 100644 --- a/Src/ViaCep/IViaCepClient.cs +++ b/Src/ViaCep/IViaCepClient.cs @@ -41,6 +41,11 @@ public interface IViaCepClient /// The address. /// The cancellation token. /// - Task> SearchAsync(string stateInitials, string city, string address, CancellationToken cancellationToken); + Task> SearchAsync( + string stateInitials, + string city, + string address, + CancellationToken cancellationToken + ); } } diff --git a/Src/ViaCep/ViaCepClient.cs b/Src/ViaCep/ViaCepClient.cs index a812f0d..77f1e98 100644 --- a/Src/ViaCep/ViaCepClient.cs +++ b/Src/ViaCep/ViaCepClient.cs @@ -77,11 +77,18 @@ public IEnumerable Search(string stateInitials, string city, strin /// The zip code. /// The token. /// - public async Task SearchAsync(string zipCode, CancellationToken cancellationToken) + public async Task SearchAsync( + string zipCode, + CancellationToken cancellationToken + ) { - var response = await _httpClient.GetAsync($"/ws/{zipCode}/json", cancellationToken).ConfigureAwait(false); + var response = await _httpClient + .GetAsync($"/ws/{zipCode}/json", cancellationToken) + .ConfigureAwait(false); response.EnsureSuccessStatusCode(); - return await response.Content.ReadAsAsync(cancellationToken).ConfigureAwait(false); + return await response.Content + .ReadAsAsync(cancellationToken) + .ConfigureAwait(false); } /// @@ -93,11 +100,19 @@ public async Task SearchAsync(string zipCode, CancellationToken ca /// The token. /// public async Task> SearchAsync( - string stateInitials, string city, string address, CancellationToken cancellationToken) + string stateInitials, + string city, + string address, + CancellationToken cancellationToken + ) { - var response = await _httpClient.GetAsync($"/ws/{stateInitials}/{city}/{address}/json", cancellationToken).ConfigureAwait(false); + var response = await _httpClient + .GetAsync($"/ws/{stateInitials}/{city}/{address}/json", cancellationToken) + .ConfigureAwait(false); response.EnsureSuccessStatusCode(); - return await response.Content.ReadAsAsync>(cancellationToken).ConfigureAwait(false); + return await response.Content + .ReadAsAsync>(cancellationToken) + .ConfigureAwait(false); } #endregion diff --git a/Tests/ViaCep.Tests/AddressTests.cs b/Tests/ViaCep.Tests/AddressTests.cs index 71e2c5b..13ed75f 100644 --- a/Tests/ViaCep.Tests/AddressTests.cs +++ b/Tests/ViaCep.Tests/AddressTests.cs @@ -24,13 +24,23 @@ public void ValidateSearchByFullAddress() .Setup(c => c.Search(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(fixtureResults); - var results = clientMock.Object.Search(fixtureResults.First().StateInitials, fixtureResults.First().City, fixtureResults.First().Street); + var results = clientMock.Object.Search( + fixtureResults.First().StateInitials, + fixtureResults.First().City, + fixtureResults.First().Street + ); Assert.NotNull(results); var list = results.ToList(); Assert.True(list.Any()); - Assert.Contains(list, r => r.ZipCode.Equals("12345-678", StringComparison.InvariantCultureIgnoreCase)); - Assert.Contains(list, r => r.ZipCode.Equals("98765-432", StringComparison.InvariantCultureIgnoreCase)); + Assert.Contains( + list, + r => r.ZipCode.Equals("12345-678", StringComparison.InvariantCultureIgnoreCase) + ); + Assert.Contains( + list, + r => r.ZipCode.Equals("98765-432", StringComparison.InvariantCultureIgnoreCase) + ); } /// @@ -42,16 +52,35 @@ public async Task ValidateSearchByFullAddressAsync() var fixtureResults = ResultsFixture.GetSampleResults(); var clientMock = new Mock(); clientMock - .Setup(c => c.SearchAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup( + c => + c.SearchAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny() + ) + ) .ReturnsAsync(fixtureResults); - var results = await clientMock.Object.SearchAsync(fixtureResults.First().StateInitials, fixtureResults.First().City, fixtureResults.First().Street, CancellationToken.None); + var results = await clientMock.Object.SearchAsync( + fixtureResults.First().StateInitials, + fixtureResults.First().City, + fixtureResults.First().Street, + CancellationToken.None + ); Assert.NotNull(results); var list = results.ToList(); Assert.True(list.Any()); - Assert.Contains(list, r => r.ZipCode.Equals("12345-678", StringComparison.InvariantCultureIgnoreCase)); - Assert.Contains(list, r => r.ZipCode.Equals("98765-432", StringComparison.InvariantCultureIgnoreCase)); + Assert.Contains( + list, + r => r.ZipCode.Equals("12345-678", StringComparison.InvariantCultureIgnoreCase) + ); + Assert.Contains( + list, + r => r.ZipCode.Equals("98765-432", StringComparison.InvariantCultureIgnoreCase) + ); } } -} \ No newline at end of file +} diff --git a/Tests/ViaCep.Tests/CoverageTests.cs b/Tests/ViaCep.Tests/CoverageTests.cs index 4555e11..f5a48a1 100644 --- a/Tests/ViaCep.Tests/CoverageTests.cs +++ b/Tests/ViaCep.Tests/CoverageTests.cs @@ -32,12 +32,14 @@ public void ValidateCreateNewInstance() [Fact] public void ValidateSearchByZipCodeCoverage() { - const string resultData = "{'cep': '01001-000','logradouro': 'Praça da Sé','complemento': 'lado ímpar','bairro': 'Sé','localidade': 'São Paulo','uf': 'SP','unidade': '','ibge': '3550308','gia': '1004'}"; + const string resultData = + "{'cep': '01001-000','logradouro': 'Praça da Sé','complemento': 'lado ímpar','bairro': 'Sé','localidade': 'São Paulo','uf': 'SP','unidade': '','ibge': '3550308','gia': '1004'}"; var httpClientMock = new MockHttpMessageHandler(); - httpClientMock.When("https://viacep.com.br/ws/*/json") - .Respond("application/json", resultData); - - var httpClient = new HttpClient(httpClientMock) {BaseAddress = _baseUrl}; + httpClientMock + .When("https://viacep.com.br/ws/*/json") + .Respond("application/json", resultData); + + var httpClient = new HttpClient(httpClientMock) { BaseAddress = _baseUrl }; var client = new ViaCepClient(httpClient); var result = client.Search("01001000"); @@ -63,8 +65,9 @@ public void ValidateSearchByAddressCoverage() const string resultData = "[ { 'cep': '91790-072', 'logradouro': 'Rua Domingos José Poli', 'complemento': '', 'bairro': 'Restinga', 'localidade': 'Porto Alegre', 'uf': 'RS', 'unidade': '', 'ibge': '4314902', 'gia': '' }, { 'cep': '91910-420', 'logradouro': 'Rua José Domingos Varella', 'complemento': '', 'bairro': 'Cavalhada', 'localidade': 'Porto Alegre', 'uf': 'RS', 'unidade': '', 'ibge': '4314902', 'gia': '' }, { 'cep': '90420-200', 'logradouro': 'Rua Domingos José de Almeida', 'complemento': '', 'bairro': 'Rio Branco', 'localidade': 'Porto Alegre', 'uf': 'RS', 'unidade': '', 'ibge': '4314902', 'gia': '' } ]"; var httpClientMock = new MockHttpMessageHandler(); - httpClientMock.When("https://viacep.com.br/ws/*/*/*/json") - .Respond("application/json", resultData); + httpClientMock + .When("https://viacep.com.br/ws/*/*/*/json") + .Respond("application/json", resultData); var httpClient = new HttpClient(httpClientMock) { BaseAddress = _baseUrl }; var client = new ViaCepClient(httpClient); @@ -79,8 +82,6 @@ public void ValidateSearchByAddressCoverage() Assert.All(list, result => Assert.Equal("Porto Alegre", result.City)); Assert.All(list, result => Assert.Equal("RS", result.StateInitials)); Assert.All(list, result => Assert.Equal(4314902, result.IBGECode)); - } - } } diff --git a/Tests/ViaCep.Tests/ResultsFixture.cs b/Tests/ViaCep.Tests/ResultsFixture.cs index a3a7ec1..7f3e17a 100644 --- a/Tests/ViaCep.Tests/ResultsFixture.cs +++ b/Tests/ViaCep.Tests/ResultsFixture.cs @@ -52,4 +52,4 @@ public static ICollection GetSampleResults() => } }; } -} \ No newline at end of file +} diff --git a/Tests/ViaCep.Tests/ZipCodeTests.cs b/Tests/ViaCep.Tests/ZipCodeTests.cs index e62d03a..8cedade 100644 --- a/Tests/ViaCep.Tests/ZipCodeTests.cs +++ b/Tests/ViaCep.Tests/ZipCodeTests.cs @@ -60,9 +60,8 @@ public async Task ValidateSearchByZipCodeAsync() Assert.Equal("SP", result.StateInitials); } - /// - /// Validates if the search by zip code don't throw a exception if the address doesn't have a gia code + /// Validates if the search by zip code don't throw a exception if the address doesn't have a gia code /// /// [Fact] @@ -110,4 +109,4 @@ public async Task ValidateSearchByZipCodeWithoutGiaCodeAsync() Assert.Equal("SP", result.StateInitials); } } -} \ No newline at end of file +} From bd7b049d9e702044bfc262bc906e34371032b123 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Mon, 24 Jul 2023 00:09:59 +0100 Subject: [PATCH 09/16] Test --- .githooks/pre-commit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 4a3fd89..22df1d3 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -15,4 +15,6 @@ fi dotnet tool restore -dotnet csharpier . --check \ No newline at end of file +dotnet csharpier . --check + +exit 1 \ No newline at end of file From 9afe0d32055015039ac7a8f349315285ab460ccb Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Mon, 24 Jul 2023 00:12:09 +0100 Subject: [PATCH 10/16] test --- .githooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 22df1d3..8027c61 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -17,4 +17,4 @@ dotnet tool restore dotnet csharpier . --check -exit 1 \ No newline at end of file +exit 10 \ No newline at end of file From feb892edf0140e37d772e9a9aed79d554f39a7df Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Mon, 24 Jul 2023 00:12:19 +0100 Subject: [PATCH 11/16] test --- .githooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 8027c61..22df1d3 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -17,4 +17,4 @@ dotnet tool restore dotnet csharpier . --check -exit 10 \ No newline at end of file +exit 1 \ No newline at end of file From 5128f637f00aca5031f78212c2410e5d5ee887fe Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Mon, 24 Jul 2023 00:32:58 +0100 Subject: [PATCH 12/16] Test --- .githooks/pre-commit | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 22df1d3..4a3fd89 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -15,6 +15,4 @@ fi dotnet tool restore -dotnet csharpier . --check - -exit 1 \ No newline at end of file +dotnet csharpier . --check \ No newline at end of file From abf2a0387334f66d7e6e2697a0da6212cc2a600d Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Mon, 24 Jul 2023 00:35:17 +0100 Subject: [PATCH 13/16] Fix app veyor --- appveyor.yml | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6c7d20a..5af117e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,7 +19,7 @@ dotnet_csproj: assembly_version: '{version}' file_version: '{version}' informational_version: '{version}' - + init: - SET JAVA_HOME=C:\Program Files\Java\jdk19 - SET PATH=%JAVA_HOME%\bin;%PATH% @@ -28,6 +28,9 @@ before_build: - ps: $env:SOLUTION_NAME = $([io.path]::GetFileNameWithoutExtension($(Get-ChildItem -Path .\* -Include *.sln))) - ps: $env:SONAR_PROJECT = "$env:APPVEYOR_REPO_NAME" -replace "/","_" - ps: $env:SONAR_ORGANIZATION = "$env:APPVEYOR_REPO_NAME" -replace "/.*$","-github" +- ps: $env:LOCAL_PR = 0 +- ps: if(-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { $env:LOCAL_PR = 1 } +- ps: if($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -Eq $env:APPVEYOR_REPO_NAME) { $env:LOCAL_PR = 1 } - cmd: nuget restore - cmd: choco install opencover.portable - cmd: choco install codecov @@ -43,40 +46,42 @@ build: build_script: - ps: $Params = "/k:`"$env:SONAR_PROJECT`"", "/o:`"$env:SONAR_ORGANIZATION`"", "/v:`"$env:APPVEYOR_BUILD_NUMBER`"" -- ps: $Params += "/d:sonar.host.url=`"https://sonarcloud.io`"", "/d:sonar.login=`"$env:SONAR_TOKEN`"" -- ps: $Params += "/d:sonar.exclusions=`"**/bin/**/*,**/obj/**/*`"", "/d:sonar.coverage.exclusions=`"**/$env:SOLUTION_NAME.Tests/**,**/*Tests.cs`"" -- ps: $Params += "/d:sonar.cs.opencover.reportsPaths=`"$env:CD\Tests\$env:SOLUTION_NAME.Tests\coverage.opencover.xml`"" +- ps: $Params += "/d:sonar.host.url=`"https://sonarcloud.io`"" +- ps: if($env:LOCAL_PR -Eq 1) { $Params += "/d:sonar.token=`"$env:SONAR_TOKEN`"" } +- ps: $Params += "/d:sonar.exclusions=`"**/bin/**/*,**/obj/**/*`"", "/d:sonar.coverage.exclusions=`"**/$env:SOLUTION_NAME.UnitTests/**,**/*Tests.cs`"" +- ps: $Params += "/d:sonar.cs.opencover.reportsPaths=`"Tests\$env:SOLUTION_NAME.UnitTests\coverage.opencover.xml`"" - ps: if(-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { $Params += "/d:sonar.branch.name=`"$env:APPVEYOR_REPO_BRANCH`"" } - ps: if($env:APPVEYOR_PULL_REQUEST_NUMBER) { $Params += "/d:sonar.pullrequest.key=$env:APPVEYOR_PULL_REQUEST_NUMBER", "/d:sonar.pullrequest.branch=`"$env:APPVEYOR_REPO_BRANCH`"" } - ps: Start-process "dotnet" "sonarscanner begin $($Params -join ' ')" - codeclimate-test-reporter before-build - dotnet build %SOLUTION_NAME%.sln -- ps: $testProjects = (Get-ChildItem -Path .\Tests\**\ -Recurse -Include *.csproj).Fullname -- ps: $coverletFormats = @('cobertura', 'lcov', 'opencover') +- ps: $TEST_PROJECTS = (Get-ChildItem -Path .\Tests\**\ -Recurse -Include *.csproj).Fullname +- ps: $COVERLET_FORMATS = @('cobertura', 'lcov', 'opencover') - ps: | - foreach($testProject in $testProjects) + foreach($testProject in $TEST_PROJECTS) { - foreach($coverletFormat in $coverletFormats) + foreach($coverletFormat in $COVERLET_FORMATS) { dotnet test $testProject /p:CollectCoverage=true /p:CoverletOutputFormat="$coverletFormat" } } -- codeclimate-test-reporter format-coverage -t lcov -o "%CD%\Tests\%SOLUTION_NAME%.Tests\code-climate.json" "%CD%\Tests\%SOLUTION_NAME%.Tests\coverage.info" -- codeclimate-test-reporter upload-coverage -i "%CD%\Tests\%SOLUTION_NAME%.Tests\code-climate.json" -r %CODECLIMATE_TOKEN% -- codecov -f "%CD%\Tests\%SOLUTION_NAME%.Tests\coverage.opencover.xml" -- java -jar ./codacy-test-reporter.jar report -l CSharp -t %CODACY_PROJECT_TOKEN% -r "%CD%\Tests\%SOLUTION_NAME%.Tests\coverage.opencover.xml" -- dotnet sonarscanner end /d:sonar.login="%SONAR_TOKEN%" +- if %LOCAL_PR% EQU 1 codecov -f "Tests\%SOLUTION_NAME%.UnitTests\coverage.opencover.xml" +- if %LOCAL_PR% EQU 1 codeclimate-test-reporter format-coverage -t lcov -o "Tests\%SOLUTION_NAME%.UnitTests\code-climate.json" "Tests\%SOLUTION_NAME%.UnitTests\coverage.info" +- if %LOCAL_PR% EQU 1 codeclimate-test-reporter upload-coverage -i "Tests\%SOLUTION_NAME%.UnitTests\code-climate.json" -r %CODECLIMATE_TOKEN% +- if %LOCAL_PR% EQU 1 java -jar ./codacy-test-reporter.jar report -l CSharp -t %CODACY_PROJECT_TOKEN% -r "Tests\%SOLUTION_NAME%.UnitTests\coverage.opencover.xml" +- if %LOCAL_PR% EQU 1 dotnet sonarscanner end /d:sonar.token="%SONAR_TOKEN%" after_build: -- xcopy %CD%\Src\%SOLUTION_NAME%\bin\Release\netstandard2.0\*.* %CD%\Build\ +- xcopy Src\%SOLUTION_NAME%\bin\Release\netstandard2.0\*.* Build\.netstandard2.0\ +- xcopy Src\%SOLUTION_NAME%\bin\Release\netstandard2.1\*.* Build\.netstandard2.1\ -- copy %CD%\Src\%SOLUTION_NAME%\bin\Release\%SOLUTION_NAME%.%APPVEYOR_BUILD_VERSION%.nupkg %SOLUTION_NAME%.%APPVEYOR_BUILD_VERSION%.nupkg +- copy Src\%SOLUTION_NAME%\bin\Release\%SOLUTION_NAME%.%APPVEYOR_BUILD_VERSION%.nupkg %SOLUTION_NAME%.%APPVEYOR_BUILD_VERSION%.nupkg - rd /s /q %CD%\Src\%SOLUTION_NAME%\bin\Release\ -- xcopy %CD%\Tests\%SOLUTION_NAME%.Tests\*.xml %CD%\Coverage\ -- xcopy %CD%\Tests\%SOLUTION_NAME%.Tests\*.json %CD%\Coverage\ -- xcopy %CD%\Tests\%SOLUTION_NAME%.Tests\*.info %CD%\Coverage\ +- xcopy Tests\%SOLUTION_NAME%.UnitTests\*.xml Coverage\ +- xcopy Tests\%SOLUTION_NAME%.UnitTests\*.json Coverage\ +- xcopy Tests\%SOLUTION_NAME%.UnitTests\*.info Coverage\ - cd %CD% From c44768a32ac3b93f29103725f79628c5a89872a6 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Mon, 24 Jul 2023 00:45:55 +0100 Subject: [PATCH 14/16] Fix files --- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- README.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7..5f43738 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -8,7 +8,7 @@ assignees: '' --- **Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +A clear and concise description of what the problem is. Ex. I'm always frustrated when (...) **Describe the solution you'd like** A clear and concise description of what you want to happen. diff --git a/README.md b/README.md index 7aa3504..d400e9e 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ Download the latest zip file from the [Release](https://github.com/GuiBranco/Via The package has two classes: -- [ViaCepClient](https://github.com/guibranco/ViaCEP/blob/main/ViaCEP/ViaCepClient.cs): The main class (methods). -- [ViaCepResult](https://github.com/guibranco/ViaCEP/blob/main/ViaCEP/ViaCepResult.cs): The result class (data). +- [ViaCepClient](https://github.com/guibranco/ViaCEP/blob/main/ViaCEP/ViaCepClient.cs): The main class (methods). +- [ViaCepResult](https://github.com/guibranco/ViaCEP/blob/main/ViaCEP/ViaCepResult.cs): The result class (data). This package is fully compatible with Dependency Injection. Use the interface *IViaCepClient* and the constructor with HttpClient parameter with a IHttpClientFactory instance. @@ -99,6 +99,6 @@ foreach(var result in results){ ## Changelog -- 2023-03-03: Update dependencies, change branch name, update logo. [@guibranco](https://github.com/guibranco) -- 2021-06-21: Update dependencies version. [@guibranco](https://github.com/guibranco) -- 2020-10-23: Add support to .NET Standard 2.0 and .NET Framework v4.6.1 and above. [@guibranco](https://github.com/guibranco) +- 2023-03-03: Update dependencies, change branch name, update logo. [@guibranco](https://github.com/guibranco) +- 2021-06-21: Update dependencies version. [@guibranco](https://github.com/guibranco) +- 2020-10-23: Add support to .NET Standard 2.0 and .NET Framework v4.6.1 and above. [@guibranco](https://github.com/guibranco) From 05bbc81b23bec3264e2c2d26f1de303d779aed60 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Mon, 24 Jul 2023 00:50:26 +0100 Subject: [PATCH 15/16] Fix file location --- appveyor.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5af117e..06ed646 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,8 +48,8 @@ build_script: - ps: $Params = "/k:`"$env:SONAR_PROJECT`"", "/o:`"$env:SONAR_ORGANIZATION`"", "/v:`"$env:APPVEYOR_BUILD_NUMBER`"" - ps: $Params += "/d:sonar.host.url=`"https://sonarcloud.io`"" - ps: if($env:LOCAL_PR -Eq 1) { $Params += "/d:sonar.token=`"$env:SONAR_TOKEN`"" } -- ps: $Params += "/d:sonar.exclusions=`"**/bin/**/*,**/obj/**/*`"", "/d:sonar.coverage.exclusions=`"**/$env:SOLUTION_NAME.UnitTests/**,**/*Tests.cs`"" -- ps: $Params += "/d:sonar.cs.opencover.reportsPaths=`"Tests\$env:SOLUTION_NAME.UnitTests\coverage.opencover.xml`"" +- ps: $Params += "/d:sonar.exclusions=`"**/bin/**/*,**/obj/**/*`"", "/d:sonar.coverage.exclusions=`"**/$env:SOLUTION_NAME.Tests/**,**/*Tests.cs`"" +- ps: $Params += "/d:sonar.cs.opencover.reportsPaths=`"Tests\$env:SOLUTION_NAME.Tests\coverage.opencover.xml`"" - ps: if(-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { $Params += "/d:sonar.branch.name=`"$env:APPVEYOR_REPO_BRANCH`"" } - ps: if($env:APPVEYOR_PULL_REQUEST_NUMBER) { $Params += "/d:sonar.pullrequest.key=$env:APPVEYOR_PULL_REQUEST_NUMBER", "/d:sonar.pullrequest.branch=`"$env:APPVEYOR_REPO_BRANCH`"" } - ps: Start-process "dotnet" "sonarscanner begin $($Params -join ' ')" @@ -65,10 +65,10 @@ build_script: dotnet test $testProject /p:CollectCoverage=true /p:CoverletOutputFormat="$coverletFormat" } } -- if %LOCAL_PR% EQU 1 codecov -f "Tests\%SOLUTION_NAME%.UnitTests\coverage.opencover.xml" -- if %LOCAL_PR% EQU 1 codeclimate-test-reporter format-coverage -t lcov -o "Tests\%SOLUTION_NAME%.UnitTests\code-climate.json" "Tests\%SOLUTION_NAME%.UnitTests\coverage.info" -- if %LOCAL_PR% EQU 1 codeclimate-test-reporter upload-coverage -i "Tests\%SOLUTION_NAME%.UnitTests\code-climate.json" -r %CODECLIMATE_TOKEN% -- if %LOCAL_PR% EQU 1 java -jar ./codacy-test-reporter.jar report -l CSharp -t %CODACY_PROJECT_TOKEN% -r "Tests\%SOLUTION_NAME%.UnitTests\coverage.opencover.xml" +- if %LOCAL_PR% EQU 1 codecov -f "Tests\%SOLUTION_NAME%.Tests\coverage.opencover.xml" +- if %LOCAL_PR% EQU 1 codeclimate-test-reporter format-coverage -t lcov -o "Tests\%SOLUTION_NAME%.Tests\code-climate.json" "Tests\%SOLUTION_NAME%.Tests\coverage.info" +- if %LOCAL_PR% EQU 1 codeclimate-test-reporter upload-coverage -i "Tests\%SOLUTION_NAME%.Tests\code-climate.json" -r %CODECLIMATE_TOKEN% +- if %LOCAL_PR% EQU 1 java -jar ./codacy-test-reporter.jar report -l CSharp -t %CODACY_PROJECT_TOKEN% -r "Tests\%SOLUTION_NAME%.Tests\coverage.opencover.xml" - if %LOCAL_PR% EQU 1 dotnet sonarscanner end /d:sonar.token="%SONAR_TOKEN%" after_build: @@ -79,9 +79,9 @@ after_build: - rd /s /q %CD%\Src\%SOLUTION_NAME%\bin\Release\ -- xcopy Tests\%SOLUTION_NAME%.UnitTests\*.xml Coverage\ -- xcopy Tests\%SOLUTION_NAME%.UnitTests\*.json Coverage\ -- xcopy Tests\%SOLUTION_NAME%.UnitTests\*.info Coverage\ +- xcopy Tests\%SOLUTION_NAME%.Tests\*.xml Coverage\ +- xcopy Tests\%SOLUTION_NAME%.Tests\*.json Coverage\ +- xcopy Tests\%SOLUTION_NAME%.Tests\*.info Coverage\ - cd %CD% From b3ec3a77f7a711f342b2a2fc5c1cc96a981ccbcc Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Mon, 24 Jul 2023 01:33:31 +0100 Subject: [PATCH 16/16] Markdown linter --- .github/ISSUE_TEMPLATE/bug_report.md | 22 +++++++++--------- README.md | 34 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3205926..3046abd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -13,10 +13,10 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error **Expected behavior** A clear and concise description of what you expected to happen. @@ -26,16 +26,16 @@ If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** -- OS: [e.g. iOS] -- Browser [e.g. chrome, safari] -- Version [e.g. 22] +* OS: \[e.g. iOS] +* Browser \[e.g. chrome, safari] +* Version \[e.g. 22] **Smartphone (please complete the following information):** -- Device: [e.g. iPhone6] -- OS: [e.g. iOS8.1] -- Browser [e.g. stock browser, safari] -- Version [e.g. 22] +* Device: \[e.g. iPhone6] +* OS: \[e.g. iOS8.1] +* Browser \[e.g. stock browser, safari] +* Version \[e.g. 22] **Additional context** Add any other context about the problem here. diff --git a/README.md b/README.md index d400e9e..60d610c 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ A .NET client wrapper for both .NET Core & .NET Framework projects of [Via CEP A | Build status | Last commit | Tests | Coverage | Code Smells | LOC | |--------------|-------------|-------|----------|-------------|-----| -| [![Build status](https://ci.appveyor.com/api/projects/status/9jnsy1e08jhyxl7j/branch/main?svg=true)](https://ci.appveyor.com/project/guibranco/ViaCEP) | [![GitHub last commit](https://img.shields.io/github/last-commit/guibranco/ViaCEP/main)](https://github.com/guibranco/ViaCEP) | [![AppVeyor tests (branch)](https://img.shields.io/appveyor/tests/guibranco/ViaCEP/main?compact_message)](https://ci.appveyor.com/project/guibranco/ViaCEP) | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=coverage)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) | [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=code_smells)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) | [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=ncloc)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +| [![Build status](https://ci.appveyor.com/api/projects/status/9jnsy1e08jhyxl7j/branch/main?svg=true)](https://ci.appveyor.com/project/guibranco/ViaCEP) | [![GitHub last commit](https://img.shields.io/github/last-commit/guibranco/ViaCEP/main)](https://github.com/guibranco/ViaCEP) | [![AppVeyor tests (branch)](https://img.shields.io/appveyor/tests/guibranco/ViaCEP/main?compact_message)](https://ci.appveyor.com/project/guibranco/ViaCEP) | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=coverage)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) | [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=code_smells)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) | [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=ncloc)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) ## Code Quality -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/483c4901f0ea4a0d99e69be931ced362)](https://www.codacy.com/gh/guibranco/ViaCEP/dashboard?utm_source=github.com&utm_medium=referral&utm_content=guibranco/ViaCEP&utm_campaign=Badge_Grade) -[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/483c4901f0ea4a0d99e69be931ced362)](https://www.codacy.com/gh/guibranco/ViaCEP/dashboard?utm_source=github.com&utm_medium=referral&utm_content=guibranco/ViaCEP&utm_campaign=Badge_Grade) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/483c4901f0ea4a0d99e69be931ced362)](https://www.codacy.com/gh/guibranco/ViaCEP/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=guibranco/ViaCEP\&utm_campaign=Badge_Grade) +[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/483c4901f0ea4a0d99e69be931ced362)](https://www.codacy.com/gh/guibranco/ViaCEP/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=guibranco/ViaCEP\&utm_campaign=Badge_Grade) [![codecov](https://codecov.io/gh/guibranco/ViaCEP/branch/main/graph/badge.svg)](https://codecov.io/gh/guibranco/ViaCEP) [![CodeFactor](https://www.codefactor.io/repository/github/guibranco/ViaCEP/badge)](https://www.codefactor.io/repository/github/guibranco/ViaCEP) @@ -24,19 +24,19 @@ A .NET client wrapper for both .NET Core & .NET Framework projects of [Via CEP A [![Maintainability](https://api.codeclimate.com/v1/badges/93ba8c7ae3e86ca7e2a7/maintainability)](https://codeclimate.com/github/guibranco/ViaCEP/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/93ba8c7ae3e86ca7e2a7/test_coverage)](https://codeclimate.com/github/guibranco/ViaCEP/test_coverage) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=alert_status)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) -[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=alert_status)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) -[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=sqale_index)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) -[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=sqale_index)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) -[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) -[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=security_rating)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=security_rating)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) -[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=bugs)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) -[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=bugs)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) +[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=guibranco_ViaCEP\&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=guibranco_ViaCEP) -[![DeepSource](https://app.deepsource.com/gh/guibranco/ViaCEP.svg/?label=active+issues&show_trend=true&token=84Hhxk-J1hIHiVC_ojm17J3q)](https://app.deepsource.com/gh/guibranco/ViaCEP/?ref=repository-badge) +[![DeepSource](https://app.deepsource.com/gh/guibranco/ViaCEP.svg/?label=active+issues\&show_trend=true\&token=84Hhxk-J1hIHiVC_ojm17J3q)](https://app.deepsource.com/gh/guibranco/ViaCEP/?ref=repository-badge) --- @@ -60,8 +60,8 @@ Download the latest zip file from the [Release](https://github.com/GuiBranco/Via The package has two classes: -- [ViaCepClient](https://github.com/guibranco/ViaCEP/blob/main/ViaCEP/ViaCepClient.cs): The main class (methods). -- [ViaCepResult](https://github.com/guibranco/ViaCEP/blob/main/ViaCEP/ViaCepResult.cs): The result class (data). +* [ViaCepClient](https://github.com/guibranco/ViaCEP/blob/main/ViaCEP/ViaCepClient.cs): The main class (methods). +* [ViaCepResult](https://github.com/guibranco/ViaCEP/blob/main/ViaCEP/ViaCepResult.cs): The result class (data). This package is fully compatible with Dependency Injection. Use the interface *IViaCepClient* and the constructor with HttpClient parameter with a IHttpClientFactory instance. @@ -99,6 +99,6 @@ foreach(var result in results){ ## Changelog -- 2023-03-03: Update dependencies, change branch name, update logo. [@guibranco](https://github.com/guibranco) -- 2021-06-21: Update dependencies version. [@guibranco](https://github.com/guibranco) -- 2020-10-23: Add support to .NET Standard 2.0 and .NET Framework v4.6.1 and above. [@guibranco](https://github.com/guibranco) +* 2023-03-03: Update dependencies, change branch name, update logo. [@guibranco](https://github.com/guibranco) +* 2021-06-21: Update dependencies version. [@guibranco](https://github.com/guibranco) +* 2020-10-23: Add support to .NET Standard 2.0 and .NET Framework v4.6.1 and above. [@guibranco](https://github.com/guibranco)