chore: migrate to gitea
Some checks failed
golangci-lint / lint (push) Failing after 2m21s
Test / test (push) Successful in 3m47s

This commit is contained in:
2026-01-25 21:50:03 +01:00
parent 28a6cd4ec6
commit 58535a07ff
3 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
# Copilot Instructions for tcgdex-golang
## Project Overview
This repository implements a Go client for interacting with the tcgdex (Trading Card Game Database) API. The codebase is organized into two main directories:
- `client/`: Contains API client logic and request builders for cards, series, and sets.
- `models/`: Defines data structures representing cards, abilities, attacks, items, variants, legalities, series, and sets.
## Architecture & Data Flow
- The `client` package provides entry points for querying tcgdex data. Each file (e.g., `cards.go`, `series.go`) encapsulates logic for a specific resource type.
- The `models` package contains Go structs that mirror the API's JSON schema. These are used for unmarshalling API responses and internal data handling.
- Data flows from API requests (built in `client/`) into model structs, which are then consumed by application logic or returned to callers.
## Developer Workflows
- **Build:** Use `go build ./...` from the project root to build all packages.
- **Test:** Run `go test ./...` to execute all tests (if present). No test files detected in the current structure.
- **Coverage:** If coverage is needed, use `go test -coverprofile=coverage.out ./...`.
- **Dependencies:** Managed via Go modules (`go.mod`, `go.sum`). Use `go mod tidy` to clean up dependencies.
- **Makefile:** If present, check for custom build/test commands. (No custom targets detected in current context.)
## Project-Specific Patterns
- **Resource Separation:** Each API resource (card, series, set) has its own client and model files. Follow this pattern for new resources.
- **Model Naming:** Model structs use the `card_`, `serie_`, and `set_` prefixes to indicate their domain. Maintain this convention for clarity.
- **Client Builders:** Use builder patterns in `client/client_builder.go` for constructing complex queries.
- **Error Handling:** Standard Go error handling is used. Return errors from client methods and propagate them up.
## Integration Points
- **External API:** All data is fetched from the tcgdex API. No other external services detected.
- **No Database:** The project does not persist data locally; it acts as a pure API client.
## Examples
- To add a new resource, create a model in `models/` (e.g., `resource.go`) and a client in `client/` (e.g., `resource.go`).
- To extend card functionality, update `models/card.go` and `client/cards.go`.
## Key Files
- `client/cards.go`, `client/series.go`, `client/sets.go`: API resource clients
- `models/card.go`, `models/serie.go`, `models/set.go`: Core data models
- `client/client_builder.go`: Query builder logic
- `go.mod`, `go.sum`: Dependency management
## Conventions
- Keep resource logic and models in separate files for maintainability.
- Use Go idioms for error handling and struct design.
- Document public methods with GoDoc comments for clarity.
---
If any section is unclear or missing important details, please specify which part needs improvement or what additional context is required.

View File

@@ -0,0 +1,23 @@
name: golangci-lint
on:
push:
pull_request:
permissions:
contents: read
# Optional: allow read access to pull requests. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.3.1

24
.gitea/workflows/test.yml Normal file
View File

@@ -0,0 +1,24 @@
name: Test
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24'
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make
- name: Run make check-all
run: make test