mirror of
https://github.com/renovatebot/renovate.git
synced 2025-03-16 00:54:53 +00:00
fix(yaml): parse without strict mode (#32264)
This commit is contained in:
parent
cd192d7118
commit
6fc20b8420
2 changed files with 15 additions and 0 deletions
lib/util
|
@ -209,6 +209,20 @@ describe('util/yaml', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should parse invalid content using strict=false', () => {
|
||||
expect(
|
||||
parseSingleYaml(codeBlock`
|
||||
version: '2.1'
|
||||
|
||||
services:
|
||||
rtl_433:
|
||||
image: ubuntu:oracular-20240918
|
||||
# inserting a space before the hash on the next line makes Renovate work.
|
||||
command: "echo some text"# a comment
|
||||
`),
|
||||
).not.toBeNull();
|
||||
});
|
||||
|
||||
it('should parse content with single document with schema', () => {
|
||||
expect(
|
||||
parseSingleYaml(
|
||||
|
|
|
@ -158,6 +158,7 @@ function prepareParseOption(options: YamlOptions | undefined): YamlOptions {
|
|||
prettyErrors: true,
|
||||
// if we're removing templates, we can run into the situation where we have duplicate keys
|
||||
uniqueKeys: !options?.removeTemplates,
|
||||
strict: false,
|
||||
...options,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue