Skip to content

Commit ef8eda7

Browse files
author
sylviamoss
committed
Clean up and add multi-component configuration
1 parent 51d4f7b commit ef8eda7

37 files changed

+174
-1156
lines changed

.golangci.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
issues:
2+
# List of regexps of issue texts to exclude, empty list by default.
3+
# But independently from this option we use default exclude patterns,
4+
# it can be disabled by `exclude-use-default: false`. To list all
5+
# excluded by default patterns execute `golangci-lint run --help`
6+
7+
exclude-rules:
8+
# Exclude gosimple bool check
9+
- linters:
10+
- gosimple
11+
text: "S(1002|1008|1021)"
12+
# Exclude failing staticchecks for now
13+
- linters:
14+
- staticcheck
15+
text: "SA(1006|1019|4006|4010|4017|5007|6005|9004):"
16+
# Exclude lll issues for long lines with go:generate
17+
- linters:
18+
- lll
19+
source: "^//go:generate "
20+
21+
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
22+
max-issues-per-linter: 0
23+
24+
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
25+
max-same-issues: 0
26+
27+
linters:
28+
disable-all: true
29+
enable:
30+
- deadcode
31+
- errcheck
32+
- goimports
33+
- gosimple
34+
- govet
35+
- ineffassign
36+
- staticcheck
37+
- unconvert
38+
- unused
39+
- varcheck
40+
fast: true
41+
42+
# options for analysis running
43+
run:
44+
# default concurrency is a available CPU number
45+
concurrency: 4
46+
47+
# timeout for analysis, e.g. 30s, 5m, default is 1m
48+
timeout: 10m
49+
50+
# exit code when at least one issue was found, default is 1
51+
issues-exit-code: 1
52+
53+
# include test files or not, default is true
54+
tests: true
55+
56+
# list of build tags, all linters use it. Default is empty list.
57+
#build-tags:
58+
# - mytag
59+
60+
# which dirs to skip: issues from them won't be reported;
61+
# can use regexp here: generated.*, regexp is applied on full path;
62+
# default value is empty list, but default dirs are skipped independently
63+
# from this option's value (see skip-dirs-use-default).
64+
#skip-dirs:
65+
# - src/external_libs
66+
# - autogenerated_by_my_lib
67+
68+
# default is true. Enables skipping of directories:
69+
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
70+
skip-dirs-use-default: true
71+
72+
# which files to skip: they will be analyzed, but issues from them
73+
# won't be reported. Default value is empty list, but there is
74+
# no need to include all autogenerated files, we confidently recognize
75+
# autogenerated files. If it's not please let us know.
76+
skip-files:
77+
- ".*\\.hcl2spec\\.go$"
78+
# - lib/bad.go
79+
80+
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
81+
# If invoked with -mod=readonly, the go command is disallowed from the implicit
82+
# automatic updating of go.mod described above. Instead, it fails when any changes
83+
# to go.mod are needed. This setting is most useful to check that go.mod does
84+
# not need updates, such as in a continuous integration and testing system.
85+
# If invoked with -mod=vendor, the go command assumes that the vendor
86+
# directory holds the correct copies of dependencies and ignores
87+
# the dependency descriptions in go.mod.
88+
# modules-download-mode: vendor
89+
90+
91+
# output configuration options
92+
output:
93+
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
94+
format: colored-line-number
95+
96+
# print lines of code with issue, default is true
97+
print-issued-lines: true
98+
99+
# print linter name in the end of issue text, default is true
100+
print-linter-name: true
101+
102+
# make issues output unique by line, default is true
103+
uniq-by-line: true
104+
105+
106+
# all available settings of specific linters
107+
linters-settings:
108+
errcheck:
109+
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
110+
# default is false: such cases aren't reported by default.
111+
check-type-assertions: false
112+
113+
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
114+
# default is false: such cases aren't reported by default.
115+
check-blank: false
116+
117+
# [deprecated] comma-separated list of pairs of the form pkg:regex
118+
# the regex is used to ignore names within pkg. (default "fmt:.*").
119+
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
120+
ignore: fmt:.*,io/ioutil:^Read.*,io:Close
121+
122+
# path to a file containing a list of functions to exclude from checking
123+
# see https://github.com/kisielk/errcheck#excluding-functions for details
124+
#exclude: /path/to/file.txt

.goreleaser.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ before:
99
- go test ./...
1010
# As part of the release doc files are included as a separate deliverable for
1111
# consumption by Packer.io. To include a separate docs.zip uncomment the following command.
12-
#- /bin/sh -c "[ -d docs ] && zip -r docs.zip docs/"
12+
- make ci-release-docs
1313
builds:
1414
# A separated build to run the packer-plugins-check only once for a linux_amd64 binary
1515
-
@@ -78,8 +78,8 @@ release:
7878
# draft: true
7979
# As part of the release doc files are included as a separate deliverable for consumption by Packer.io.
8080
# To include a separate docs.zip uncomment the extra_files config and the docs.zip command hook above.
81-
#extra_files:
82-
#- glob: ./docs.zip
81+
extra_files:
82+
- glob: ./docs.zip
8383

8484
changelog:
8585
skip: true

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1 (April 21, 2021)
2+
3+
* UCloud Plugin break out from Packer core. Changes prior to break out can be found in [Packer's CHANGELOG](https://github.com/hashicorp/packer/blob/master/CHANGELOG.md).

GNUmakefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
NAME=scaffolding
1+
NAME=ucloud
22
BINARY=packer-plugin-${NAME}
33

44
COUNT?=1
@@ -9,6 +9,15 @@ TEST?=$(shell go list ./...)
99
build:
1010
@go build -o ${BINARY}
1111

12+
generate:
13+
@go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@latest
14+
@go generate -v ./...
15+
16+
ci-release-docs:
17+
@go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@latest
18+
@packer-sdc renderdocs -src docs -partials docs-partials/ -dst docs/
19+
@/bin/sh -c "[ -d docs ] && zip -r docs.zip docs/"
20+
1221
dev: build
1322
@mkdir -p ~/.packer.d/plugins/
1423
@mv ${BINARY} ~/.packer.d/plugins/${BINARY}

builder/scaffolding/artifact.go

Lines changed: 0 additions & 32 deletions
This file was deleted.

builder/scaffolding/builder.go

Lines changed: 0 additions & 80 deletions
This file was deleted.

builder/scaffolding/builder.hcl2spec.go

Lines changed: 0 additions & 46 deletions
This file was deleted.

builder/scaffolding/builder_acc_test.go

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)