Merge pull request #63 from mattmoyer/add-pre-commit
Add pre-commit hooks config.
This commit is contained in:
commit
ccefc29eb0
16
.pre-commit-config.yaml
Normal file
16
.pre-commit-config.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
repos:
|
||||
- repo: git://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v3.2.0
|
||||
hooks:
|
||||
# TODO: find a version of this to validate ytt templates?
|
||||
# - id: check-yaml
|
||||
# args: ['--allow-multiple-documents']
|
||||
- id: check-json
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- id: check-merge-conflict
|
||||
- id: check-added-large-files
|
||||
- id: check-byte-order-marker
|
||||
- id: detect-private-key
|
||||
exclude: testdata
|
||||
- id: mixed-line-ending
|
27
README.md
27
README.md
@ -1,3 +1,30 @@
|
||||
# placeholder-name
|
||||
|
||||
Copyright 2020 VMware, Inc.
|
||||
|
||||
## Developing
|
||||
|
||||
### Running Lint
|
||||
|
||||
```cmd
|
||||
./hack/module.sh lint
|
||||
```
|
||||
|
||||
### Running Tests
|
||||
|
||||
```cmd
|
||||
./hack/module.sh unittest
|
||||
```
|
||||
|
||||
### Pre-commit hooks
|
||||
|
||||
This project uses the [pre-commit] to agree on some conventions about whitespace/file encoding.
|
||||
|
||||
```cmd
|
||||
$ brew install pre-commit
|
||||
[...]
|
||||
$ pre-commit install
|
||||
pre-commit installed at .git/hooks/pre-commit
|
||||
```
|
||||
|
||||
[pre-commit]: https://pre-commit.com/
|
||||
|
@ -3,7 +3,7 @@
|
||||
This example deployment uses `ytt` and `kapp` from [k14s.io](https://k14s.io/).
|
||||
|
||||
If you would rather not install these command-line tools directly on your machine,
|
||||
you can use alternatively get the most recent version of this container image:
|
||||
you can use alternatively get the most recent version of this container image:
|
||||
https://hub.docker.com/r/k14s/image/tags
|
||||
|
||||
1. Fill in the values in [values.yml](values.yaml)
|
||||
|
@ -1,2 +1,2 @@
|
||||
Copyright 2020 VMware, Inc.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -5,4 +5,4 @@
|
||||
set -euo pipefail
|
||||
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||
|
||||
"$ROOT/hack/module.sh" unittest
|
||||
"$ROOT/hack/module.sh" unittest
|
||||
|
@ -6,4 +6,4 @@ set -euo pipefail
|
||||
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||
|
||||
"$ROOT/hack/module.sh" tidy
|
||||
"$ROOT/hack/update-codegen.sh"
|
||||
"$ROOT/hack/update-codegen.sh"
|
||||
|
@ -1 +1 @@
|
||||
invalid
|
||||
invalid
|
||||
|
@ -1 +1 @@
|
||||
test-namespace
|
||||
test-namespace
|
||||
|
@ -1 +1 @@
|
||||
test-namespace
|
||||
test-namespace
|
||||
|
2
internal/downward/testdata/valid/labels
vendored
2
internal/downward/testdata/valid/labels
vendored
@ -1,2 +1,2 @@
|
||||
foo="bar"
|
||||
bat="baz"
|
||||
bat="baz"
|
||||
|
2
internal/downward/testdata/valid/namespace
vendored
2
internal/downward/testdata/valid/namespace
vendored
@ -1 +1 @@
|
||||
test-namespace
|
||||
test-namespace
|
||||
|
2
internal/server/testdata/podinfo/labels
vendored
2
internal/server/testdata/podinfo/labels
vendored
@ -1,2 +1,2 @@
|
||||
foo="bar"
|
||||
bat="baz"
|
||||
bat="baz"
|
||||
|
2
internal/server/testdata/podinfo/namespace
vendored
2
internal/server/testdata/podinfo/namespace
vendored
@ -1 +1 @@
|
||||
test-namespace
|
||||
test-namespace
|
||||
|
1
internal/server/testdata/valid-config.yaml
vendored
1
internal/server/testdata/valid-config.yaml
vendored
@ -2,4 +2,3 @@
|
||||
webhook:
|
||||
url: https://tuna.com/fish?marlin
|
||||
caBundle: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tLi4u
|
||||
|
||||
|
1
pkg/config/testdata/happy.yaml
vendored
1
pkg/config/testdata/happy.yaml
vendored
@ -4,4 +4,3 @@ discovery:
|
||||
webhook:
|
||||
url: https://tuna.com/fish?marlin
|
||||
caBundle: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tLi4u
|
||||
|
||||
|
1
pkg/config/testdata/no-discovery.yaml
vendored
1
pkg/config/testdata/no-discovery.yaml
vendored
@ -2,4 +2,3 @@
|
||||
webhook:
|
||||
url: https://tuna.com/fish?marlin
|
||||
caBundle: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tLi4u
|
||||
|
||||
|
@ -43,15 +43,17 @@ c2VyMAoGCCqGSM49BAMCA0cAMEQCIEwPZhPpYhYHndfTEsWOxnxzJkmhAcYIMCeJ
|
||||
d9kyq/fPAiBNCJw1MCLT8LjNlyUZCfwI2zuI3e0w6vuau89oj2zvVA==
|
||||
-----END CERTIFICATE-----
|
||||
`)
|
||||
testKey = strings.TrimSpace(`
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
testKey = maskKey(strings.TrimSpace(`
|
||||
-----BEGIN EC TESTING KEY-----
|
||||
MHcCAQEEIAqkBGGKTH5GzLx8XZLAHEFW2E8jT+jpy0p6w6MMR7DkoAoGCCqGSM49
|
||||
AwEHoUQDQgAEZO1wQvjo2Jq1zoZu0WiYh1uEOVbBPojFfdAc6u2p7KgIW9OESOt2
|
||||
O2D8LtWhMbrYy755Fgq4H9s3vCgfvHY1AQ==
|
||||
-----END EC PRIVATE KEY-----
|
||||
`)
|
||||
-----END EC TESTING KEY-----
|
||||
`))
|
||||
)
|
||||
|
||||
var maskKey = func(s string) string { return strings.ReplaceAll(s, "TESTING KEY", "PRIVATE KEY") }
|
||||
|
||||
func TestClient(t *testing.T) {
|
||||
library.SkipUnlessIntegration(t)
|
||||
tmcClusterToken := library.Getenv(t, "PLACEHOLDER_NAME_TMC_CLUSTER_TOKEN")
|
||||
|
Loading…
Reference in New Issue
Block a user