[PR #389] [MERGED] Add basic static analysis for backend #841

Closed
opened 2025-10-08 00:18:13 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/389
Author: @Rich7690
Created: 3/27/2025
Status: Merged
Merged: 3/27/2025
Merged by: @stonith404

Base: mainHead: main


📝 Commits (1)

  • 2af4b12 refactor(backend): add golangcilint

📊 Changes

8 files changed (+67 additions, -9 deletions)

View changed files

.github/workflows/backend-linter.yml (+36 -0)
backend/.golangci.yml (+21 -0)
📝 backend/internal/bootstrap/db_bootstrap.go (+3 -3)
📝 backend/internal/service/geolite_service.go (+1 -1)
📝 backend/internal/service/ldap_service.go (+2 -2)
📝 backend/internal/service/oidc_service.go (+1 -0)
📝 backend/internal/service/user_service.go (+1 -1)
📝 backend/internal/utils/email/composer.go (+2 -2)

📄 Description

Hey there,

This PR is probably a bit random and unexpected, but as a big fan of the project I saw an opportunity and thought taking a few minutes to contribute would be helpful. I'm not sure if the maintainers are familiar with golangci-lint or not so forgive me if I'm over explaining, but given that this project is starting to gain more popularity I thought you might benefit heavily from some automatic static analysis so you can save review time on common errors, vulnerabilities or style things you want to be consistent.
I started this PR with a very small subset of the available linters for the Go backend to keep it small, but there are quite a lot you can enforce if you want. See here. I'd be happy to help keep this part of the CI maintained if you think its valuable.
Let me know if you have any questions or concerns.


🔄 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/389 **Author:** [@Rich7690](https://github.com/Rich7690) **Created:** 3/27/2025 **Status:** ✅ Merged **Merged:** 3/27/2025 **Merged by:** [@stonith404](https://github.com/stonith404) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`2af4b12`](https://github.com/pocket-id/pocket-id/commit/2af4b1269f2df6f5c774afdb0bc14a756b750a33) refactor(backend): add golangcilint ### 📊 Changes **8 files changed** (+67 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/backend-linter.yml` (+36 -0) ➕ `backend/.golangci.yml` (+21 -0) 📝 `backend/internal/bootstrap/db_bootstrap.go` (+3 -3) 📝 `backend/internal/service/geolite_service.go` (+1 -1) 📝 `backend/internal/service/ldap_service.go` (+2 -2) 📝 `backend/internal/service/oidc_service.go` (+1 -0) 📝 `backend/internal/service/user_service.go` (+1 -1) 📝 `backend/internal/utils/email/composer.go` (+2 -2) </details> ### 📄 Description Hey there, This PR is probably a bit random and unexpected, but as a big fan of the project I saw an opportunity and thought taking a few minutes to contribute would be helpful. I'm not sure if the maintainers are familiar with [golangci-lint](https://github.com/golangci/golangci-lint) or not so forgive me if I'm over explaining, but given that this project is starting to gain more popularity I thought you might benefit heavily from some automatic static analysis so you can save review time on common errors, vulnerabilities or style things you want to be consistent. I started this PR with a very small subset of the available linters for the Go backend to keep it small, but there are quite a lot you can enforce if you want. See [here](https://golangci-lint.run/usage/linters/). I'd be happy to help keep this part of the CI maintained if you think its valuable. Let me know if you have any questions or concerns. --- <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-08 00:18:13 +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-1#841