Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e565f7b147 | |||
|
44464c0a85
|
|||
| 45c18ccef6 | |||
| 61f079354d | |||
| b19d1fa250 | |||
| 0f1ee07348 | |||
| 773cf10d05 | |||
| 038ef213bb | |||
| c35239b385 | |||
|
7644c6793e
|
|||
| 147fb3ab15 |
@@ -0,0 +1,30 @@
|
||||
name: presenter
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: 'stable'
|
||||
- name: Run tests
|
||||
run: go test -race -coverprofile=coverage.txt ./...
|
||||
|
||||
vulnerabilities:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: 'stable'
|
||||
- name: Check vulnerabilities
|
||||
run: |
|
||||
go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
govulncheck ./...
|
||||
@@ -10,13 +10,6 @@ repos:
|
||||
args:
|
||||
- --allow-multiple-documents
|
||||
- id: check-added-large-files
|
||||
- repo: https://gitlab.com/devopshq/gitlab-ci-linter
|
||||
rev: v1.0.6
|
||||
hooks:
|
||||
- id: gitlab-ci-linter
|
||||
args:
|
||||
- --project
|
||||
- unboundsoftware/shiny/presenter
|
||||
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
|
||||
rev: v9.23.0
|
||||
hooks:
|
||||
@@ -30,14 +23,14 @@ repos:
|
||||
- id: go-imports
|
||||
args:
|
||||
- -local
|
||||
- gitlab.com/unboundsoftware/shiny/presenter
|
||||
- git.unbound.se/shiny/presenter
|
||||
- repo: https://github.com/lietu/go-pre-commit
|
||||
rev: v1.0.0
|
||||
hooks:
|
||||
- id: go-test
|
||||
- id: gofumpt
|
||||
- repo: https://github.com/golangci/golangci-lint
|
||||
rev: v2.7.2
|
||||
rev: v2.8.0
|
||||
hooks:
|
||||
- id: golangci-lint-full
|
||||
- repo: https://github.com/gitleaks/gitleaks
|
||||
|
||||
@@ -18,7 +18,7 @@ Provides a standardized GraphQL error presenter that handles coded errors across
|
||||
### Usage
|
||||
|
||||
```go
|
||||
import "gitlab.com/unboundsoftware/shiny/presenter"
|
||||
import "git.unbound.se/shiny/presenter"
|
||||
|
||||
// Create error presenter with valid codes and entities
|
||||
errorPresenter := presenter.New(logger, validCodes, validEntities, internalErrorCode)
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
# Shiny global error presenter
|
||||
|
||||
GraphQL global error presenter handling coded errors.
|
||||
|
||||
[](https://gitlab.com/unboundsoftware/shiny/presenter/commits/main)
|
||||
[](https://codecov.io/gl/unboundsoftware:shiny/presenter)
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"gitlab.com/unboundsoftware/shiny/presenter"
|
||||
"git.unbound.se/shiny/presenter"
|
||||
)
|
||||
|
||||
func TestCodedError_ErrorIs(t *testing.T) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module gitlab.com/unboundsoftware/shiny/presenter
|
||||
module git.unbound.se/shiny/presenter
|
||||
|
||||
go 1.24.1
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/vektah/gqlparser/v2/gqlerror"
|
||||
|
||||
"gitlab.com/unboundsoftware/shiny/presenter"
|
||||
"git.unbound.se/shiny/presenter"
|
||||
)
|
||||
|
||||
func Test_globalErrorPresenter(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user