You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
init -o - prints the config to stdout.init could only write a
file, so from the Docker image it needed a writable mount and --user. compose-lint init FILE -o - prints the config and writes nothing, and
stdout carries only the config: the status line, notes, warnings and errors
stay on stderr, as they do for check --format json and the fix diff. So init FILE -o - > .compose-lint.yml leaves the file init would have
written, and it works with a read-only mount. --force is ignored with -o -, and a file with no findings prints nothing and exits 0. ADR-011 is
amended (#1417).
init with no file named uses the Compose file in the current
directory.compose-lint init was a usage error, while compose-lint
alone finds the file. init now looks where check looks: the current
directory, for the four standard names or for the list a COMPOSE_FILE in
the .env selects, and a note says which file it used. When two or more
standard-named files are present it exits 2 and asks for one by name,
because check grades each of them and init writes one config for one
project. It also exits 2 when a COMPOSE_FILE list starts with a file in
another directory, since the config is written beside the first file and
none was named. It does not search parent directories. check is
unchanged. ADR-011 is amended
(#1418).
Changed
The two changes 1.9.1 announced for 1.10.0 are enforced in 1.11.0
instead. 1.9.1 began warning about a .env or an override that is a
named pipe, and about a config that is a link leading nowhere, and said
1.10.0 would turn the first into a coverage gap and the second into an
error. Both stay warnings in this release, so they are out for a full
release before any exit code changes, and the warnings now name 1.11.0.
Nothing that passes today fails sooner than 1.9.1 said it would
(#1424).
The CLI reference says how to run the Docker image when it has to write,
or read above the project.fix --apply, init and check --output
stop with Permission denied under the README's docker run form, because
the image runs as UID 65532 and the mounted directory belongs to you. A
project whose extends: or include: names ../shared/... stops because
only its own directory was mounted. Both exit 2 with a message, and neither
was documented. The new Running from the Docker image
section gives the --user form for writes and the repository-root mount
with -w for the second case. The Docker Hub overview links to it.
-o - is stdout, for init and for check, and no longer a file named -. Both wrote that file before this release. init -o - prints the
config, as above. check --output - prints the report, the same as leaving --output out, so the two subcommands agree on what - means. Name the
file as -o ./-.
init escapes what a terminal or a CI log would act on in a service
name. The config can now be printed, so a name in it gets what the other
stdout surfaces get. A character that reorders or hides text, U+202E for
example, was written as it was and is now a YAML escape. The bracket of a
CI log command opener, ##[ or ##vso[, is written as an escape as well,
as it is in --format json. Both reload as the same name, and other names
are written as before.
Fixed
init no longer writes a config check cannot read when a service name
is very long. PyYAML reads a mapping key written on one line only up to
1,024 characters, and init wrote every name that way. A name past that
length, or a shorter one of characters YAML writes as long escapes, gave a
config that check refused with Invalid YAML in config file (exit 2),
after init had reported success. Such a name is now written in YAML's
explicit ? key form, which has no limit.