mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
Trim whitespace from unit files while parsing
Fixes: https://github.com/containers/podman/issues/18979 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
384638861b
commit
bc5269f187
4 changed files with 5 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue