Skip to content

Commit 21dbb5e

Browse files
committed
Merge dev into main: accept production-hardened code
2 parents 9fadaf4 + a7cdb3e commit 21dbb5e

237 files changed

Lines changed: 5550 additions & 684 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# EditorConfig - https://editorconfig.org
2-
# Consistent coding styles across editors and IDEs
1+
# EditorConfig https://editorconfig.org
2+
# Canonical eco-wide template (.shared-templates/editorconfig.tmpl).
33

44
root = true
55

6-
# Default settings for all files
6+
# Default for everything.
77
[*]
88
charset = utf-8
99
end_of_line = lf
@@ -12,55 +12,56 @@ trim_trailing_whitespace = true
1212
indent_style = space
1313
indent_size = 4
1414

15-
# Go files - tabs per Go convention
15+
# Go uses tabs by convention.
1616
[*.go]
1717
indent_style = tab
1818
indent_size = 4
1919

20-
# YAML files
20+
# Python — PEP 8.
21+
[*.py]
22+
indent_size = 4
23+
24+
# TypeScript / JavaScript — 2 spaces, ecosystem default.
25+
[*.{ts,tsx,js,jsx,mjs,cjs}]
26+
indent_size = 2
27+
28+
# Web assets.
29+
[*.{html,css,scss}]
30+
indent_size = 2
31+
32+
# YAML — 2 spaces (ecosystem standard, GitHub Actions, k8s, etc.).
2133
[*.{yml,yaml}]
2234
indent_size = 2
2335

24-
# TOML files
25-
[*.toml]
36+
# JSON / JSONC.
37+
[*.{json,jsonc}]
2638
indent_size = 2
2739

28-
# JSON files
29-
[*.json]
40+
# TOML.
41+
[*.toml]
3042
indent_size = 2
3143

32-
# Markdown files
44+
# Markdown — 2 spaces, preserve trailing whitespace (used for line breaks).
3345
[*.md]
3446
trim_trailing_whitespace = false
3547
indent_size = 2
3648

37-
# Shell scripts
38-
[*.sh]
49+
# Shell scripts.
50+
[*.{sh,bash,zsh,fish}]
3951
indent_size = 4
4052

41-
# Makefiles - must use tabs
42-
[Makefile]
43-
indent_style = tab
44-
45-
[*.mk]
53+
# Makefiles must use tabs.
54+
[{Makefile,*.mk}]
4655
indent_style = tab
4756

48-
# Docker files
57+
# Dockerfiles.
4958
[Dockerfile*]
5059
indent_size = 4
5160

52-
# GitHub Actions
53-
[.github/**/*.yml]
61+
# GitHub Actions workflows — 2 spaces.
62+
[.github/**/*.{yml,yaml}]
5463
indent_size = 2
5564

56-
# Config files
65+
# Config files.
5766
[*.{cfg,ini,conf}]
5867
indent_size = 4
59-
60-
# HTML/CSS/JS (for dashboard)
61-
[*.{html,css,js,ts}]
62-
indent_size = 2
63-
64-
# Git config
65-
[.git*]
66-
indent_size = 4

.gitattributes

Lines changed: 75 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,86 @@
1-
# Auto detect text files and perform LF normalization
2-
* text=auto eol=lf
3-
4-
# Go source files
5-
*.go text eol=lf diff=golang
6-
7-
# Shell scripts
8-
*.sh text eol=lf
1+
# Canonical eco-wide .gitattributes template (.shared-templates/gitattributes.tmpl).
2+
# Auto-detect text files and normalise line endings to LF.
93

10-
# Makefiles
11-
Makefile text eol=lf
4+
* text=auto eol=lf
125

13-
# Documentation
14-
*.md text eol=lf diff=markdown
15-
*.txt text eol=lf
6+
# --- Source code -----------------------------------------------------------
7+
*.go text eol=lf diff=golang
8+
*.py text eol=lf diff=python
9+
*.ts text eol=lf
10+
*.tsx text eol=lf
11+
*.js text eol=lf
12+
*.jsx text eol=lf
13+
*.mjs text eol=lf
14+
*.cjs text eol=lf
15+
*.rs text eol=lf diff=rust
1616

17-
# Config files
18-
*.toml text eol=lf
19-
*.yaml text eol=lf
20-
*.yml text eol=lf
21-
*.json text eol=lf linguist-language=JSON
22-
*.cff text eol=lf
17+
# --- Shell + config --------------------------------------------------------
18+
*.sh text eol=lf
19+
*.bash text eol=lf
20+
*.toml text eol=lf
21+
*.yaml text eol=lf
22+
*.yml text eol=lf
23+
*.json text eol=lf linguist-language=JSON
24+
*.jsonc text eol=lf linguist-language=JSON
25+
*.cff text eol=lf
2326

24-
# Go module files
25-
go.mod text eol=lf linguist-generated
26-
go.sum text eol=lf linguist-generated
27+
# --- Documentation ---------------------------------------------------------
28+
*.md text eol=lf diff=markdown
29+
*.txt text eol=lf
2730

28-
# Docker
29-
Dockerfile text eol=lf
31+
# --- Build / packaging ----------------------------------------------------
32+
Makefile text eol=lf
33+
*.mk text eol=lf
34+
Dockerfile* text eol=lf
3035
docker-compose*.yml text eol=lf
36+
.github/**/*.yml text eol=lf
37+
.github/**/*.yaml text eol=lf
3138

32-
# GitHub Actions
33-
.github/**/*.yml text eol=lf
34-
35-
# Binary files
36-
*.exe binary
37-
*.dll binary
38-
*.so binary
39-
*.dylib binary
40-
*.db binary
41-
*.sqlite binary
42-
*.png binary
43-
*.jpg binary
44-
*.jpeg binary
45-
*.gif binary
46-
*.ico binary
47-
*.pdf binary
48-
*.zip binary
49-
*.tar.gz binary
50-
*.tgz binary
39+
# --- Generated artefacts (mark as such for diffs and language stats) ------
40+
go.mod text eol=lf linguist-generated
41+
go.sum text eol=lf linguist-generated
42+
*.pb.go linguist-generated
43+
*_generated.go linguist-generated
44+
package-lock.json linguist-generated
45+
pnpm-lock.yaml linguist-generated
46+
yarn.lock linguist-generated
5147

52-
# Test data
53-
tests/testdata/** linguist-vendored
48+
# --- Vendored / external sources ------------------------------------------
49+
vendor/** linguist-vendored
50+
node_modules/** linguist-vendored
51+
testdata/** linguist-vendored
5452
benchmarks/data/** linguist-vendored
55-
OSS-REF/** linguist-vendored
56-
57-
# Vendor (if used)
58-
vendor/** linguist-vendored
5953

60-
# Generated files
61-
*_generated.go linguist-generated
62-
*.pb.go linguist-generated
54+
# --- Binary files (do not text-normalise) ---------------------------------
55+
*.exe binary
56+
*.dll binary
57+
*.so binary
58+
*.dylib binary
59+
*.a binary
60+
*.o binary
61+
*.db binary
62+
*.sqlite binary
63+
*.png binary
64+
*.jpg binary
65+
*.jpeg binary
66+
*.gif binary
67+
*.ico binary
68+
*.svg text eol=lf
69+
*.pdf binary
70+
*.zip binary
71+
*.tar.gz binary
72+
*.tgz binary
73+
*.whl binary
6374

64-
# Export ignore (not included in source archives)
65-
.github export-ignore
66-
.gitattributes export-ignore
67-
.gitignore export-ignore
68-
.editorconfig export-ignore
69-
.golangci.yml export-ignore
70-
OSS-REF/ export-ignore
71-
benchmarks/ export-ignore
72-
tests/ export-ignore
73-
docs/DEEP_COMPETITIVE_ANALYSIS.md export-ignore
74-
docs/COMPREHENSIVE_OSS_COMPETITORS.md export-ignore
75-
docs/COMPETITOR_SUMMARY.md export-ignore
76-
MASTER_TASK_LIST.md export-ignore
75+
# --- Source archive hygiene (excluded from `git archive`) -----------------
76+
.github export-ignore
77+
.shared-templates export-ignore
78+
.gitattributes export-ignore
79+
.gitignore export-ignore
80+
.editorconfig export-ignore
81+
.golangci.yml export-ignore
82+
.goreleaser.yml export-ignore
83+
.goreleaser.yaml export-ignore
84+
testdata/ export-ignore
85+
benchmarks/ export-ignore
86+
e2e/ export-ignore
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Bug report
2+
description: Something is broken or behaving unexpectedly.
3+
title: "bug: <one-line summary>"
4+
labels: ["bug", "triage"]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Thanks for taking the time to file a bug report. Please fill in as much
11+
of the form as you can — the more we know, the faster we can fix it.
12+
13+
Before submitting:
14+
- Search [existing issues](https://github.com/GrayCodeAI/tok/issues) to avoid duplicates.
15+
- If this is a security issue, please **do not** file a public issue. See `SECURITY.md`.
16+
17+
- type: textarea
18+
id: what-happened
19+
attributes:
20+
label: What happened?
21+
description: A clear, concise description of the bug.
22+
placeholder: When I run `tok ...` (or call `tok.Compress(...)`), I expected X but got Y.
23+
validations:
24+
required: true
25+
26+
- type: textarea
27+
id: reproduce
28+
attributes:
29+
label: Steps to reproduce
30+
description: Minimal steps that reliably reproduce the problem.
31+
placeholder: |
32+
1. Run `tok ...`
33+
2. Pipe in `...`
34+
3. See output `...` (expected `...`)
35+
validations:
36+
required: true
37+
38+
- type: textarea
39+
id: expected
40+
attributes:
41+
label: Expected behavior
42+
description: What did you expect to happen instead?
43+
validations:
44+
required: true
45+
46+
- type: textarea
47+
id: input-sample
48+
attributes:
49+
label: Minimal input sample (if compression-related)
50+
description: |
51+
If the bug is about compression output / ratio / a specific filter, paste a small,
52+
self-contained input that reproduces it. **Redact any secrets, tokens, or private data first.**
53+
render: text
54+
55+
- type: input
56+
id: tok-version
57+
attributes:
58+
label: tok version
59+
description: Output of `tok --version` or the git SHA you built from.
60+
placeholder: "0.2.0"
61+
validations:
62+
required: true
63+
64+
- type: input
65+
id: os
66+
attributes:
67+
label: Operating system
68+
description: e.g. macOS 14.5 (arm64), Ubuntu 24.04 (amd64), Windows 11 (amd64).
69+
placeholder: "macOS 14.5 (arm64)"
70+
validations:
71+
required: true
72+
73+
- type: input
74+
id: go-version
75+
attributes:
76+
label: Go version (if building from source)
77+
description: Output of `go version`. Skip if you installed a pre-built binary.
78+
placeholder: "go version go1.26.1 darwin/arm64"
79+
80+
- type: textarea
81+
id: logs
82+
attributes:
83+
label: Logs / output
84+
description: |
85+
Paste any relevant output. Re-run with `--verbose` if applicable.
86+
**Redact any secrets, tokens, or private data first.**
87+
render: shell
88+
89+
- type: checkboxes
90+
id: confirm
91+
attributes:
92+
label: Confirmation
93+
options:
94+
- label: I searched existing issues and did not find a duplicate.
95+
required: true
96+
- label: I redacted any secrets, API keys, or private data from logs.
97+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security vulnerability
4+
url: https://github.com/GrayCodeAI/tok/security/advisories/new
5+
about: Please report security issues privately via a GitHub Security Advisory. See SECURITY.md.
6+
- name: Question / discussion
7+
url: https://github.com/GrayCodeAI/tok/discussions
8+
about: Have a question or want to discuss an idea? Open a discussion instead of an issue.

0 commit comments

Comments
 (0)