Skip to content

Commit 7ed3fe3

Browse files
authored
Merge pull request #220 from cfengine/pr-syntax-description-update-with-tests
Updated syntax-description.json and lint tests for new syntax elements
2 parents 59c539f + ea2f86f commit 7ed3fe3

3 files changed

Lines changed: 43 additions & 1 deletion

File tree

‎src/cfengine_cli/syntax-description.json‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,13 @@
525525
"type": "option",
526526
"visibility": "body"
527527
},
528+
"silence": {
529+
"attribute": "silence",
530+
"range": "content|add|remove|owner|group|perms|device|mtime|inode|stats|all",
531+
"status": "normal",
532+
"type": "slist",
533+
"visibility": "body"
534+
},
528535
"update_hashes": {
529536
"attribute": "update_hashes",
530537
"range": "true,false,yes,no,on,off",
@@ -3357,6 +3364,17 @@
33573364
],
33583365
"status": "normal"
33593366
},
3367+
"reactor": {
3368+
"promiseTypes": [
3369+
"events",
3370+
"classes",
3371+
"defaults",
3372+
"meta",
3373+
"reports",
3374+
"vars"
3375+
],
3376+
"status": "normal"
3377+
},
33603378
"server": {
33613379
"promiseTypes": [
33623380
"access",
@@ -6976,6 +6994,17 @@
69766994
"status": "normal",
69776995
"variadic": false
69786996
},
6997+
"strtotime": {
6998+
"cached": false,
6999+
"category": "data",
7000+
"collecting": false,
7001+
"parameters": [
7002+
{ "description": "String to parse", "range": ".*", "type": "string" }
7003+
],
7004+
"returnType": "int",
7005+
"status": "normal",
7006+
"variadic": false
7007+
},
69797008
"sublist": {
69807009
"cached": false,
69817010
"category": "data",

‎tests/lint/004_block_type.expected.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
bundle notavalidtype my_bundle
33
^-----------^
4-
Error: Bundle type must be one of (agent, common, edit_line, edit_xml, monitor, server, watch), not 'notavalidtype' at tests/lint/004_block_type.x.cf:1:8
4+
Error: Bundle type must be one of (agent, common, edit_line, edit_xml, monitor, reactor, server, watch), not 'notavalidtype' at tests/lint/004_block_type.x.cf:1:8
55

66

77
promise server my_promise_type
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
body changes my_changes
2+
{
3+
silence => { "mtime", "content" };
4+
}
5+
6+
bundle reactor my_reactor
7+
{
8+
vars:
9+
"timestamp" int => strtotime("2026-08-26");
10+
11+
reports:
12+
"Parsed timestamp => $(timestamp)";
13+
}

0 commit comments

Comments
 (0)