Skip to content

Commit ffdc3e4

Browse files
Merge branch 'main' into license-checker
2 parents 40d109e + 6f2b51d commit ffdc3e4

File tree

220 files changed

+31201
-18769
lines changed

Some content is hidden

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

220 files changed

+31201
-18769
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# dependabot.yml
2+
#
3+
# Documentation:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: monthly
12+
- package-ecosystem: gomod
13+
directory: /
14+
schedule:
15+
interval: weekly

.github/workflows/go-checks.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@ jobs:
1818
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc
1919
with:
2020
version: v1.55
21-
vulncheck:
22-
name: vulncheck
23-
runs-on: ubuntu-22.04
24-
steps:
25-
- name: govluncheck
26-
uses: golang/govulncheck-action@7da72f730e37eeaad891fcff0a532d27ed737cd4
27-
with:
28-
go-version-file: 'go.mod'
21+
# Optional: golangci-lint command line arguments.
22+
args: --timeout=10m
2923
unit:
3024
name: unit tests
3125
runs-on: ubuntu-22.04
@@ -47,7 +41,7 @@ jobs:
4741
go-version: '1.21'
4842
cache: false
4943
- name: Integration Tests with the Go CLI
50-
run: go test ./tests -race
44+
run: go test ./integration -race
5145
license:
5246
name: license check
5347
runs-on: ubuntu-22.04
@@ -60,4 +54,4 @@ jobs:
6054
- name: install go-licenses
6155
run: go install github.com/google/go-licenses@5348b744d0983d85713295ea08a20cca1654a45e
6256
- name: check licenses
63-
run: go-licenses check --disallowed_types=forbidden --include_tests ./...
57+
run: go-licenses check --disallowed_types=forbidden --include_tests ./...
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Nightly Checks"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
jobs:
8+
vulncheck:
9+
name: vulncheck
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- name: govluncheck
13+
uses: golang/govulncheck-action@7da72f730e37eeaad891fcff0a532d27ed737cd4
14+
with:
15+
go-version-file: 'go.mod'

.github/workflows/proto-checks.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77
jobs:
88
buflint:
9-
name: lint
9+
name: Buf Lint
1010
runs-on: ubuntu-22.04
1111
steps:
1212
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
@@ -27,4 +27,4 @@ jobs:
2727
- uses: bufbuild/buf-breaking-action@a074e988ee34efcd4927079e79c611f428354c01
2828
with:
2929
input: proto
30-
against: 'https://github.com/opentdf/opentdf-v2-poc.git#branch=main'
30+
against: 'https://github.com/opentdf/opentdf-v2-poc.git#branch=main,subdir=proto'

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@
1818
# vendor/
1919

2020
# Go workspace file
21-
go.work
21+
#go.work
2222

2323
tmp/
2424
.DS_Store
25-
__pycache__
25+
__pycache__
26+
27+
# GoLand IDE
28+
.idea/
29+
30+
opentdf.yaml
31+
.vscode/settings.json

.golangci.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
issues:
2+
# Show only new issues: if there are unstaged changes or untracked files,
3+
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
4+
# It's a super-useful option for integration of golangci-lint into existing large codebase.
5+
# It's not practical to fix all existing issues at the moment of integration:
6+
# much better don't allow issues in new code.
7+
#
8+
# Default: false
9+
new: true
10+
# Show only new issues created after git revision `REV`.
11+
# Default: ""
12+
new-from-rev: HEAD

.golangci.yml

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ run:
1111
# Timeout for analysis, e.g. 30s, 5m.
1212
# Default: 1m
1313
timeout: 5m
14-
14+
skip-files:
15+
- ".*\\.pb\\.go"
16+
- ".*\\.pb\\.gw.go"
1517

1618
# This file contains only configs which differ from defaults.
1719
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
@@ -20,6 +22,10 @@ linters-settings:
2022
allow:
2123
- auth
2224
- error
25+
- Row
26+
- Rows
27+
- Leveler
28+
- Writer
2329
cyclop:
2430
# The maximal code complexity to report.
2531
# Default: 10
@@ -42,36 +48,6 @@ linters-settings:
4248
- switch
4349
- map
4450

45-
exhaustruct:
46-
# List of regular expressions to exclude struct packages and names from check.
47-
# Default: []
48-
exclude:
49-
# std libs
50-
- "^net/http.Client$"
51-
- "^net/http.Cookie$"
52-
- "^net/http.Request$"
53-
- "^net/http.Response$"
54-
- "^net/http.Server$"
55-
- "^net/http.Transport$"
56-
- "^net/url.URL$"
57-
- "^os/exec.Cmd$"
58-
- "^reflect.StructField$"
59-
- "^crypto/tls.Config$"
60-
# public libs
61-
- "^github.com/Shopify/sarama.Config$"
62-
- "^github.com/Shopify/sarama.ProducerMessage$"
63-
- "^github.com/mitchellh/mapstructure.DecoderConfig$"
64-
- "^github.com/prometheus/client_golang/.+Opts$"
65-
- "^github.com/spf13/cobra.Command$"
66-
- "^github.com/spf13/cobra.CompletionOptions$"
67-
- "^github.com/stretchr/testify/mock.Mock$"
68-
- "^github.com/testcontainers/testcontainers-go.+Request$"
69-
- "^github.com/testcontainers/testcontainers-go.FromDockerfile$"
70-
- "^golang.org/x/tools/go/analysis.Analyzer$"
71-
- "^google.golang.org/protobuf/.+Options$"
72-
- "^gopkg.in/yaml.v3.Node$"
73-
- "^github.com/redis/go-redis/v9.Options$"
74-
7551
funlen:
7652
# Checks the number of lines in a function.
7753
# If lower than 0, disable the check.
@@ -172,15 +148,29 @@ linters-settings:
172148
# database/sql is always checked
173149
# Default: []
174150
packages:
175-
- github.com/jmoiron/sqlx
151+
- github.com/jackc/pgx/v5
176152

177153
tenv:
178154
# The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
179155
# Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
180156
# Default: false
181157
all: true
182158

183-
159+
lll:
160+
line-length: 120
161+
162+
wrapcheck:
163+
ignoreSigs:
164+
- "status.Error("
165+
- ".Errorf("
166+
- "errors.New("
167+
- "errors.Unwrap("
168+
- "errors.Join("
169+
- ".Wrap("
170+
- ".Wrapf("
171+
- ".WithMessage("
172+
- ".WithMessagef("
173+
- ".WithStack("
184174
linters:
185175
disable-all: true
186176
enable:
@@ -252,7 +242,6 @@ linters:
252242

253243
## you may want to enable
254244
#- decorder # checks declaration order and count of types, constants, variables and functions
255-
#- exhaustruct # [highly recommend to enable] checks if all structure fields are initialized
256245
#- gci # controls golang package import order and makes it always deterministic
257246
#- ginkgolinter # [if you use ginkgo/gomega] enforces standards of using ginkgo and gomega
258247
- godox # detects FIXME, TODO and other comment keywords
@@ -325,7 +314,6 @@ issues:
325314
- gosec
326315
- noctx
327316
- wrapcheck
328-
- exhaustruct
329317
- lll
330318
- text: 'shadow: declaration of "(err)" shadows declaration at'
331319
linters: [ govet ]

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CODEOWNERS
2+
3+
* @opentdf/developers

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ provided that the following conditions are met:
1414
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
1515
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
1616
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
1818
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
19-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ V_GOLANGCILINT=golangci-lint run
1818

1919
.PHONY: all lint buf-lint buf-generate golangci-lint test clean build docker-build
2020

21-
all: lint test build
21+
all: pre-build lint test build
22+
23+
pre-build:
24+
@echo "Checking for required tools..."
25+
@which buf > /dev/null || (echo "buf not found, please install it from https://docs.buf.build/installation" && exit 1)
26+
@which golangci-lint > /dev/null || (echo "golangci-lint not found, please install it from https://golangci-lint.run/usage/install/" && exit 1)
27+
@which protoc-gen-doc > /dev/null || (echo "protoc-gen-doc not found, please 'go install' it https://github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc" && exit 1)
28+
@golangci-lint --version | grep "version 1.55" > /dev/null || (echo "golangci-lint version must be v1.55" && exit 1)
2229

2330
lint: buf-lint golangci-lint
2431

0 commit comments

Comments
 (0)