guibranco / PIX-BACEN-SDK-dotnet

๐Ÿ‡ง๐Ÿ‡ท :bank: :gear: PIX/SPI contracts from @bacen/pix-api/
https://guibranco.github.io/PIX-BACEN-SDK-dotnet/
MIT License
20 stars 7 forks source link

Add Linter Workflow for Code Formatting Checks #120

Closed guibranco closed 2 weeks ago

guibranco commented 2 weeks ago

Description


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
linter.yml
Add Linter Workflow for Code Formatting Checks                     

.github/workflows/linter.yml
  • Added a new GitHub Actions workflow for linting.
  • Configured the workflow to trigger on pull requests and manually.
  • Included steps for checking out the repository and setting up .NET.
  • Added a step for formatting check using CSharpier.
  • +24/-0   
    penify-dev[bot] commented 2 weeks ago

    PR Review ๐Ÿ”

    โฑ๏ธ Estimated effort to review [1-5] 2, because the changes are straightforward and involve adding a new workflow file with clear steps.
    ๐Ÿงช Relevant tests No
    โšก Possible issues No
    ๐Ÿ”’ Security concerns No
    penify-dev[bot] commented 2 weeks ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Add error handling for the CSharpier check to prevent silent failures ___ **Ensure that the dotnet csharpier command is followed by a proper error handling mechanism
    to avoid silent failures.** [.github/workflows/linter.yml [21-23]](https://github.com/guibranco/PIX-BACEN-SDK-dotnet/pull/120/files#diff-ba16fc050e9c818b8125acc6d33b13f4c427ca91373d286af13d0fc92da90605R21-R23) ```diff - name: CSharpier format check run: | - dotnet csharpier . --check + dotnet csharpier . --check || { echo 'CSharpier check failed'; exit 1; } ```
    Suggestion importance[1-10]: 10 Why: Adding error handling for the CSharpier check is critical to prevent silent failures, ensuring that issues are caught and reported during the CI process.
    10
    Performance
    Add caching for .NET packages to improve workflow performance ___ **Consider adding a step to cache the .NET packages to speed up the workflow execution.** [.github/workflows/linter.yml [18-19]](https://github.com/guibranco/PIX-BACEN-SDK-dotnet/pull/120/files#diff-ba16fc050e9c818b8125acc6d33b13f4c427ca91373d286af13d0fc92da90605R18-R19) ```diff +- name: Cache .NET packages + uses: actions/cache@v2 + with: + path: ~/.dotnet/tools + key: ${{ runner.os }}-dotnet-${{ hashFiles('**/*.csproj') }} - name: Dotnet restore run: dotnet tool restore ```
    Suggestion importance[1-10]: 9 Why: Caching .NET packages can significantly improve workflow performance by reducing the time taken for subsequent runs, which is a valuable optimization.
    9
    Best practice
    Specify a version for the setup action to ensure consistent behavior ___ **Consider specifying a version for the actions/setup-dotnet action to ensure consistent
    behavior across different runs.** [.github/workflows/linter.yml [15]](https://github.com/guibranco/PIX-BACEN-SDK-dotnet/pull/120/files#diff-ba16fc050e9c818b8125acc6d33b13f4c427ca91373d286af13d0fc92da90605R15-R15) ```diff - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v4.0.0 ```
    Suggestion importance[1-10]: 8 Why: Specifying a version for actions is a best practice that ensures consistent behavior across different runs, which is crucial for CI/CD workflows.
    8
    Maintainability
    Add a job name to improve readability of the workflow ___ **It is a good practice to include a name for the job to improve readability and
    maintainability of the workflow.** [.github/workflows/linter.yml [8]](https://github.com/guibranco/PIX-BACEN-SDK-dotnet/pull/120/files#diff-ba16fc050e9c818b8125acc6d33b13f4c427ca91373d286af13d0fc92da90605R8-R8) ```diff linter-check: + name: Linter Check Job ```
    Suggestion importance[1-10]: 7 Why: Adding a job name enhances the readability and maintainability of the workflow, making it easier for others to understand its purpose.
    7
    codacy-production[bot] commented 2 weeks ago

    Coverage summary from Codacy

    See diff coverage on Codacy

    Coverage variation Diff coverage
    :white_check_mark: +0.00% (target: -1.00%) :white_check_mark: โˆ…
    Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (45ab8b20bbb725d62e88d37e11b919a8ceb35915) | 75 | 1 | 1.33% | | | Head commit (39deb9e602a031b5307125a2336a3b8108561f95) | 75 (+0) | 1 (+0) | 1.33% (**+0.00%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
    Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#120) | 0 | 0 | **โˆ… (not applicable)** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

    See your quality gate settings    Change summary preferences

    Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

    AppVeyorBot commented 2 weeks ago

    :white_check_mark: Build PIX-BACEN-SDK-dotnet 1.1.334 completed (commit https://github.com/guibranco/PIX-BACEN-SDK-dotnet/commit/0c8015f5ec by @guibranco)

    codecov[bot] commented 2 weeks ago

    Codecov Report

    All modified and coverable lines are covered by tests :white_check_mark:

    Project coverage is 1.33%. Comparing base (45ab8b2) to head (39deb9e). Report is 1 commits behind head on main.

    Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #120 +/- ## ===================================== Coverage 1.33% 1.33% ===================================== Files 17 17 Lines 75 75 ===================================== Hits 1 1 Misses 74 74 ```

    :umbrella: View full report in Codecov by Sentry.
    :loudspeaker: Have feedback on the report? Share it here.

    github-actions[bot] commented 2 weeks ago

    Infisical secrets check: :white_check_mark: No secrets leaked!

    Scan results:

    12:23PM INF scanning for exposed secrets...
    12:23PM INF 145 commits scanned.
    12:23PM INF scan completed in 100ms
    12:23PM INF no leaks found
    
    sonarcloud[bot] commented 2 weeks ago

    Quality Gate Passed Quality Gate passed

    Issues
    0 New issues
    0 Accepted issues

    Measures
    0 Security Hotspots
    0.0% Coverage on New Code
    0.0% Duplication on New Code

    See analysis details on SonarCloud

    AppVeyorBot commented 2 weeks ago

    :white_check_mark: Build PIX-BACEN-SDK-dotnet 1.1.346 completed (commit https://github.com/guibranco/PIX-BACEN-SDK-dotnet/commit/0101daeb7c by @gstraccini[bot])