mirror of
https://github.com/containers/podman.git
synced 2025-06-19 00:06:43 +08:00
Merge pull request #18981 from rhatdan/quadlet
Trim whitespace from unit files while parsing
This commit is contained in:
@ -12,7 +12,7 @@ repos:
|
||||
- id: end-of-file-fixer
|
||||
exclude: test/buildah-bud/buildah-tests.diff
|
||||
- id: trailing-whitespace
|
||||
exclude: test/buildah-bud/buildah-tests.diff
|
||||
exclude: test/buildah-bud/buildah-tests.diff|test/e2e/quadlet/remap-keep-id2.container
|
||||
- id: mixed-line-ending
|
||||
- id: check-byte-order-marker
|
||||
- id: check-executables-have-shebangs
|
||||
|
2
Makefile
2
Makefile
@ -253,7 +253,7 @@ help: ## (Default) Print listing of key targets with their descriptions
|
||||
.PHONY: .gitvalidation
|
||||
.gitvalidation:
|
||||
@echo "Validating vs commit '$(call err_if_empty,EPOCH_TEST_COMMIT)'"
|
||||
GIT_CHECK_EXCLUDE="./vendor:./test/tools/vendor:docs/make.bat:test/buildah-bud/buildah-tests.diff" ./test/tools/build/git-validation -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..$(HEAD)
|
||||
GIT_CHECK_EXCLUDE="./vendor:./test/tools/vendor:docs/make.bat:test/buildah-bud/buildah-tests.diff:test/e2e/quadlet/remap-keep-id2.container" ./test/tools/build/git-validation -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..$(HEAD)
|
||||
|
||||
.PHONY: lint
|
||||
lint: golangci-lint
|
||||
|
@ -373,7 +373,7 @@ func (p *UnitFileParser) flushPendingComments(toComment bool) {
|
||||
func nextLine(data string, afterPos int) (string, string) {
|
||||
rest := data[afterPos:]
|
||||
if i := strings.Index(rest, "\n"); i >= 0 {
|
||||
return data[:i+afterPos], data[i+afterPos+1:]
|
||||
return strings.TrimSpace(data[:i+afterPos]), data[i+afterPos+1:]
|
||||
}
|
||||
return data, ""
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
RemapUsers=keep-id
|
||||
# The added three spaces to keep-id are necessary for test of trimwhitespace
|
||||
RemapUsers=keep-id
|
||||
RemapUid=200
|
||||
RemapGid=210
|
||||
|
Reference in New Issue
Block a user