Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Sep 12, 2021
0 parents commit 9704659
Show file tree
Hide file tree
Showing 329 changed files with 53,183 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches:
- 'master'
pull_request:

env:
GOLANGCILINT_VERSION: 1.41.1

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: 1.16.6
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v${{ env.GOLANGCILINT_VERSION }}
- name: Test
run: make test
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: 1.16.6
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
35 changes: 35 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
linters:
enable:
- goimports
- nilerr
- forcetypeassert
- asciicheck
- bodyclose
- durationcheck
- errorlint
- noctx
- misspell
- exportloopref
- unconvert
- unparam
- wastedassign
- makezero
- exhaustive
- gosec
- nolintlint
- nakedret
- predeclared
- tagliatelle

linters-settings:
misspell:
ignore-words:
# elf RELA
- rela
- equalisation
- synchronisation
gosec:
excludes:
# allow md5
- G401
- G501
57 changes: 57 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
project_name: fq

before:
hooks:
- go mod download

builds:
- env:
- CGO_ENABLED=0
goarch:
- amd64
- arm64
goos:
- linux
- windows
- darwin
flags:
- -trimpath
ldflags:
# omit symbol table and debug information
- -s -w
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.CommitDate}}
- -X main.builtBy=goreleaser
checksum:
name_template: 'checksums.txt'

archives:
- files:
- none*
format_overrides:
- goos: windows
format: zip
replacements:
darwin: macos

snapshot:
name_template: "{{.Tag}}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

brews:
- tap:
owner: wader
name: homebrew-tap
folder: Formula
homepage: https://github.com/wader/fq
description: jq for binaries
license: MIT
test: |
system "#{bin}/fq -v"
131 changes: 131 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"cSpell.words": [
"AACSSR",
"APETAGEX",
"APEV",
"APIC",
"Arity",
"BCDU",
"CCIT",
"CLLID",
"Equalisation",
"Errorer",
"Exif",
"Exiter",
"FALLID",
"GOPATH",
"HEIC",
"HEVC",
"Horz",
"IDID",
"IEND",
"IHDR",
"Linearization",
"MJPEG",
"OSFS",
"Packetized",
"RDBs",
"RELA",
"SMPTE",
"TSSE",
"UIDID",
"UTCID",
"Uinteger",
"Unsychronized",
"WEBP",
"Xiph",
"acsp",
"bzip",
"chzyer",
"coef",
"colorjson",
"cpus",
"ctxreadseeker",
"ctxstack",
"demuxed",
"descr",
"dumpaddr",
"elif",
"endians",
"esds",
"fpbits",
"fqtest",
"ftyp",
"funcs",
"goarch",
"gofmt",
"goimports",
"gojq",
"gojqextra",
"golangci",
"gosec",
"gosimple",
"iinf",
"iloc",
"ilst",
"inband",
"infe",
"interp",
"ioextra",
"ipco",
"iprint",
"iprp",
"itchyny",
"ldflags",
"libavformat",
"localizable",
"luma",
"matroska",
"mfhd",
"mfra",
"mfro",
"moof",
"moov",
"mvex",
"nals",
"nalu",
"nalus",
"noctx",
"nolint",
"obus",
"origptr",
"pcap",
"pmezard",
"println",
"protobuf",
"randomised",
"recoverfn",
"rpad",
"sels",
"shquote",
"sidx",
"stco",
"stedolan",
"struct",
"structcheck",
"stsc",
"stsd",
"stsz",
"stts",
"synchronisation",
"syncmapl",
"tfdt",
"tfhd",
"tfra",
"tmpl",
"toimage",
"tojvalue",
"tovalue",
"traf",
"trex",
"trun",
"udta",
"ufffd",
"unconvert",
"unparam",
"xrange"
],
"editor.formatOnSave": true,
"cSpell.allowCompoundWords": true,
"cSpell.enabled": true,
}
6 changes: 6 additions & 0 deletions Bumpfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Dockerfile
go.mod

workflows-golang /go-version: ([\d.]+)/ git:https://github.com/actions/go-versions.git|/(.*)-.*/$1/|^1
workflow-golangcilint /GOLANGCILINT_VERSION: ([\d.]+)/ git:https://github.com/golangci/golangci-lint.git|^1
.github/workflows/*.yml
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# bump: golang /FROM golang:([\d.]+)/ docker:golang|^1
FROM golang:1.16.6 AS base

# docker build --target dev -t fq-dev - < Dockerfile && docker run --rm -ti -v "$PWD:/$PWD" -w "$PWD" fq-dev
FROM base AS dev

# bump: golangcilint /GOLANGCILINT_VERSION=([\d.]+)/ git:https://github.com/golangci/golangci-lint.git|^1
ARG GOLANGCILINT_VERSION=1.41.1
RUN \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b /usr/local/bin v$GOLANGCILINT_VERSION

FROM base AS builder

WORKDIR $GOPATH/src/fq
COPY go.mod go.sum ./
RUN go mod download
COPY Makefile main.go ./
COPY pkg pkg
COPY internal internal
RUN make test fq
RUN cp fq /fq

FROM scratch
COPY --from=builder /fq /fq
RUN ["/fq", "--version"]
ENTRYPOINT ["/fq"]
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2021 Mattias Wadman

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

0 comments on commit 9704659

Please sign in to comment.