-
Notifications
You must be signed in to change notification settings - Fork 55
chore: modernize, optimize, and document the RDAP library #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
00e521b
chore: update dependencies and modernize with go fix
wolveix 54f69d5
chore: ignore editor, IDE, and OS artifacts
wolveix 6a6e22f
perf: cache decoder field plans, slim DecodeData, optimize string hot…
wolveix 3f86839
docs: document exported and printer functions, fix gofmt drift
wolveix a63633d
chore: bump deps
wolveix 226d6e9
fix: restore Answer field order, harden CI workflow permissions
wolveix 6f1dfff
chore: add CI lint/test workflows and resolve golangci-lint findings
wolveix 272ecf4
chore: apply linter fixes and formatting
wolveix 4cbf82c
test: add golden-file end-to-end tests for RunCLI
wolveix 43c9f64
ci: run unit tests on a Go 1.25.x and 1.26.x matrix
wolveix b6c7332
chore: apply linter fixes and formatting
wolveix 053ee55
test: colocate benchmarks with the code they exercise
wolveix cbf2bd8
ci: exclude false-positive gosec G115 in print.go via config
wolveix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Go Build | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "**/*.go" | ||
| - "go.mod" | ||
| - "go.sum" | ||
|
|
||
| concurrency: | ||
| cancel-in-progress: true | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Build | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '^1.26.0' | ||
| - run: | | ||
| cd cmd/rdap | ||
| go build -o rdap | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: Lint | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "**/*.go" | ||
| - "go.mod" | ||
| - "go.sum" | ||
| - ".golangci.yml" | ||
|
|
||
| concurrency: | ||
| cancel-in-progress: true | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
|
|
||
| # Deny all token scopes by default; the lint job escalates only what it needs. | ||
| permissions: {} | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| # Give the default GITHUB_TOKEN write permission to commit and push the | ||
| # added or changed files to the repository. | ||
| contents: write | ||
| # Allow lint annotations in the PR. | ||
| pull-requests: read | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
|
|
||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '^1.26.0' | ||
|
wolveix marked this conversation as resolved.
|
||
|
|
||
| - name: Download dependencies | ||
| run: go mod download | ||
|
|
||
| - name: Install gofumpt | ||
| run: go install mvdan.cc/gofumpt@latest | ||
|
|
||
| - name: Format code | ||
| run: gofumpt -w . | ||
|
|
||
| - name: Run golangci-lint (fix) | ||
| uses: golangci/golangci-lint-action@v9 | ||
| with: | ||
| args: --fix --issues-exit-code=0 --timeout=5m | ||
| install-mode: goinstall | ||
| version: latest | ||
|
|
||
| - name: Commit changes | ||
| uses: stefanzweifel/git-auto-commit-action@v5 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| with: | ||
| commit_message: "chore: apply linter fixes and formatting" | ||
|
|
||
| - name: Run golangci-lint (check) | ||
| uses: golangci/golangci-lint-action@v9 | ||
| with: | ||
| args: --timeout=5m | ||
| install-mode: goinstall | ||
| version: latest | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Tests (Unit) | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "**/*.go" | ||
| - "go.mod" | ||
| - "go.sum" | ||
|
|
||
| concurrency: | ||
| cancel-in-progress: true | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| tests-unit: | ||
| name: Tests (Unit) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # 1.25.x is the floor declared in go.mod; 1.26.x is the latest release. | ||
| # Testing both ensures the declared minimum stays buildable while the | ||
| # latest toolchain is exercised. | ||
| go-version: ['1.25.x', '1.26.x'] | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: ${{ matrix.go-version }} | ||
|
|
||
|
wolveix marked this conversation as resolved.
|
||
| - name: Download dependencies | ||
| run: go mod download | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| go test -race -coverprofile=coverage.out ./... | ||
| coverage=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}') | ||
| echo "Total coverage: $coverage%" | ||
| if (( $(echo "$coverage < 50" | bc -l) )); then | ||
| echo "Coverage $coverage% is below 50% threshold" | ||
| exit 1 | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| .*.un~ | ||
| *.DS_Store | ||
| *.log | ||
| .idea/* | ||
| .vscode/* |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.