@nitra/cursor 1.11.4 → 1.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/bin/n-cursor.js +37 -4
  3. package/package.json +2 -1
  4. package/rules/abie/utils/http-route.mjs +1 -1
  5. package/rules/abie/utils/k8s-tree.mjs +9 -10
  6. package/rules/abie/utils/overlay-paths.mjs +1 -1
  7. package/rules/adr/adr.mdc +2 -2
  8. package/rules/adr/js/hooks/check.mjs +5 -5
  9. package/rules/docker/docker.mdc +2 -2
  10. package/rules/docker/js/run.mjs +3 -2
  11. package/rules/docker/policy/package_json/package_json.rego +1 -1
  12. package/rules/ga/js/lint.mjs +3 -26
  13. package/rules/k8s/js/run.mjs +3 -2
  14. package/rules/k8s/k8s.mdc +2 -4
  15. package/rules/npm-module/js/package_structure/check.mjs +2 -2
  16. package/rules/npm-module/npm-module.mdc +3 -3
  17. package/rules/rego/js/lint.mjs +4 -1
  18. package/rules/rego/policy/package_json/package_json.rego +5 -3
  19. package/rules/rego/rego.mdc +3 -3
  20. package/rules/style-lint/js/tooling/check.mjs +1 -1
  21. package/rules/style-lint/style-lint.mdc +1 -1
  22. package/rules/text/js/formatting/check.mjs +8 -24
  23. package/rules/text/js/lint.mjs +34 -0
  24. package/rules/text/js/run-shellcheck.mjs +2 -2
  25. package/rules/text/js/run-v8r.mjs +2 -2
  26. package/rules/text/text.mdc +5 -5
  27. package/schemas/v8r-catalog.json +6 -0
  28. package/scripts/auto-skills.mjs +1 -3
  29. package/scripts/utils/resolve-target-files.mjs +1 -1
  30. package/scripts/utils/run-lint-step.mjs +33 -0
  31. package/scripts/utils/run-rule.mjs +2 -1
  32. package/skills/abie-clean/SKILL.md +9 -5
  33. package/skills/fix/SKILL.md +6 -14
  34. package/rules/abie/policy/base_deployment_preem/base_deployment_preem_test.rego +0 -60
  35. package/rules/abie/policy/clean_merged_ignore_branches/clean_merged_ignore_branches_test.rego +0 -48
  36. package/rules/abie/policy/health_check_policy/health_check_policy_test.rego +0 -99
  37. package/rules/abie/policy/http_route_base/http_route_base_test.rego +0 -64
  38. package/rules/bun/policy/package_json/package_json_test.rego +0 -109
  39. package/rules/docker/policy/lint_docker_yml/lint_docker_yml_test.rego +0 -104
  40. package/rules/docker/policy/package_json/package_json_test.rego +0 -42
  41. package/rules/graphql/policy/vscode_extensions/vscode_extensions_test.rego +0 -34
  42. package/rules/image-avif/policy/package_json/package_json_test.rego +0 -69
  43. package/rules/js-lint/policy/package_json/package_json_test.rego +0 -130
  44. package/rules/js-run/policy/jsconfig/jsconfig_test.rego +0 -88
  45. package/rules/k8s/policy/base_kustomization/base_kustomization_test.rego +0 -73
  46. package/rules/k8s/policy/base_manifest/base_manifest_test.rego +0 -94
  47. package/rules/k8s/policy/gateway/gateway_test.rego +0 -122
  48. package/rules/k8s/policy/hasura_configmap/hasura_configmap_test.rego +0 -49
  49. package/rules/k8s/policy/hasura_httproute/hasura_httproute_test.rego +0 -148
  50. package/rules/k8s/policy/hpa_pdb/hpa_pdb_test.rego +0 -101
  51. package/rules/k8s/policy/kustomization/kustomization_test.rego +0 -128
  52. package/rules/k8s/policy/manifest/manifest_test.rego +0 -309
  53. package/rules/k8s/policy/svc_hl_yaml/svc_hl_yaml_test.rego +0 -42
  54. package/rules/k8s/policy/svc_yaml/svc_yaml_test.rego +0 -41
  55. package/rules/nginx-default-tpl/policy/vscode_extensions/vscode_extensions_test.rego +0 -30
  56. package/rules/nginx-default-tpl/policy/vscode_settings/vscode_settings_test.rego +0 -53
  57. package/rules/npm-module/policy/npm_package_json/npm_package_json_test.rego +0 -81
  58. package/rules/rego/policy/package_json/package_json_test.rego +0 -42
  59. package/rules/rego/policy/vscode_extensions/vscode_extensions_test.rego +0 -34
  60. package/rules/rego/policy/vscode_settings/vscode_settings_test.rego +0 -55
  61. package/rules/style-lint/policy/vscode_extensions/vscode_extensions_test.rego +0 -39
  62. package/rules/style-lint/policy/vscode_settings/vscode_settings_test.rego +0 -49
  63. package/rules/tauri/policy/vscode_extensions/vscode_extensions_test.rego +0 -44
  64. package/rules/text/policy/markdownlint/markdownlint_test.rego +0 -98
  65. package/rules/text/policy/vscode_extensions/vscode_extensions_test.rego +0 -51
  66. package/rules/text/policy/vscode_settings/vscode_settings_test.rego +0 -85
@@ -1,55 +0,0 @@
1
- # Тести для `rego.vscode_settings`. Запуск:
2
- # conftest verify -p npm/policy/rego/vscode_settings
3
- package rego.vscode_settings_test
4
-
5
- import rego.v1
6
-
7
- import data.rego.vscode_settings
8
-
9
- valid_cfg := {"[rego]": {
10
- "editor.defaultFormatter": "tsandall.opa",
11
- "editor.formatOnSave": true,
12
- }}
13
-
14
- test_allow_canonical if {
15
- count(vscode_settings.deny) == 0 with input as valid_cfg
16
- }
17
-
18
- test_allow_with_additional_lang_blocks if {
19
- cfg := json.patch(
20
- valid_cfg,
21
- [{"op": "add", "path": "/[javascript]", "value": {"editor.defaultFormatter": "oxc.oxc-vscode"}}],
22
- )
23
- count(vscode_settings.deny) == 0 with input as cfg
24
- }
25
-
26
- test_deny_rego_block_missing if {
27
- count(vscode_settings.deny) > 0 with input as {}
28
- }
29
-
30
- test_deny_rego_block_not_object if {
31
- count(vscode_settings.deny) > 0 with input as {"[rego]": "tsandall.opa"}
32
- }
33
-
34
- test_deny_wrong_default_formatter if {
35
- cfg := json.patch(
36
- valid_cfg,
37
- [{"op": "replace", "path": "/[rego]/editor.defaultFormatter", "value": "prettier"}],
38
- )
39
- count(vscode_settings.deny) > 0 with input as cfg
40
- }
41
-
42
- test_deny_default_formatter_missing if {
43
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/[rego]/editor.defaultFormatter"}])
44
- count(vscode_settings.deny) > 0 with input as cfg
45
- }
46
-
47
- test_deny_format_on_save_false if {
48
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/[rego]/editor.formatOnSave", "value": false}])
49
- count(vscode_settings.deny) > 0 with input as cfg
50
- }
51
-
52
- test_deny_format_on_save_missing if {
53
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/[rego]/editor.formatOnSave"}])
54
- count(vscode_settings.deny) > 0 with input as cfg
55
- }
@@ -1,39 +0,0 @@
1
- # Тести для `style_lint.vscode_extensions`. Запуск:
2
- # conftest verify -p npm/policy/style_lint/vscode_extensions
3
- package style_lint.vscode_extensions_test
4
-
5
- import rego.v1
6
-
7
- import data.style_lint.vscode_extensions
8
-
9
- # ── happy path ────────────────────────────────────────────────────────────
10
-
11
- test_allow_with_required_extension if {
12
- cfg := {"recommendations": ["stylelint.vscode-stylelint"]}
13
- count(vscode_extensions.deny) == 0 with input as cfg
14
- }
15
-
16
- test_allow_with_additional_extensions if {
17
- cfg := {"recommendations": [
18
- "dbaeumer.vscode-eslint",
19
- "stylelint.vscode-stylelint",
20
- "oxc.oxc-vscode",
21
- "DavidAnson.vscode-markdownlint",
22
- ]}
23
- count(vscode_extensions.deny) == 0 with input as cfg
24
- }
25
-
26
- # ── deny ──────────────────────────────────────────────────────────────────
27
-
28
- test_deny_missing_extension if {
29
- cfg := {"recommendations": ["dbaeumer.vscode-eslint"]}
30
- count(vscode_extensions.deny) > 0 with input as cfg
31
- }
32
-
33
- test_deny_empty_recommendations if {
34
- count(vscode_extensions.deny) > 0 with input as {"recommendations": []}
35
- }
36
-
37
- test_deny_no_recommendations_field if {
38
- count(vscode_extensions.deny) > 0 with input as {}
39
- }
@@ -1,49 +0,0 @@
1
- # Тести для `style_lint.vscode_settings`. Запуск:
2
- # conftest verify -p npm/policy/style_lint/vscode_settings
3
- package style_lint.vscode_settings_test
4
-
5
- import rego.v1
6
-
7
- import data.style_lint.vscode_settings
8
-
9
- valid_cfg := {
10
- "css.validate": false,
11
- "less.validate": false,
12
- "scss.validate": false,
13
- }
14
-
15
- # ── happy path ────────────────────────────────────────────────────────────
16
-
17
- test_allow_canonical if {
18
- count(vscode_settings.deny) == 0 with input as valid_cfg
19
- }
20
-
21
- test_allow_with_additional_keys if {
22
- cfg := json.patch(valid_cfg, [{
23
- "op": "add",
24
- "path": "/editor.codeActionsOnSave",
25
- "value": {"source.fixAll": "explicit"},
26
- }])
27
- count(vscode_settings.deny) == 0 with input as cfg
28
- }
29
-
30
- # ── deny ──────────────────────────────────────────────────────────────────
31
-
32
- test_deny_css_validate_true if {
33
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/css.validate", "value": true}])
34
- count(vscode_settings.deny) > 0 with input as cfg
35
- }
36
-
37
- test_deny_scss_validate_missing if {
38
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/scss.validate"}])
39
- count(vscode_settings.deny) > 0 with input as cfg
40
- }
41
-
42
- test_deny_less_validate_string if {
43
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/less.validate", "value": "off"}])
44
- count(vscode_settings.deny) > 0 with input as cfg
45
- }
46
-
47
- test_deny_empty_object if {
48
- count(vscode_settings.deny) > 0 with input as {}
49
- }
@@ -1,44 +0,0 @@
1
- # Тести для `tauri.vscode_extensions`. Запуск:
2
- # conftest verify -p npm/policy/tauri/vscode_extensions
3
- package tauri.vscode_extensions_test
4
-
5
- import rego.v1
6
-
7
- import data.tauri.vscode_extensions
8
-
9
- canonical := {"recommendations": [
10
- "tauri-apps.tauri-vscode",
11
- "rust-lang.rust-analyzer",
12
- ]}
13
-
14
- test_allow_canonical if {
15
- count(vscode_extensions.deny) == 0 with input as canonical
16
- }
17
-
18
- test_allow_with_additional_extensions if {
19
- cfg := {"recommendations": [
20
- "dbaeumer.vscode-eslint",
21
- "tauri-apps.tauri-vscode",
22
- "rust-lang.rust-analyzer",
23
- "oxc.oxc-vscode",
24
- ]}
25
- count(vscode_extensions.deny) == 0 with input as cfg
26
- }
27
-
28
- test_deny_missing_tauri if {
29
- cfg := {"recommendations": ["rust-lang.rust-analyzer"]}
30
- count(vscode_extensions.deny) > 0 with input as cfg
31
- }
32
-
33
- test_deny_missing_rust_analyzer if {
34
- cfg := {"recommendations": ["tauri-apps.tauri-vscode"]}
35
- count(vscode_extensions.deny) > 0 with input as cfg
36
- }
37
-
38
- test_deny_empty_recommendations if {
39
- count(vscode_extensions.deny) > 0 with input as {"recommendations": []}
40
- }
41
-
42
- test_deny_no_recommendations_field if {
43
- count(vscode_extensions.deny) > 0 with input as {}
44
- }
@@ -1,98 +0,0 @@
1
- # Тести для `text.markdownlint`. Запуск:
2
- # conftest verify -p npm/policy/text/markdownlint
3
- package text.markdownlint_test
4
-
5
- import rego.v1
6
-
7
- import data.text.markdownlint
8
-
9
- valid_cfg := {
10
- "gitignore": true,
11
- "config": {
12
- "default": true,
13
- "MD013": false,
14
- "MD024": {"siblings_only": true},
15
- "MD029": false,
16
- "MD040": false,
17
- "MD041": false,
18
- },
19
- }
20
-
21
- # ── happy path ────────────────────────────────────────────────────────────
22
-
23
- test_allow_canonical if {
24
- count(markdownlint.deny) == 0 with input as valid_cfg
25
- }
26
-
27
- test_allow_with_additional_top_level_keys if {
28
- cfg := json.patch(valid_cfg, [{"op": "add", "path": "/ignores", "value": ["**/adr/**"]}])
29
- count(markdownlint.deny) == 0 with input as cfg
30
- }
31
-
32
- test_allow_with_additional_md_rules if {
33
- cfg := json.patch(valid_cfg, [{"op": "add", "path": "/config/MD033", "value": {"allowed_elements": ["a"]}}])
34
- count(markdownlint.deny) == 0 with input as cfg
35
- }
36
-
37
- # ── gitignore ─────────────────────────────────────────────────────────────
38
-
39
- test_deny_missing_gitignore if {
40
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/gitignore"}])
41
- count(markdownlint.deny) > 0 with input as cfg
42
- }
43
-
44
- test_deny_gitignore_false if {
45
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/gitignore", "value": false}])
46
- count(markdownlint.deny) > 0 with input as cfg
47
- }
48
-
49
- # ── config.default ────────────────────────────────────────────────────────
50
-
51
- test_deny_default_false if {
52
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/config/default", "value": false}])
53
- count(markdownlint.deny) > 0 with input as cfg
54
- }
55
-
56
- test_deny_default_missing if {
57
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/config/default"}])
58
- count(markdownlint.deny) > 0 with input as cfg
59
- }
60
-
61
- # ── MD013 / MD029 / MD040 / MD041 — повинні бути false ────────────────────
62
-
63
- test_deny_md013_true if {
64
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/config/MD013", "value": true}])
65
- count(markdownlint.deny) > 0 with input as cfg
66
- }
67
-
68
- test_deny_md029_missing if {
69
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/config/MD029"}])
70
- count(markdownlint.deny) > 0 with input as cfg
71
- }
72
-
73
- test_deny_md040_true if {
74
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/config/MD040", "value": true}])
75
- count(markdownlint.deny) > 0 with input as cfg
76
- }
77
-
78
- test_deny_md041_true if {
79
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/config/MD041", "value": true}])
80
- count(markdownlint.deny) > 0 with input as cfg
81
- }
82
-
83
- # ── MD024.siblings_only ──────────────────────────────────────────────────
84
-
85
- test_deny_md024_not_object if {
86
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/config/MD024", "value": false}])
87
- count(markdownlint.deny) > 0 with input as cfg
88
- }
89
-
90
- test_deny_md024_siblings_only_false if {
91
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/config/MD024/siblings_only", "value": false}])
92
- count(markdownlint.deny) > 0 with input as cfg
93
- }
94
-
95
- test_deny_md024_missing if {
96
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/config/MD024"}])
97
- count(markdownlint.deny) > 0 with input as cfg
98
- }
@@ -1,51 +0,0 @@
1
- # Тести для `text.vscode_extensions`. Запуск:
2
- # conftest verify -p npm/policy/text/vscode_extensions
3
- package text.vscode_extensions_test
4
-
5
- import rego.v1
6
-
7
- import data.text.vscode_extensions
8
-
9
- canonical := {"recommendations": [
10
- "DavidAnson.vscode-markdownlint",
11
- "oxc.oxc-vscode",
12
- "timonwong.shellcheck",
13
- ]}
14
-
15
- test_allow_canonical if {
16
- count(vscode_extensions.deny) == 0 with input as canonical
17
- }
18
-
19
- test_allow_with_additional_extensions if {
20
- cfg := {"recommendations": [
21
- "DavidAnson.vscode-markdownlint",
22
- "oxc.oxc-vscode",
23
- "timonwong.shellcheck",
24
- "dbaeumer.vscode-eslint",
25
- "stylelint.vscode-stylelint",
26
- ]}
27
- count(vscode_extensions.deny) == 0 with input as cfg
28
- }
29
-
30
- test_deny_missing_markdownlint if {
31
- cfg := {"recommendations": ["oxc.oxc-vscode", "timonwong.shellcheck"]}
32
- count(vscode_extensions.deny) > 0 with input as cfg
33
- }
34
-
35
- test_deny_missing_oxc if {
36
- cfg := {"recommendations": ["DavidAnson.vscode-markdownlint", "timonwong.shellcheck"]}
37
- count(vscode_extensions.deny) > 0 with input as cfg
38
- }
39
-
40
- test_deny_missing_shellcheck if {
41
- cfg := {"recommendations": ["DavidAnson.vscode-markdownlint", "oxc.oxc-vscode"]}
42
- count(vscode_extensions.deny) > 0 with input as cfg
43
- }
44
-
45
- test_deny_empty_recommendations if {
46
- count(vscode_extensions.deny) > 0 with input as {"recommendations": []}
47
- }
48
-
49
- test_deny_no_recommendations_field if {
50
- count(vscode_extensions.deny) > 0 with input as {}
51
- }
@@ -1,85 +0,0 @@
1
- # Тести для `text.vscode_settings`. Запуск:
2
- # conftest verify -p npm/policy/text/vscode_settings
3
- package text.vscode_settings_test
4
-
5
- import rego.v1
6
-
7
- import data.text.vscode_settings
8
-
9
- valid_cfg := {
10
- "editor.formatOnSave": true,
11
- "[javascript]": {"editor.defaultFormatter": "oxc.oxc-vscode"},
12
- "[typescript]": {"editor.defaultFormatter": "oxc.oxc-vscode"},
13
- "[json]": {"editor.defaultFormatter": "oxc.oxc-vscode"},
14
- "[vue]": {"editor.defaultFormatter": "oxc.oxc-vscode"},
15
- "[css]": {"editor.defaultFormatter": "oxc.oxc-vscode"},
16
- "[html]": {"editor.defaultFormatter": "oxc.oxc-vscode"},
17
- }
18
-
19
- # ── happy path ────────────────────────────────────────────────────────────
20
-
21
- test_allow_canonical if {
22
- count(vscode_settings.deny) == 0 with input as valid_cfg
23
- }
24
-
25
- test_allow_with_additional_lang_block if {
26
- cfg := json.patch(valid_cfg, [{
27
- "op": "add",
28
- "path": "/[python]",
29
- "value": {"editor.defaultFormatter": "ms-python.python"},
30
- }])
31
- count(vscode_settings.deny) == 0 with input as cfg
32
- }
33
-
34
- # ── deny: editor.formatOnSave ────────────────────────────────────────────
35
-
36
- test_deny_format_on_save_false if {
37
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/editor.formatOnSave", "value": false}])
38
- count(vscode_settings.deny) > 0 with input as cfg
39
- }
40
-
41
- test_deny_format_on_save_missing if {
42
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/editor.formatOnSave"}])
43
- count(vscode_settings.deny) > 0 with input as cfg
44
- }
45
-
46
- # ── deny: lang formatters (per-key) ──────────────────────────────────────
47
-
48
- test_deny_javascript_missing if {
49
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/[javascript]"}])
50
- count(vscode_settings.deny) > 0 with input as cfg
51
- }
52
-
53
- test_deny_typescript_wrong_formatter if {
54
- cfg := json.patch(
55
- valid_cfg,
56
- [{"op": "replace", "path": "/[typescript]/editor.defaultFormatter", "value": "prettier"}],
57
- )
58
- count(vscode_settings.deny) > 0 with input as cfg
59
- }
60
-
61
- test_deny_json_block_not_object if {
62
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/[json]", "value": "oxc.oxc-vscode"}])
63
- count(vscode_settings.deny) > 0 with input as cfg
64
- }
65
-
66
- test_deny_vue_missing_default_formatter if {
67
- cfg := json.patch(valid_cfg, [{"op": "replace", "path": "/[vue]", "value": {"editor.tabSize": 2}}])
68
- count(vscode_settings.deny) > 0 with input as cfg
69
- }
70
-
71
- test_deny_css_missing if {
72
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/[css]"}])
73
- count(vscode_settings.deny) > 0 with input as cfg
74
- }
75
-
76
- test_deny_html_missing if {
77
- cfg := json.patch(valid_cfg, [{"op": "remove", "path": "/[html]"}])
78
- count(vscode_settings.deny) > 0 with input as cfg
79
- }
80
-
81
- # ── deny: empty object ───────────────────────────────────────────────────
82
-
83
- test_deny_empty_object if {
84
- count(vscode_settings.deny) > 0 with input as {}
85
- }