Skip to content

Commit 29e7565

Browse files
committed
chore: initial commit
0 parents  commit 29e7565

15 files changed

Lines changed: 570 additions & 0 deletions

File tree

.gemini/config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
have_fun: false
2+
memory_config:
3+
disabled: false
4+
code_review:
5+
disable: false
6+
comment_severity_threshold: MEDIUM
7+
max_review_comments: -1
8+
9+
pull_request_opened:
10+
help: false
11+
summary: false
12+
code_review: true
13+
include_drafts: true

.gemini/styleguide.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Go version
2+
3+
This repository targets Go 1.26+ (`go.mod` declares `go 1.26.4`).
4+
5+
# `new(value)` builtin
6+
7+
Starting in Go 1.26, the built-in `new` accepts a value expression as well as a type. The following forms compile and
8+
behave as expected:
9+
10+
- `new(uint64(42))` returns a `*uint64` whose pointee is `42`.
11+
- `new("foo")` returns a `*string` whose pointee is `"foo"`.
12+
13+
Do not flag `new(<value>)` usage as an "invalid syntax" or "will not compile" error. It is the idiomatic way in this
14+
repo to build pointers to literal values.
15+
16+
# Output Format
17+
18+
If there are any issues, you must output them strictly in the following format. Do not include any greetings or
19+
introductory explanations.
20+
21+
- **Severity**: [High / Medium / Low]
22+
- **Issue**: (Briefly explain why it is a problem)
23+
- **Recommendation**: (Suggest how to fix or improve it)

.github/FUNDING.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [mickamy]

.github/copilot-instructions.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Go version
2+
3+
This repository targets Go 1.26+ (`go.mod` declares `go 1.26.4`).
4+
5+
# `new(value)` builtin
6+
7+
Starting in Go 1.26, the built-in `new` accepts a value expression as well as a type. The following forms compile and
8+
behave as expected:
9+
10+
- `new(uint64(42))` returns a `*uint64` whose pointee is `42`.
11+
- `new("foo")` returns a `*string` whose pointee is `"foo"`.
12+
13+
Do not flag `new(<value>)` usage as an "invalid syntax" or "will not compile" error. It is the idiomatic way in this
14+
repo to build pointers to literal values.
15+
16+
# Output Format
17+
18+
If there are any issues, you must output them strictly in the following format. Do not include any greetings or
19+
introductory explanations.
20+
21+
- **Severity**: [High / Medium / Low]
22+
- **Issue**: (Briefly explain why it is a problem)
23+
- **Recommendation**: (Suggest how to fix or improve it)

.github/workflows/ci.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
tags:
8+
- "v*"
9+
pull_request:
10+
branches:
11+
- "**"
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
lint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
26+
- name: golangci-lint
27+
uses: golangci/golangci-lint-action@v9
28+
with:
29+
version: v2.12.2
30+
31+
test:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v6
35+
36+
- uses: actions/setup-go@v5
37+
with:
38+
go-version-file: go.mod
39+
40+
- name: Run tests
41+
run: make test
42+
43+
build:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v6
47+
48+
- uses: actions/setup-go@v5
49+
with:
50+
go-version-file: go.mod
51+
52+
- name: Build binary
53+
run: make build

.github/workflows/release.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
push:
7+
tags:
8+
- "v*"
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: actions/setup-go@v5
22+
with:
23+
go-version-file: go.mod
24+
25+
- uses: goreleaser/goreleaser-action@v6
26+
with:
27+
version: latest
28+
args: release --clean
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# Go workspace file
18+
go.work
19+
go.work.sum
20+
21+
# env file
22+
.env
23+
24+
# artifacts
25+
bin/
26+
27+
# temporary files
28+
tmp/

.golangci.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
version: "2"
2+
3+
formatters:
4+
enable:
5+
- gofmt
6+
- goimports
7+
settings:
8+
goimports:
9+
local-prefixes:
10+
- github.com/mickamy/scrollback
11+
12+
linters:
13+
default: all
14+
settings:
15+
errcheck:
16+
exclude-functions:
17+
- fmt.Fprint
18+
- fmt.Fprintf
19+
- fmt.Fprintln
20+
tagliatelle:
21+
case:
22+
rules:
23+
json: snake
24+
yaml: snake
25+
usetesting:
26+
context-background: true
27+
context-todo: true
28+
os-mkdir-temp: true
29+
os-setenv: true
30+
os-chdir: true
31+
enable:
32+
- gomodguard_v2
33+
disable:
34+
- cyclop # Redundant; cognitive complexity is already tracked by gocognit
35+
- depguard # Import restrictions are not currently required for this internal architecture
36+
- dogsled # Multiple blank identifiers are unavoidable with some stdlib functions (e.g., runtime.Caller)
37+
- dupl # High false-positive rate in test suites where setup code is similar
38+
- err113 # Sentinel errors are used where meaningful; contextual fmt.Errorf is preferred elsewhere
39+
- exhaustruct # Hinders use of default values; too boilerplate-heavy for large structs
40+
- forbidigo # Essential for CLI tools that rely on fmt.Print for user output
41+
- funlen # Testing logic and table-driven tests naturally exceed standard length
42+
- gochecknoglobals # Necessary for certain package-level configurations or singleton patterns
43+
- gochecknoinits # Required for specific library registrations and setup hooks
44+
- gocognit # Thresholds are often too low for complex but necessary business logic
45+
- goconst # Repeated strings in tests are clearer than abstract constants
46+
- godot # Punctuation in comments is a stylistic choice, not a code quality issue
47+
- gomoddirectives # Local replace directives are needed for the example module
48+
- gomodguard # Deprecated; use gomodguard_v2 instead
49+
- ireturn # Returning interfaces is a valid design pattern in this project's architecture
50+
- mnd # "Magic numbers" are often self-explanatory (e.g., status codes, time units)
51+
- nestif # Deep nesting is sometimes the most readable way to handle complex logic
52+
- nlreturn # Forcing newlines before returns is purely stylistic and often disruptive
53+
- noinlineerr # Inline error handling (if err := ...; err != nil) is idiomatic Go
54+
- nonamedreturns # Named returns improve documentation and clarity for complex signatures
55+
- recvcheck # Value receivers are preferred when the receiver is not mutated
56+
- revive # Most rules are already covered by more specialized linters
57+
- thelper # Main value (begin check) conflicts with table-driven test closures; remaining checks are trivial
58+
- varnamelen # Short, idiomatic names (i, k, v) are preferred in concise Go code
59+
- wsl # Excessive whitespace enforcement often degrades code density and readability
60+
- wsl_v5 # Same as wsl; v5 variant also enforces excessive whitespace rules
61+
exclusions:
62+
rules:
63+
- path: _test\.go
64+
linters:
65+
- gocyclo # Each table case adds branches, so cyclomatic complexity climbs naturally and isn't a quality signal there.
66+
- maintidx # Same: table-driven tests grow long by design and the maintainability index is not a useful signal there.
67+
68+
issues:
69+
max-issues-per-linter: 0
70+
max-same-issues: 0

.goreleaser.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
version: 2
2+
3+
release:
4+
mode: replace
5+
replace_existing_artifacts: true
6+
7+
builds:
8+
- id: scrollback
9+
main: .
10+
binary: scrollback
11+
ldflags:
12+
- -X main.version={{.Version}}
13+
goos:
14+
- darwin
15+
- linux
16+
goarch:
17+
- amd64
18+
- arm64
19+
20+
archives:
21+
- ids:
22+
- scrollback
23+
formats:
24+
- tar.gz
25+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
26+
27+
brews:
28+
- name: scrollback
29+
homepage: https://github.com/mickamy/scrollback
30+
description: Infinite, searchable scrollback for your terminal — never lose a closed tmux pane again.
31+
directory: Formula
32+
install: |
33+
bin.install "scrollback"
34+
repository:
35+
owner: mickamy
36+
name: homebrew-tap
37+
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
38+
39+
changelog:
40+
sort: asc
41+
groups:
42+
- title: Features
43+
regexp: '^.*?feat(\(.+\))??!?:.+$'
44+
order: 0
45+
- title: Bug fixes
46+
regexp: '^.*?fix(\(.+\))??!?:.+$'
47+
order: 1
48+
- title: Performance
49+
regexp: '^.*?perf(\(.+\))??!?:.+$'
50+
order: 2
51+
- title: Refactor
52+
regexp: '^.*?refactor(\(.+\))??!?:.+$'
53+
order: 3
54+
- title: Documentation
55+
regexp: '^.*?docs(\(.+\))??!?:.+$'
56+
order: 4
57+
- title: Others
58+
order: 999
59+
filters:
60+
exclude:
61+
- '^Merge pull request'
62+
- '^Merge branch'

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) 2026 Tetsuro Mikami
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)