Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enhance development workflow with unified linting and tool #472

Merged
merged 2 commits into from
Mar 12, 2024

Commits on Feb 27, 2024

  1. :chore: enhance development workflow with unified linting and tool

    In this pull request, I have introduced several updates and new configurations to enhance our project's development process, specifically focusing on linting and tool management. These changes aim to improve code quality, ensure consistency across development environments, and streamline our CI/CD pipeline. Here's a breakdown of the modifications and the rationale behind each:
    
    I have modified the `scan-lint.yaml` file to dynamically set the version of golangci-lint  based on the version specified in our project's `src/tools/go.mod` file. Previously, the workflow explicitly used a fixed version of golangci-lint installed via a curl command. This update ensures that the CI pipeline uses the same version of golangci-lint as our local development environments, fostering consistency and preventing potential compatibility issues. Additionally, the action version for golangci-lint has been updated to `4.0.0` to match the version specified in our environment variable, further aligning our tooling across different environments.
    
    To maintain a clean and focused repository, I've added the `bin/` directory to our `.gitignore` file. This change prevents binary files and executables generated during local development from being tracked by version control, avoiding unnecessary conflicts and conserving repository space.
    
    A new configuration file, `.golangci.yml`, has been added to specify settings for the golangci-lint tool. This configuration includes parameters such as concurrency level, timeout settings, issue count limits, and specific linter enablements (e.g., `gofmt`, `goimports`, `gosec`, `govet`). By defining these settings, we aim to uphold high code quality standards and adhere to best practices in our Go codebase.
    
    I've updated the Makefile to include a new section for installing required tools locally. This approach allows us to control the versions of tools the UDS CLI depends on, ensuring consistency across development environments without cluttering them with unnecessary installations. Additionally, a new lint target has been added to facilitate running golangci-lint directly from the src directory, reinforcing our commitment to maintaining code quality.
    
    To manage our development tools more effectively, I've introduced a `go.mod` and `go.sum` in the src/tools directory, along with a `tools.go` file. These additions are crucial for defining and tracking the dependencies of our development tools, including golangci-lint. By explicitly specifying these tools and their versions, we ensure that our development environment is reproducible and aligned with our project's requirements.
    
    These changes collectively enhance the reliability, maintainability, and consistency of our development and CI/CD processes. By aligning the versions of critical tools like golangci-lint across all environments and streamlining tool management, we set a solid foundation for high-quality code and efficient development workflows.
    
    Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
    naveensrinivasan committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    bc5b0e6 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2024

  1. updated based on code review comments.

    Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
    naveensrinivasan committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    10a0144 View commit details
    Browse the repository at this point in the history