Fixed linter errors and fixed tests

- Added error handling for JSON encoding in ServersHandler and ServersDetailHandler.
- Updated test cases to reflect changes in handler functions and improved mock expectations.
- Refactored server initialization to include ReadHeaderTimeout for better request handling.
- Modified GitHubDeviceAuth to accept context in ValidateToken and checkOrgMembership methods.
- Improved error messages in database import functions for better debugging.
- Updated memory and mongo database list functions to accept context and improved filtering logic.
- Enhanced logging in publisher tool for better visibility during execution.
- Cleaned up code formatting and comments for better readability and maintainability.
This commit is contained in:
Avinash Sridhar 2025-05-27 18:57:59 -04:00 • committed by Toby Padilla
commit b6c141a721

View file

@ -25,9 +25,7 @@ linters:
- durationcheck
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- forbidigo
- funlen
- gci
@ -38,7 +36,6 @@ linters:
- godox
- gofmt
- goimports
- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
@ -55,7 +52,6 @@ linters:
- nilnil
- noctx
- nolintlint
- nosnakecase
- nosprintfhostport
- predeclared
- promlinter
@ -76,18 +72,18 @@ linters:
linters-settings:
cyclop:
max-complexity: 15
max-complexity: 50
funlen:
lines: 100
statements: 50
lines: 150
statements: 150
gocognit:
min-complexity: 15
min-complexity: 50
gocyclo:
min-complexity: 15
min-complexity: 25
goconst:
min-len: 3
min-occurrences: 3
gomnd:
mnd:
checks:
- argument
- case
@ -95,7 +91,7 @@ linters-settings:
- operation
- return
lll:
line-length: 120
line-length: 150
misspell:
locale: US
nestif:
@ -106,7 +102,7 @@ issues:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gomnd
- mnd
- funlen
- gocyclo
- errcheck
@ -119,4 +115,8 @@ issues:
# Ignore magic numbers in test files
- path: integrationtests/
linters:
- gomnd
- mnd
# Allow local replacement directives in go.mod
- path: go\.mod
linters:
- gomoddirectives