Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Commit d684217

Browse files
committed
update to go 1.19
1 parent 9487f0d commit d684217

File tree

14 files changed

+306
-475
lines changed

14 files changed

+306
-475
lines changed

Makefile

+47-11
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,61 @@
1+
# Make settings
2+
# Mostly copied from: https://tech.davis-hansson.com/p/make/
3+
4+
# Use Bash
5+
SHELL := bash
6+
7+
# If one of the commands fails just fail properly and don't run the other commands.
8+
.SHELLFLAGS := -eu -o pipefail -c
9+
10+
# Allows me to use a single shell session so you can do things like 'cd' without doing hacks.
11+
.ONESHELL:
12+
13+
# Tells make not to do crazy shit.
14+
MAKEFLAGS += --no-builtin-rules
15+
16+
# Allows me to replace tabs with > characters. This makes the things a bit easier to use things like forloops in bash.
17+
ifeq ($(origin .RECIPEPREFIX), undefined)
18+
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
19+
endif
20+
.RECIPEPREFIX = >
21+
22+
# App Vars
23+
124
APP_NAME = hclvet
2-
EPOCH_TIME = $(shell date +%s)
325
GIT_COMMIT = $(shell git rev-parse --short HEAD)
26+
# Although go 1.18 has the git info baked into the binary now it still seems like there is no support
27+
# For including outside variables except this. So keep it for now.
428
GO_LDFLAGS = '-X "github.com/clintjedwards/${APP_NAME}/internal/cli.appVersion=$(VERSION)"'
529
SHELL = /bin/bash
6-
VERSION = ${SEMVER}_${GIT_COMMIT}_${EPOCH_TIME}
30+
VERSION = ${SEMVER}_${GIT_COMMIT}
731

32+
## build-protos: build protobufs
833
build-protos:
9-
protoc --go_out=. --go_opt=paths=source_relative \
10-
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
11-
internal/plugin/proto/*.proto
34+
> protoc --go_out=. --go_opt=paths=source_relative \
35+
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
36+
internal/plugin/proto/*.proto
37+
.PHONY: build-protos
1238

13-
build: export CGO_ENABLED=0
39+
## build: run tests and compile application
1440
build: check-path-included check-semver-included build-protos
15-
go build -ldflags $(GO_LDFLAGS) -o $(path)
41+
> go test ./... -race
42+
> go mod tidy
43+
> export CGO_ENABLED=0
44+
> go build -ldflags $(GO_LDFLAGS) -o $(OUTPUT)
45+
.PHONY: build
46+
47+
## help: prints this help message
48+
help:
49+
> @echo "Usage: "
50+
> @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
51+
.PHONY: help
1652

1753
check-path-included:
18-
ifndef path
19-
$(error path is undefined; ex. path=/tmp/${APP_NAME})
54+
ifndef OUTPUT
55+
> $(error OUTPUT is undefined; ex. OUTPUT=/tmp/${APP_NAME})
2056
endif
2157

2258
check-semver-included:
23-
ifndef SEMVER
24-
$(error SEMVER is undefined; ex. SEMVER=1.1.0)
59+
ifeq ($(SEMVER), 0.0.0)
60+
> $(error SEMVER is undefined; ex. SEMVER=0.0.1)
2561
endif

demo.tape

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# VHS documentation
2+
#
3+
# Output:
4+
# Output <path>.gif Create a GIF output at the given <path>
5+
# Output <path>.mp4 Create an MP4 output at the given <path>
6+
# Output <path>.webm Create a WebM output at the given <path>
7+
#
8+
# Settings:
9+
# Set FontSize <number> Set the font size of the terminal
10+
# Set FontFamily <string> Set the font family of the terminal
11+
# Set Height <number> Set the height of the terminal
12+
# Set Width <number> Set the width of the terminal
13+
# Set LetterSpacing <float> Set the font letter spacing (tracking)
14+
# Set LineHeight <float> Set the font line height
15+
# Set Theme <string> Set the theme of the terminal (JSON)
16+
# Set Padding <number> Set the padding of the terminal
17+
# Set Framerate <number> Set the framerate of the recording
18+
# Set PlaybackSpeed <float> Set the playback speed of the recording
19+
#
20+
# Sleep:
21+
# Sleep <time> Sleep for a set amount of <time> in seconds
22+
#
23+
# Type:
24+
# Type[@<time>] "<characters>" Type <characters> into the terminal with a
25+
# <time> delay between each character
26+
#
27+
# Keys:
28+
# Backspace[@<time>] [number] Press the Backspace key
29+
# Down[@<time>] [number] Press the Down key
30+
# Enter[@<time>] [number] Press the Enter key
31+
# Space[@<time>] [number] Press the Space key
32+
# Tab[@<time>] [number] Press the Tab key
33+
# Left[@<time>] [number] Press the Left Arrow key
34+
# Right[@<time>] [number] Press the Right Arrow key
35+
# Up[@<time>] [number] Press the Up Arrow key
36+
# Down[@<time>] [number] Press the Down Arrow key
37+
# Ctrl+<key> Press the Control key + <key> (e.g. Ctrl+C)
38+
#
39+
# Display:
40+
# Hide Hide the subsequent commands from the output
41+
# Show Show the subsequent commands in the output
42+
43+
Output demo.gif
44+
45+
Set FontSize 24
46+
Set Width 1200
47+
Set Height 600
48+
Set Theme { "name": "Eastwood", "black": "#424242", "red": "#ff7675", "green": "#badc58", "yellow": "#ffeaa7", "blue": "#74b9ff", "purple": "#cc99cc", "cyan": "#81ecec", "white": "#d3d0c8", "brightBlack": "#c4c2bb", "brightRed": "#ff7675", "brightGreen": "#badc58", "brightYellow": "#ffeaa7", "brightBlue": "#74b9ff", "brightPurple": "#cc99cc", "brightCyan": "#81ecec", "brightWhite": "#d3d0c8", "background": "#424242", "foreground": "#d3d0c8", "selectionBackground": "#74b9ff", "cursorColor": "#d3d0c8" }
49+
50+
Type "hclvet -h"
51+
52+
Enter
53+
54+
Sleep 500ms
55+
56+
Type "hclvet ruleset add github.com/clintjedwards/hclvet-ruleset-terraform-example"
57+
58+
Enter
59+
60+
Sleep 500ms
61+
62+
Type "hclvet ruleset list example"
63+
64+
Enter
65+
66+
Sleep 2.5s
67+
68+
Type "hclvet lint ~/Documents/hclvet/internal/testdata/*"
69+
70+
Enter
71+
72+
Sleep 4.5s
73+

go.mod

+45-23
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,58 @@
11
module github.com/clintjedwards/hclvet
22

3-
go 1.15
3+
go 1.19
44

55
require (
66
github.com/Masterminds/semver v1.5.0
7-
github.com/agext/levenshtein v1.2.3 // indirect
8-
github.com/clintjedwards/polyfmt v0.3.0
7+
github.com/clintjedwards/polyfmt v0.4.0
98
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible
109
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
11-
github.com/golang/protobuf v1.4.3 // indirect
12-
github.com/hashicorp/errwrap v1.1.0 // indirect
13-
github.com/hashicorp/go-getter/v2 v2.0.0-20200604122502-a6995fa1edad
14-
github.com/hashicorp/go-hclog v0.15.0
15-
github.com/hashicorp/go-plugin v1.4.0
16-
github.com/hashicorp/go-version v1.2.1 // indirect
17-
github.com/hashicorp/hcl/v2 v2.8.1
18-
github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect
10+
github.com/hashicorp/go-getter/v2 v2.1.0
11+
github.com/hashicorp/go-hclog v1.3.1
12+
github.com/hashicorp/go-plugin v1.4.5
13+
github.com/hashicorp/hcl/v2 v2.14.1
1914
github.com/kelseyhightower/envconfig v1.4.0
2015
github.com/mitchellh/go-homedir v1.1.0
16+
github.com/olekukonko/tablewriter v0.0.5
17+
github.com/otiai10/copy v1.7.0
18+
github.com/shirou/gopsutil/v3 v3.22.10
19+
github.com/spf13/cobra v1.6.1
20+
golang.org/x/text v0.4.0
21+
google.golang.org/grpc v1.50.1
22+
google.golang.org/protobuf v1.28.1
23+
)
24+
25+
require (
26+
github.com/agext/levenshtein v1.2.3 // indirect
27+
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
28+
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
29+
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
30+
github.com/fatih/color v1.13.0 // indirect
31+
github.com/go-ole/go-ole v1.2.6 // indirect
32+
github.com/golang/protobuf v1.5.2 // indirect
33+
github.com/google/go-cmp v0.5.9 // indirect
34+
github.com/hashicorp/errwrap v1.1.0 // indirect
35+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
36+
github.com/hashicorp/go-multierror v1.1.1 // indirect
37+
github.com/hashicorp/go-safetemp v1.0.0 // indirect
38+
github.com/hashicorp/go-version v1.6.0 // indirect
39+
github.com/hashicorp/yamux v0.1.1 // indirect
40+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
41+
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect
42+
github.com/mattn/go-colorable v0.1.13 // indirect
43+
github.com/mattn/go-isatty v0.0.16 // indirect
44+
github.com/mattn/go-runewidth v0.0.14 // indirect
2145
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
2246
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
2347
github.com/oklog/run v1.1.0 // indirect
24-
github.com/olekukonko/tablewriter v0.0.4
25-
github.com/otiai10/copy v1.4.1
26-
github.com/shirou/gopsutil/v3 v3.20.12
27-
github.com/spf13/cobra v1.1.1
28-
github.com/ulikunitz/xz v0.5.9 // indirect
29-
github.com/zclconf/go-cty v1.7.1 // indirect
30-
golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect
31-
golang.org/x/sys v0.0.0-20201223074533-0d417f636930 // indirect
32-
golang.org/x/text v0.3.4 // indirect
33-
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d // indirect
34-
google.golang.org/grpc v1.34.0
35-
google.golang.org/protobuf v1.25.0
48+
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
49+
github.com/rivo/uniseg v0.4.2 // indirect
50+
github.com/spf13/pflag v1.0.5 // indirect
51+
github.com/theckman/yacspin v0.13.12 // indirect
52+
github.com/ulikunitz/xz v0.5.10 // indirect
53+
github.com/yusufpapurcu/wmi v1.2.2 // indirect
54+
github.com/zclconf/go-cty v1.12.0 // indirect
55+
golang.org/x/net v0.1.0 // indirect
56+
golang.org/x/sys v0.1.0 // indirect
57+
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect
3658
)

0 commit comments

Comments
 (0)