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

The linter 'maligned' is deprecated use govet 'fieldalignment' instead." #24

Closed
KEINOS opened this issue Mar 6, 2021 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@KEINOS
Copy link
Owner

KEINOS commented Mar 6, 2021

Currently I get the below warn. Seems that maligned linter is deprecated.

level=warning msg="[runner] The linter 'maligned' is deprecated due to: The repository of the linter has been archived by the owner. Use govet 'fieldalignment' instead."
$ go version
go version go1.15.8 linux/amd64

$ # ignore the "config/config.go:51:18 ... " error. Focus on "level=warning ... " line.
$ ./.github/run-tests-merge.sh
...
- Lint check (golangci-lint) ... NG
        level=warning msg="[runner] The linter 'maligned' is deprecated due to: The repository of the linter has been archived by the owner. Use govet 'fieldalignment' instead."
        config/config.go:51:18: fieldalignment: struct with 80 pointer bytes could be 72 (govet)
        type TConfigFile struct {
                         ^

        References for debugging lint error:
          wsl     : https://github.com/bombsimon/wsl/blob/master/doc/rules.md
          gofumpt : https://github.com/mvdan/gofumpt#added-rules
          * for other lint errors see: https://golangci-lint.run/usage/linters/

The line which is causing the warning is the below in ./.github/golangci.yml. See the line 62.

linters:
enable:
- deadcode # Finds unused code
- dogsled
- dupl
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- funlen
- gocognit
- gocritic
- gocyclo
- godot
- godox
- gofmt
- gofumpt # Stricter gofmt
- golint
- gosec # Inspects source code for security problems
- gosimple # Linter for Go source code that specializes in simplifying a code
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- ifshort
- ineffassign # Detects when assignments to existing variables are not used
- lll
- maligned
- megacheck # gosimple, staticcheck, unused
- misspell # Find commonly misspelled English words in comments
- nakedret # Limit naked returns in functions greater than a specified function length
- nestif # Limit if statements nested deep
- nolintlint # Don't allow 'nolint' annotation w/out a description
- nlreturn # Requires a new line before return
- prealloc # Finds slice declarations that could potentially be preallocated
- predeclared # Find code that shadows one of Go's predeclared identifiers
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- structcheck # Finds unused struct fields
- stylecheck
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
- unconvert # Detect unnecessary type conversions
- unused # Checks Go code for unused constants, variables, functions and types
#- testpackage # Limit use unexported functions and methods from source code in tests
- thelper # Enforce to call 't.Helper()' in the test helper function
- varcheck # Finds unused global variables and constants
- whitespace # Limit unnecessary newlines at the start and end of functions, if, for, etc
- wsl # Enforce empty lines at the right places to make code more readable.

By removing maligned did fix the problem.

     - lll
-    - maligned
     - megacheck   # gosimple, staticcheck, unused
$ # ignore the "config/config.go:51:18 ... " error.
$ # Focus that "level=warning ... " line is not shown any more.
$ ./.github/run-tests-merge.sh
...
- Lint check (golangci-lint) ... NG
        config/config.go:51:18: fieldalignment: struct with 80 pointer bytes could be 72 (govet)
        type TConfigFile struct {
                         ^

        References for debugging lint error:
          wsl     : https://github.com/bombsimon/wsl/blob/master/doc/rules.md
          gofumpt : https://github.com/mvdan/gofumpt#added-rules
          * for other lint errors see: https://golangci-lint.run/usage/linters/
@KEINOS KEINOS added the bug Something isn't working label Mar 6, 2021
KEINOS added a commit that referenced this issue Nov 26, 2021
## Feat

Totally refactored (simpler source structure)

* feat: new Docker image (more secure and light weight. Debian -> Alpine)
* feat: codeQL-analysis.yml
* feat: auto mod updater (auto PR on go.mod update)
* feat: auto merge on go.mod update only (via mergify)
* feat: include go.sum

## Fix

* fix: #23 bad indentation
* fix: golangci-lint warnings
* fix: use latest goclangci-lint for lint check
* fix: mergify.yml (deprecated "strict" config)
* fix: redundant checks (only on push to main)
* fix: remove bin directory

## Chore

* Update platform-test.yaml
* Update golangci-lint.yaml
* Update version-tests.yaml

---

Closing #23
Closing #24
@KEINOS KEINOS closed this as completed Nov 26, 2021
KEINOS added a commit that referenced this issue Nov 26, 2021
## Feat

Totally refactored (simpler source structure)

* feat: new Docker image (more secure and light weight. Debian -> Alpine)
* feat: codeQL-analysis.yml
* feat: auto mod updater (auto PR on go.mod update)
* feat: auto merge on go.mod update only (via mergify)
* feat: include go.sum

## Fix

* fix: #23 bad indentation
* fix: golangci-lint warnings
* fix: use latest goclangci-lint for lint check
* fix: mergify.yml (deprecated "strict" config)
* fix: redundant checks (only on push to main)
* fix: remove bin directory

## Chore

* Update platform-test.yaml
* Update golangci-lint.yaml
* Update version-tests.yaml

---

Closing #23
Closing #24
KEINOS added a commit that referenced this issue Nov 26, 2021
## Feat

Totally refactored (simpler source structure)

* feat: new Docker image (more secure and light weight. Debian -> Alpine)
* feat: codeQL-analysis.yml
* feat: auto mod updater (auto PR on go.mod update)
* feat: auto merge on go.mod update only (via mergify)
* feat: include go.sum

## Fix

* fix: #23 bad indentation
* fix: golangci-lint warnings
* fix: use latest goclangci-lint for lint check
* fix: mergify.yml (deprecated "strict" config)
* fix: redundant checks (only on push to main)
* fix: remove bin directory

## Chore

* Update platform-test.yaml
* Update golangci-lint.yaml
* Update version-tests.yaml

---

Closing #23
Closing #24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant