Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement skipPaths option for 'license' policy #121

Merged
merged 1 commit into from
Apr 11, 2019

Conversation

smira
Copy link
Member

@smira smira commented Apr 10, 2019

This allows to skip directories which shouldn't be checked (e.g.
.git/) or directories which aren't readable.

While I was at it, bumped Go version, golangci-lint, refactored tests to
avoid duplicated code and make linter happy.

Rearranged a bit Dockerfile to avoid go mod download when go.mod
is not changed.

Signed-off-by: Andrey Smirnov [email protected]

@smira smira force-pushed the implement-skip-paths branch from 929a2b5 to e646c56 Compare April 10, 2019 21:26
smira added a commit to smira/talos that referenced this pull request Apr 10, 2019
This allows buildkitd cache to be reused when buildkitd container is
restarted. In CI, this directory could be shared between the builds to
speed them up.

Depends on new conform (siderolabs/conform#121)
to skip `.builkit/` directory as it contains root-owned files which are
not readable.

Signed-off-by: Andrey Smirnov <[email protected]>
@smira smira force-pushed the implement-skip-paths branch 15 times, most recently from dd6cf4b to 64e793c Compare April 11, 2019 20:28
@@ -3,7 +3,7 @@ policies:
spec:
headerLength: 89
dco: true
gpg: true
gpg: false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switched it off to make make enforce pass on the repo itself

@@ -19,30 +19,34 @@ build:
-t conform/$@:$(TAG) \
--target=$@ \
$(COMMON_ARGS)
@docker run --rm -it -v $(PWD)/build:/build conform/$@:$(TAG) cp /conform-linux-amd64 /build
@docker run --rm -it -v $(PWD)/build:/build conform/$@:$(TAG) cp /conform-darwin-amd64 /build
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-it shouldn't be there (breaks as there's no TTY in drone)


image: build
@docker build \
-t autonomy/conform:$(TAG) \
--target=$@ \
$(COMMON_ARGS)

.PHONY: login
login:
@docker login --username $(DOCKER_USERNAME) --password $(DOCKER_PASSWORD)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to hide docker creds

push: image
@docker tag autonomy/conform:$(TAG) autonomy/conform:latest
@docker push autonomy/conform:$(TAG)
@docker push autonomy/conform:latest

deps:
@GO111MODULES=on CGO_ENABLED=0 go get -u github.com/autonomy/gitmeta
@GO111MODULES=on CGO_ENABLED=0 go get -u github.com/autonomy/conform
@GO111MODULE=on CGO_ENABLED=0 go get -u github.com/autonomy/gitmeta
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in variable

report.Errors = append(report.Errors, errors.Errorf("failed to get commit message: %v", err))
return
}
} else if msg, err = g.Message(); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linter thinks it's better, I don't quite agree...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

This allows to skip directories which shouldn't be checked (e.g.
`.git/`) or directories which aren't readable.

While I was at it, bumped Go version, golangci-lint, refactored tests to
avoid duplicated code and make linter happy.

Rearranged a bit `Dockerfile` to avoid `go mod download` when `go.mod`
is not changed.

Signed-off-by: Andrey Smirnov <[email protected]>
@smira smira force-pushed the implement-skip-paths branch from 64e793c to 30b2a41 Compare April 11, 2019 20:36
Copy link
Member

@andrewrynhard andrewrynhard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andrewrynhard andrewrynhard merged commit ebed4b3 into siderolabs:master Apr 11, 2019
smira added a commit to smira/talos that referenced this pull request Apr 12, 2019
This allows buildkitd cache to be reused when buildkitd container is
restarted. In CI, this directory could be shared between the builds to
speed them up.

Depends on new conform (siderolabs/conform#121)
to skip `.builkit/` directory as it contains root-owned files which are
not readable.

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this pull request Apr 12, 2019
This allows buildkitd cache to be reused when buildkitd container is
restarted. In CI, this directory could be shared between the builds to
speed them up.

Depends on new conform (siderolabs/conform#121)
to skip `.builkit/` directory as it contains root-owned files which are
not readable.

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this pull request Apr 12, 2019
This allows buildkitd cache to be reused when buildkitd container is
restarted. In CI, this directory could be shared between the builds to
speed them up.

Depends on new conform (siderolabs/conform#121)
to skip `.builkit/` directory as it contains root-owned files which are
not readable.

Signed-off-by: Andrey Smirnov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants