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

Pr/4179 : Update golang-lintci and fixes the issues raise by it #4208

Merged
merged 4 commits into from
Jun 6, 2024

Commits on May 27, 2024

  1. build(deps): bump github.com/golangci/golangci-lint in /tools

    Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.55.2 to 1.59.0.
    - [Release notes](https://github.com/golangci/golangci-lint/releases)
    - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
    - [Commits](golangci/golangci-lint@v1.55.2...v1.59.0)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/golangci/golangci-lint
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored May 27, 2024
    Configuration menu
    Copy the full SHA
    7c00f62 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. golangci-lint: fixes revive errors for non-used variables

    It will fix following errors
    ```
    cmd/crc/cmd/cleanup.go:22:13: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
    	RunE: func(cmd *cobra.Command, args []string) error {
    	           ^
    cmd/crc/cmd/ip.go:17:13: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
    	RunE: func(cmd *cobra.Command, args []string) error {
    	           ^
    cmd/crc/cmd/oc_env.go:19:13: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
    	RunE: func(cmd *cobra.Command, args []string) error {
    ```
    praveenkumar committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    93d1b75 View commit details
    Browse the repository at this point in the history
  2. golangci-lint: Fix nolint for G110 (gosec)

    Looks like with latest version of linter to have annotating code, it
    need to be out of conditional statement. This PR fixes
    ```
    pkg/crc/cluster/pullsecret.go:124:15: G110: Potential DoS vulnerability via decompression bomb (gosec)
    	if _, err := io.Copy(&b, decompressor); err != nil {
    	             ^
    make: *** [Makefile:284: cross-lint] Error 1
    ```
    praveenkumar committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    faa8308 View commit details
    Browse the repository at this point in the history
  3. golangci-lint: Fix file permission for gosec

    If fixes following error
    ```
    pkg/os/windows/powershell/powershell_windows.go:77:12: G306: Expect WriteFile permissions to be 0600 or less (gosec)
    	if err := os.WriteFile(filename, append([]byte{0xef, 0xbb, 0xbf}, []byte(scriptContent)...), 0666); err != nil {
    	          ^
    ```
    praveenkumar committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    b88dd0a View commit details
    Browse the repository at this point in the history