Skip to content

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

Merged
andrewrynhard merged 1 commit into
siderolabs:masterfrom
smira:implement-skip-paths
Apr 11, 2019
Merged

andrewrynhard merged 1 commit into
siderolabs:masterfrom
smira:implement-skip-paths

Conversation

@smira

@smira smira commented Apr 10, 2019

Copy link
Copy Markdown
Member

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
Comment thread .conform.yaml
headerLength: 89
dco: true
gpg: true
gpg: false

Copy link
Copy Markdown
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

Comment thread Makefile
--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
Copy Markdown
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)

Comment thread Makefile

.PHONY: login
login:
@docker login --username $(DOCKER_USERNAME) --password $(DOCKER_PASSWORD)

Copy link
Copy Markdown
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

Comment thread Makefile
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@andrewrynhard andrewrynhard left a comment

Copy link
Copy Markdown
Contributor

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