build: commit generated code files (#449)

* build: commit generated code files

Keeping these files in the repository will help with vendoring
and should make the package "go get"-able.

* build: ignore generated files in code coverage

* build: add "make validate-generated" target

This should ensure go-bindata files are kept up to date.

* fix: replace script with simpler git commands

* fix: revise git diff command for generated file check
This commit is contained in:
Matt Boersma 2019-02-08 13:24:17 -07:00 коммит произвёл Tariq Ibrahim
Родитель 8ffcc1267d
Коммит 25915938f2
10 изменённых файлов: 4461 добавлений и 8 удалений

Просмотреть файл

@ -6,7 +6,6 @@ coverage:
precision: 2 precision: 2
round: down round: down
range: "50...100" range: "50...100"
status: status:
project: project:
default: default:
@ -27,4 +26,7 @@ parsers:
comment: comment:
layout: "header, diff" layout: "header, diff"
behavior: default behavior: default
require_changes: no require_changes: no
ignore:
- "**/*_generated.go"

3
.gitignore поставляемый
Просмотреть файл

@ -13,13 +13,12 @@ _dist/
bin/ bin/
.env .env
.coverprofile .coverprofile
coverage.txt
test/junit/ test/junit/
test/aks-engine-test/aks-engine-test.exe test/aks-engine-test/aks-engine-test.exe
pkg/operations/junit.xml pkg/operations/junit.xml
pkg/operations/kubernetesupgrade/junit.xml pkg/operations/kubernetesupgrade/junit.xml
pkg/engine/templates.go
pkg/i18n/translations.go
_logs/ _logs/
test/aks-engine-test/report/TestReport.json test/aks-engine-test/report/TestReport.json

Просмотреть файл

@ -52,6 +52,9 @@ jobs:
- script: make validate-copyright-headers test-style - script: make validate-copyright-headers test-style
displayName: Run linting rules displayName: Run linting rules
workingDirectory: $(modulePath) workingDirectory: $(modulePath)
- script: make validate-generated
displayName: Check if generated code is up to date
workingDirectory: $(modulePath)
- script: make validate-dependencies - script: make validate-dependencies
displayName: Check if imports, Gopkg.toml, and Gopkg.lock are in sync displayName: Check if imports, Gopkg.toml, and Gopkg.lock are in sync
workingDirectory: $(modulePath) workingDirectory: $(modulePath)

Просмотреть файл

@ -125,6 +125,11 @@ test: generate
test-style: test-style:
@scripts/validate-go.sh @scripts/validate-go.sh
.PHONY: validate-generated
validate-generated: generate
@echo "==> Checking generated files <=="
! git diff --name-only pkg/ | grep _generated.go
.PHONY: test-e2e .PHONY: test-e2e
test-e2e: test-e2e:
@test/e2e.sh @test/e2e.sh

Просмотреть файл

@ -3,7 +3,7 @@
package engine package engine
//go:generate go-bindata -nometadata -pkg $GOPACKAGE -prefix ../../parts/ -o templates.go ../../parts/... //go:generate go-bindata -nometadata -pkg $GOPACKAGE -prefix ../../parts/ -o templates_generated.go ../../parts/...
//go:generate gofmt -s -l -w templates.go //go:generate gofmt -s -l -w templates_generated.go
// fileloader use go-bindata (https://github.com/go-bindata/go-bindata) // fileloader use go-bindata (https://github.com/go-bindata/go-bindata)
// go-bindata is the way we handle embedded files, like binary, template, etc. // go-bindata is the way we handle embedded files, like binary, template, etc.

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -3,7 +3,7 @@
package i18n package i18n
//go:generate go-bindata -nometadata -pkg $GOPACKAGE -prefix ../../ -o translations.go ../../translations/... //go:generate go-bindata -nometadata -pkg $GOPACKAGE -prefix ../../ -o translations_generated.go ../../translations/...
//go:generate gofmt -s -l -w translations.go //go:generate gofmt -s -l -w translations_generated.go
// resourceloader use go-bindata (https://github.com/go-bindata/go-bindata) // resourceloader use go-bindata (https://github.com/go-bindata/go-bindata)
// go-bindata is the way we handle embedded files, like binary, template, etc. // go-bindata is the way we handle embedded files, like binary, template, etc.

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

0
scripts/convert-lcg-lcl.sh Normal file → Executable file
Просмотреть файл

0
scripts/update-enus-po.sh Normal file → Executable file
Просмотреть файл