Skip to content

Commit 6a6d732

Browse files
committed
Initial commit: RubyGems.org API client for Go
- Extracted from github.com/contriboss/ore - Provider implementation for ORE's plugin architecture - Supports parallel gem fetching with connection pooling - Includes comprehensive test coverage - Uses Mage build system and GitHub CI/CD - MIT licensed
0 parents  commit 6a6d732

File tree

11 files changed

+907
-0
lines changed

11 files changed

+907
-0
lines changed

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
schedule:
9+
# Run weekly to catch issues with dependencies
10+
- cron: '0 8 * * 1'
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Go
22+
uses: actions/setup-go@v6
23+
with:
24+
go-version: '1.25'
25+
26+
- name: Install Mage
27+
run: go install github.com/magefile/mage@latest
28+
29+
- name: Download dependencies
30+
run: mage deps
31+
32+
- name: Run tests with coverage
33+
run: mage test
34+
35+
- name: Run tests with race detector
36+
run: mage testrace
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v4
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
files: ./coverage.out
43+
44+
lint:
45+
name: Lint
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v4
51+
52+
- name: Setup Go
53+
uses: actions/setup-go@v6
54+
with:
55+
go-version: '1.25'
56+
57+
- name: Install Mage
58+
run: go install github.com/magefile/mage@latest
59+
60+
- name: Run linting
61+
run: mage lint
62+
63+
examples:
64+
name: Validate Examples
65+
runs-on: ubuntu-latest
66+
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v4
70+
71+
- name: Setup Go
72+
uses: actions/setup-go@v6
73+
with:
74+
go-version: '1.25'
75+
76+
- name: Install Mage
77+
run: go install github.com/magefile/mage@latest
78+
79+
- name: Run examples
80+
run: mage examples

.golangci.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
run:
2+
timeout: 5m
3+
tests: true
4+
5+
linters:
6+
enable:
7+
- bodyclose
8+
- dogsled
9+
- dupl
10+
- errcheck
11+
- exhaustive
12+
- funlen
13+
- gochecknoinits
14+
- goconst
15+
- gocritic
16+
- gocyclo
17+
- gofmt
18+
- goimports
19+
- goprintffuncname
20+
- gosec
21+
- gosimple
22+
- govet
23+
- ineffassign
24+
- lll
25+
- misspell
26+
- nakedret
27+
- noctx
28+
- nolintlint
29+
- rowserrcheck
30+
- staticcheck
31+
- stylecheck
32+
- typecheck
33+
- unconvert
34+
- unparam
35+
- unused
36+
- whitespace
37+
38+
linters-settings:
39+
dupl:
40+
threshold: 100
41+
exhaustive:
42+
default-signifies-exhaustive: false
43+
funlen:
44+
lines: 100
45+
statements: 50
46+
goconst:
47+
min-len: 2
48+
min-occurrences: 2
49+
gocritic:
50+
enabled-tags:
51+
- diagnostic
52+
- experimental
53+
- opinionated
54+
- performance
55+
- style
56+
disabled-checks:
57+
- dupImport
58+
- ifElseChain
59+
- octalLiteral
60+
- whyNoLint
61+
- wrapperFunc
62+
gocyclo:
63+
min-complexity: 15
64+
goimports:
65+
local-prefixes: github.com/contriboss/gemfile-go
66+
govet:
67+
enable:
68+
- shadow
69+
lll:
70+
line-length: 140
71+
misspell:
72+
locale: US
73+
nolintlint:
74+
allow-leading-space: true
75+
allow-unused: false
76+
require-explanation: false
77+
require-specific: false
78+
79+
issues:
80+
exclude-dirs:
81+
- vendor
82+
- testdata
83+
exclude-rules:
84+
- path: _test\.go
85+
linters:
86+
- funlen
87+
- dupl
88+
89+
- path: examples/
90+
linters:
91+
- goconst
92+
- funlen

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-merge-conflict
10+
- id: check-case-conflict
11+
- id: mixed-line-ending
12+
args: ['--fix=lf']
13+
14+
- repo: https://github.com/golangci/golangci-lint
15+
rev: v2.4.0
16+
hooks:
17+
- id: golangci-lint
18+
19+
- repo: https://github.com/dnephin/pre-commit-golang
20+
rev: v0.5.1
21+
hooks:
22+
- id: go-fmt
23+
- id: go-imports
24+
- id: go-mod-tidy

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 ContribOSS
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)