[PR #400] [MERGED] Migrate backend linter to v2. Fixed unit test workflow #833

Closed
opened 2025-10-09 16:58:06 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/400
Author: @Rich7690
Created: 3/28/2025
Status: Merged
Merged: 3/28/2025
Merged by: @kmendell

Base: mainHead: main


📝 Commits (1)

  • 8835e91 refactor(backend): migrate backend linter to v2. Fixed unit test workflow

📊 Changes

16 files changed (+95 additions, -53 deletions)

View changed files

📝 .github/workflows/backend-linter.yml (+2 -2)
📝 .github/workflows/unit-tests.yml (+3 -2)
📝 Dockerfile (+1 -1)
📝 backend/.golangci.yml (+54 -15)
📝 backend/go.mod (+1 -1)
📝 backend/internal/controller/oidc_controller.go (+3 -2)
📝 backend/internal/dto/dto_mapper.go (+6 -6)
📝 backend/internal/dto/validations.go (+3 -2)
📝 backend/internal/middleware/cors.go (+3 -1)
📝 backend/internal/model/api_key.go (+1 -3)
📝 backend/internal/model/base.go (+1 -1)
📝 backend/internal/service/api_key_service.go (+2 -1)
📝 backend/internal/service/custom_claim_service.go (+3 -2)
📝 backend/internal/service/jwt_service_test.go (+6 -6)
📝 backend/internal/utils/aaguid_util_test.go (+2 -2)
📝 backend/internal/utils/email/composer.go (+4 -6)

📄 Description

I realized after I added the backend linter, the latest v2 of golangci-lint was already out. So I migrated to the latest v2 config format and added a couple more useful linters and fixed the relevant issues. Additionally I noticed there was a broken test and the automated workflow did not fail it since it was piping the output


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pocket-id/pocket-id/pull/400 **Author:** [@Rich7690](https://github.com/Rich7690) **Created:** 3/28/2025 **Status:** ✅ Merged **Merged:** 3/28/2025 **Merged by:** [@kmendell](https://github.com/kmendell) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`8835e91`](https://github.com/pocket-id/pocket-id/commit/8835e91e61986d8a5ba42d03b6c3c683a0a03ed2) refactor(backend): migrate backend linter to v2. Fixed unit test workflow ### 📊 Changes **16 files changed** (+95 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/backend-linter.yml` (+2 -2) 📝 `.github/workflows/unit-tests.yml` (+3 -2) 📝 `Dockerfile` (+1 -1) 📝 `backend/.golangci.yml` (+54 -15) 📝 `backend/go.mod` (+1 -1) 📝 `backend/internal/controller/oidc_controller.go` (+3 -2) 📝 `backend/internal/dto/dto_mapper.go` (+6 -6) 📝 `backend/internal/dto/validations.go` (+3 -2) 📝 `backend/internal/middleware/cors.go` (+3 -1) 📝 `backend/internal/model/api_key.go` (+1 -3) 📝 `backend/internal/model/base.go` (+1 -1) 📝 `backend/internal/service/api_key_service.go` (+2 -1) 📝 `backend/internal/service/custom_claim_service.go` (+3 -2) 📝 `backend/internal/service/jwt_service_test.go` (+6 -6) 📝 `backend/internal/utils/aaguid_util_test.go` (+2 -2) 📝 `backend/internal/utils/email/composer.go` (+4 -6) </details> ### 📄 Description I realized after I added the backend linter, the latest `v2` of golangci-lint was already out. So I migrated to the latest v2 config format and added a couple more useful linters and fixed the relevant issues. Additionally I noticed there was a broken test and the automated workflow did not fail it since it was piping the output --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-09 16:58:06 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-2#833