Skip to content

Commit 52bc539

Browse files
committed
Prepare 1.1.2.
1 parent 0688891 commit 52bc539

File tree

5 files changed

+56
-20
lines changed

5 files changed

+56
-20
lines changed

changelogs/fragments/1.1.2.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
release_summary: Bugfix release.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "antsibull-docs",
3-
"version": "1.1.1-post0",
3+
"version": "1.1.2",
44
"description": "TypeScript library for processing Ansible documentation markup",
55
"main": "dist/cjs/index.js",
66
"module": "dist/esm/index.js",

src/parser.spec.ts

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ describe('parser', (): void => {
131131
{ type: PartType.TEXT, text: 'foo ', source: undefined },
132132
{ type: PartType.ENV_VARIABLE, name: 'a),b', source: undefined },
133133
{ type: PartType.TEXT, text: ' ', source: undefined },
134-
{ type: PartType.PLUGIN, plugin: { fqcn: 'foo.bar.baz', type: 'bam' }, entrypoint: undefined, source: undefined },
134+
{
135+
type: PartType.PLUGIN,
136+
plugin: { fqcn: 'foo.bar.baz', type: 'bam' },
137+
entrypoint: undefined,
138+
source: undefined,
139+
},
135140
{ type: PartType.TEXT, text: ' baz ', source: undefined },
136141
{ type: PartType.OPTION_VALUE, value: ' b,na)\\m, ', source: undefined },
137142
{ type: PartType.TEXT, text: ' ', source: undefined },
@@ -149,9 +154,19 @@ describe('parser', (): void => {
149154
]);
150155
expect(parse('P(foo.bar.baz#role) P(foo.bar.baz#role:entrypoint)')).toEqual([
151156
[
152-
{ type: PartType.PLUGIN, plugin: { fqcn: 'foo.bar.baz', type: 'role' }, entrypoint: undefined, source: undefined },
157+
{
158+
type: PartType.PLUGIN,
159+
plugin: { fqcn: 'foo.bar.baz', type: 'role' },
160+
entrypoint: undefined,
161+
source: undefined,
162+
},
153163
{ type: PartType.TEXT, text: ' ', source: undefined },
154-
{ type: PartType.PLUGIN, plugin: { fqcn: 'foo.bar.baz', type: 'role' }, entrypoint: 'entrypoint', source: undefined },
164+
{
165+
type: PartType.PLUGIN,
166+
plugin: { fqcn: 'foo.bar.baz', type: 'role' },
167+
entrypoint: 'entrypoint',
168+
source: undefined,
169+
},
155170
],
156171
]);
157172
});
@@ -162,7 +177,12 @@ describe('parser', (): void => {
162177
{ type: PartType.TEXT, text: 'foo ', source: 'foo ' },
163178
{ type: PartType.ENV_VARIABLE, name: 'a),b', source: 'E(a\\),b)' },
164179
{ type: PartType.TEXT, text: ' ', source: ' ' },
165-
{ type: PartType.PLUGIN, plugin: { fqcn: 'foo.bar.baz', type: 'bam' }, entrypoint: undefined, source: 'P(foo.bar.baz#bam)' },
180+
{
181+
type: PartType.PLUGIN,
182+
plugin: { fqcn: 'foo.bar.baz', type: 'bam' },
183+
entrypoint: undefined,
184+
source: 'P(foo.bar.baz#bam)',
185+
},
166186
{ type: PartType.TEXT, text: ' baz ', source: ' baz ' },
167187
{ type: PartType.OPTION_VALUE, value: ' b,na)\\m, ', source: 'V( b\\,\\na\\)\\\\m\\, )' },
168188
{ type: PartType.TEXT, text: ' ', source: ' ' },
@@ -181,9 +201,19 @@ describe('parser', (): void => {
181201
);
182202
expect(parse('P(foo.bar.baz#role) P(foo.bar.baz#role:entrypoint)')).toEqual([
183203
[
184-
{ type: PartType.PLUGIN, plugin: { fqcn: 'foo.bar.baz', type: 'role' }, entrypoint: undefined, source: undefined },
204+
{
205+
type: PartType.PLUGIN,
206+
plugin: { fqcn: 'foo.bar.baz', type: 'role' },
207+
entrypoint: undefined,
208+
source: undefined,
209+
},
185210
{ type: PartType.TEXT, text: ' ', source: undefined },
186-
{ type: PartType.PLUGIN, plugin: { fqcn: 'foo.bar.baz', type: 'role' }, entrypoint: 'entrypoint', source: undefined },
211+
{
212+
type: PartType.PLUGIN,
213+
plugin: { fqcn: 'foo.bar.baz', type: 'role' },
214+
entrypoint: 'entrypoint',
215+
source: undefined,
216+
},
187217
],
188218
]);
189219
});
@@ -446,12 +476,12 @@ describe('parser', (): void => {
446476
expect(async () => parse('P(foo.bar.baz#b m)', { errors: 'exception', helpfulErrors: false })).rejects.toThrow(
447477
'While parsing P() at index 1: Plugin type "b m" is not valid',
448478
);
449-
expect(async () => parse('P(foo.bar.baz#module:e p)', { errors: 'exception', helpfulErrors: false })).rejects.toThrow(
450-
'While parsing P() at index 1: Entrypoint "e p" is not valid',
451-
);
452-
expect(async () => parse('P(foo.bar.baz#module:entrypoint)', { errors: 'exception', helpfulErrors: false })).rejects.toThrow(
453-
'While parsing P() at index 1: Only role references can have entrypoints',
454-
);
479+
expect(async () =>
480+
parse('P(foo.bar.baz#module:e p)', { errors: 'exception', helpfulErrors: false }),
481+
).rejects.toThrow('While parsing P() at index 1: Entrypoint "e p" is not valid');
482+
expect(async () =>
483+
parse('P(foo.bar.baz#module:entrypoint)', { errors: 'exception', helpfulErrors: false }),
484+
).rejects.toThrow('While parsing P() at index 1: Only role references can have entrypoints');
455485
});
456486
it('bad option name/return value (throw error)', (): void => {
457487
expect(async () =>
@@ -466,9 +496,9 @@ describe('parser', (): void => {
466496
expect(async () => parse('O(foo.bar.baz#role:bam)', { errors: 'exception', helpfulErrors: false })).rejects.toThrow(
467497
'While parsing O() at index 1: Role reference is missing entrypoint',
468498
);
469-
expect(async () => parse('O(foo.bar.baz#role:e p:bam)', { errors: 'exception', helpfulErrors: false })).rejects.toThrow(
470-
'While parsing O() at index 1: Entrypoint "e p" is not valid',
471-
);
499+
expect(async () =>
500+
parse('O(foo.bar.baz#role:e p:bam)', { errors: 'exception', helpfulErrors: false }),
501+
).rejects.toThrow('While parsing O() at index 1: Entrypoint "e p" is not valid');
472502
});
473503
it('bad parameter parsing (no escaping, error message)', (): void => {
474504
expect(parse('M(', { helpfulErrors: false })).toEqual([

src/parser.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,14 @@ const PARSER: CommandParserEx[] = [
275275
throw Error(`Plugin type ${repr(type)} is not valid`);
276276
}
277277
if (entrypoint && type !== 'role') {
278-
throw Error('Only role references can have entrypoints')
278+
throw Error('Only role references can have entrypoints');
279279
}
280-
return <PluginPart>{ type: PartType.PLUGIN, plugin: { fqcn: fqcn, type: type }, entrypoint: entrypoint, source: source };
280+
return <PluginPart>{
281+
type: PartType.PLUGIN,
282+
plugin: { fqcn: fqcn, type: type },
283+
entrypoint: entrypoint,
284+
source: source,
285+
};
281286
},
282287
},
283288
{

0 commit comments

Comments
 (0)