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>