@owenlamont/ryl 0.4.1

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 (217) hide show
  1. package/.github/CODEOWNERS +1 -0
  2. package/.github/dependabot.yml +13 -0
  3. package/.github/workflows/ci.yml +107 -0
  4. package/.github/workflows/release.yml +613 -0
  5. package/.github/workflows/update_dependencies.yml +61 -0
  6. package/.github/workflows/update_linters.yml +56 -0
  7. package/.pre-commit-config.yaml +87 -0
  8. package/.yamllint +4 -0
  9. package/AGENTS.md +200 -0
  10. package/Cargo.lock +908 -0
  11. package/Cargo.toml +32 -0
  12. package/LICENSE +21 -0
  13. package/README.md +230 -0
  14. package/bin/ryl.js +1 -0
  15. package/clippy.toml +1 -0
  16. package/docs/config-presets.md +100 -0
  17. package/img/benchmark-5x5-5runs.svg +2176 -0
  18. package/package.json +28 -0
  19. package/pyproject.toml +42 -0
  20. package/ruff.toml +107 -0
  21. package/rumdl.toml +20 -0
  22. package/rust-toolchain.toml +3 -0
  23. package/rustfmt.toml +3 -0
  24. package/scripts/benchmark_perf_vs_yamllint.py +400 -0
  25. package/scripts/coverage-missing.ps1 +80 -0
  26. package/scripts/coverage-missing.sh +60 -0
  27. package/src/bin/discover_config_bin.rs +24 -0
  28. package/src/cli_support.rs +33 -0
  29. package/src/conf/mod.rs +85 -0
  30. package/src/config.rs +2099 -0
  31. package/src/decoder.rs +326 -0
  32. package/src/discover.rs +31 -0
  33. package/src/lib.rs +19 -0
  34. package/src/lint.rs +558 -0
  35. package/src/main.rs +535 -0
  36. package/src/migrate.rs +233 -0
  37. package/src/rules/anchors.rs +517 -0
  38. package/src/rules/braces.rs +77 -0
  39. package/src/rules/brackets.rs +77 -0
  40. package/src/rules/colons.rs +475 -0
  41. package/src/rules/commas.rs +372 -0
  42. package/src/rules/comments.rs +299 -0
  43. package/src/rules/comments_indentation.rs +243 -0
  44. package/src/rules/document_end.rs +175 -0
  45. package/src/rules/document_start.rs +84 -0
  46. package/src/rules/empty_lines.rs +152 -0
  47. package/src/rules/empty_values.rs +255 -0
  48. package/src/rules/float_values.rs +259 -0
  49. package/src/rules/flow_collection.rs +562 -0
  50. package/src/rules/hyphens.rs +104 -0
  51. package/src/rules/indentation.rs +803 -0
  52. package/src/rules/key_duplicates.rs +218 -0
  53. package/src/rules/key_ordering.rs +303 -0
  54. package/src/rules/line_length.rs +326 -0
  55. package/src/rules/mod.rs +25 -0
  56. package/src/rules/new_line_at_end_of_file.rs +23 -0
  57. package/src/rules/new_lines.rs +95 -0
  58. package/src/rules/octal_values.rs +121 -0
  59. package/src/rules/quoted_strings.rs +577 -0
  60. package/src/rules/span_utils.rs +37 -0
  61. package/src/rules/trailing_spaces.rs +65 -0
  62. package/src/rules/truthy.rs +420 -0
  63. package/tests/brackets_carriage_return.rs +114 -0
  64. package/tests/build_global_cfg_error.rs +23 -0
  65. package/tests/cli_anchors_rule.rs +143 -0
  66. package/tests/cli_braces_rule.rs +104 -0
  67. package/tests/cli_brackets_rule.rs +104 -0
  68. package/tests/cli_colons_rule.rs +65 -0
  69. package/tests/cli_commas_rule.rs +104 -0
  70. package/tests/cli_comments_indentation_rule.rs +61 -0
  71. package/tests/cli_comments_rule.rs +67 -0
  72. package/tests/cli_config_data_error.rs +30 -0
  73. package/tests/cli_config_flags.rs +66 -0
  74. package/tests/cli_config_migrate.rs +229 -0
  75. package/tests/cli_document_end_rule.rs +92 -0
  76. package/tests/cli_document_start_rule.rs +92 -0
  77. package/tests/cli_empty_lines_rule.rs +87 -0
  78. package/tests/cli_empty_values_rule.rs +68 -0
  79. package/tests/cli_env_config.rs +34 -0
  80. package/tests/cli_exit_and_errors.rs +41 -0
  81. package/tests/cli_file_encoding.rs +203 -0
  82. package/tests/cli_float_values_rule.rs +64 -0
  83. package/tests/cli_format_options.rs +316 -0
  84. package/tests/cli_global_cfg_relaxed.rs +20 -0
  85. package/tests/cli_hyphens_rule.rs +104 -0
  86. package/tests/cli_indentation_rule.rs +65 -0
  87. package/tests/cli_invalid_project_config.rs +39 -0
  88. package/tests/cli_key_duplicates_rule.rs +104 -0
  89. package/tests/cli_key_ordering_rule.rs +59 -0
  90. package/tests/cli_line_length_rule.rs +85 -0
  91. package/tests/cli_list_files.rs +29 -0
  92. package/tests/cli_new_line_rule.rs +141 -0
  93. package/tests/cli_new_lines_rule.rs +119 -0
  94. package/tests/cli_octal_values_rule.rs +60 -0
  95. package/tests/cli_quoted_strings_rule.rs +47 -0
  96. package/tests/cli_toml_config.rs +119 -0
  97. package/tests/cli_trailing_spaces_rule.rs +77 -0
  98. package/tests/cli_truthy_rule.rs +83 -0
  99. package/tests/cli_yaml_files_negation.rs +45 -0
  100. package/tests/colons_rule.rs +303 -0
  101. package/tests/common/compat.rs +114 -0
  102. package/tests/common/fake_env.rs +93 -0
  103. package/tests/common/mod.rs +1 -0
  104. package/tests/conf_builtin.rs +9 -0
  105. package/tests/config_anchors.rs +84 -0
  106. package/tests/config_braces.rs +121 -0
  107. package/tests/config_brackets.rs +127 -0
  108. package/tests/config_commas.rs +79 -0
  109. package/tests/config_comments.rs +65 -0
  110. package/tests/config_comments_indentation.rs +20 -0
  111. package/tests/config_deep_merge_nonstring_key.rs +24 -0
  112. package/tests/config_document_end.rs +54 -0
  113. package/tests/config_document_start.rs +55 -0
  114. package/tests/config_empty_lines.rs +48 -0
  115. package/tests/config_empty_values.rs +35 -0
  116. package/tests/config_env_errors.rs +23 -0
  117. package/tests/config_env_invalid_inline.rs +15 -0
  118. package/tests/config_env_missing.rs +63 -0
  119. package/tests/config_env_shim.rs +301 -0
  120. package/tests/config_explicit_file_parse_error.rs +55 -0
  121. package/tests/config_extended_features.rs +225 -0
  122. package/tests/config_extends_inline.rs +185 -0
  123. package/tests/config_extends_sequence.rs +18 -0
  124. package/tests/config_find_project_home_boundary.rs +54 -0
  125. package/tests/config_find_project_two_files_in_cwd.rs +47 -0
  126. package/tests/config_float_values.rs +34 -0
  127. package/tests/config_from_yaml_paths.rs +32 -0
  128. package/tests/config_hyphens.rs +51 -0
  129. package/tests/config_ignore_errors.rs +243 -0
  130. package/tests/config_ignore_overrides.rs +83 -0
  131. package/tests/config_indentation.rs +65 -0
  132. package/tests/config_invalid_globs.rs +16 -0
  133. package/tests/config_invalid_types.rs +19 -0
  134. package/tests/config_key_duplicates.rs +34 -0
  135. package/tests/config_key_ordering.rs +70 -0
  136. package/tests/config_line_length.rs +65 -0
  137. package/tests/config_locale.rs +111 -0
  138. package/tests/config_merge.rs +26 -0
  139. package/tests/config_new_lines.rs +89 -0
  140. package/tests/config_octal_values.rs +33 -0
  141. package/tests/config_quoted_strings.rs +195 -0
  142. package/tests/config_rule_level.rs +147 -0
  143. package/tests/config_rules_non_string_keys.rs +23 -0
  144. package/tests/config_scalar_overrides.rs +27 -0
  145. package/tests/config_to_toml.rs +110 -0
  146. package/tests/config_toml_coverage.rs +80 -0
  147. package/tests/config_toml_discovery.rs +304 -0
  148. package/tests/config_trailing_spaces.rs +152 -0
  149. package/tests/config_truthy.rs +77 -0
  150. package/tests/config_yaml_files.rs +62 -0
  151. package/tests/config_yaml_files_all_non_string.rs +15 -0
  152. package/tests/config_yaml_files_empty.rs +30 -0
  153. package/tests/coverage_commas.rs +46 -0
  154. package/tests/decoder_decode.rs +338 -0
  155. package/tests/discover_config_bin_all.rs +66 -0
  156. package/tests/discover_config_bin_env_invalid_yaml.rs +26 -0
  157. package/tests/discover_config_bin_project_config_parse_error.rs +24 -0
  158. package/tests/discover_config_bin_user_global_error.rs +26 -0
  159. package/tests/discover_module.rs +30 -0
  160. package/tests/discover_per_file_dir.rs +10 -0
  161. package/tests/discover_per_file_project_config_error.rs +21 -0
  162. package/tests/float_values.rs +43 -0
  163. package/tests/lint_multi_errors.rs +32 -0
  164. package/tests/main_yaml_ok_filtering.rs +30 -0
  165. package/tests/migrate_module.rs +259 -0
  166. package/tests/resolve_ctx_empty_parent.rs +16 -0
  167. package/tests/rule_anchors.rs +442 -0
  168. package/tests/rule_braces.rs +258 -0
  169. package/tests/rule_brackets.rs +217 -0
  170. package/tests/rule_commas.rs +205 -0
  171. package/tests/rule_comments.rs +197 -0
  172. package/tests/rule_comments_indentation.rs +127 -0
  173. package/tests/rule_document_end.rs +118 -0
  174. package/tests/rule_document_start.rs +60 -0
  175. package/tests/rule_empty_lines.rs +96 -0
  176. package/tests/rule_empty_values.rs +102 -0
  177. package/tests/rule_float_values.rs +109 -0
  178. package/tests/rule_hyphens.rs +65 -0
  179. package/tests/rule_indentation.rs +455 -0
  180. package/tests/rule_key_duplicates.rs +76 -0
  181. package/tests/rule_key_ordering.rs +207 -0
  182. package/tests/rule_line_length.rs +200 -0
  183. package/tests/rule_new_lines.rs +51 -0
  184. package/tests/rule_octal_values.rs +53 -0
  185. package/tests/rule_quoted_strings.rs +290 -0
  186. package/tests/rule_trailing_spaces.rs +41 -0
  187. package/tests/rule_truthy.rs +236 -0
  188. package/tests/user_global_invalid_yaml.rs +32 -0
  189. package/tests/yamllint_compat_anchors.rs +280 -0
  190. package/tests/yamllint_compat_braces.rs +411 -0
  191. package/tests/yamllint_compat_brackets.rs +364 -0
  192. package/tests/yamllint_compat_colons.rs +298 -0
  193. package/tests/yamllint_compat_colors.rs +80 -0
  194. package/tests/yamllint_compat_commas.rs +375 -0
  195. package/tests/yamllint_compat_comments.rs +167 -0
  196. package/tests/yamllint_compat_comments_indentation.rs +281 -0
  197. package/tests/yamllint_compat_config.rs +170 -0
  198. package/tests/yamllint_compat_document_end.rs +243 -0
  199. package/tests/yamllint_compat_document_start.rs +136 -0
  200. package/tests/yamllint_compat_empty_lines.rs +117 -0
  201. package/tests/yamllint_compat_empty_values.rs +179 -0
  202. package/tests/yamllint_compat_float_values.rs +216 -0
  203. package/tests/yamllint_compat_hyphens.rs +223 -0
  204. package/tests/yamllint_compat_indentation.rs +398 -0
  205. package/tests/yamllint_compat_key_duplicates.rs +139 -0
  206. package/tests/yamllint_compat_key_ordering.rs +170 -0
  207. package/tests/yamllint_compat_line_length.rs +375 -0
  208. package/tests/yamllint_compat_list.rs +127 -0
  209. package/tests/yamllint_compat_new_line.rs +133 -0
  210. package/tests/yamllint_compat_newline_types.rs +185 -0
  211. package/tests/yamllint_compat_octal_values.rs +172 -0
  212. package/tests/yamllint_compat_quoted_strings.rs +154 -0
  213. package/tests/yamllint_compat_syntax.rs +200 -0
  214. package/tests/yamllint_compat_trailing_spaces.rs +162 -0
  215. package/tests/yamllint_compat_truthy.rs +130 -0
  216. package/tests/yamllint_compat_yaml_files.rs +81 -0
  217. package/typos.toml +2 -0
package/Cargo.toml ADDED
@@ -0,0 +1,32 @@
1
+ [package]
2
+ name = "ryl"
3
+ version = "0.4.1"
4
+ edition = "2024"
5
+ description = "Fast YAML linter inspired by yamllint"
6
+ readme = "README.md"
7
+ license = "MIT"
8
+ repository = "https://github.com/owenlamont/ryl"
9
+ categories = ["command-line-utilities", "development-tools"]
10
+ keywords = ["yaml", "lint", "cli", "rust"]
11
+
12
+ [[bin]]
13
+ name = "ryl"
14
+ path = "src/main.rs"
15
+
16
+ [dependencies]
17
+ clap = { version = "4.6.0", default-features = false, features = ["derive", "std", "help", "usage", "error-context", "suggestions"] }
18
+ ignore = "0.4.25"
19
+ rayon = "1.11.0"
20
+ saphyr-parser = "0.0.6"
21
+ saphyr = "0.0.6"
22
+ dirs-next = "2.0.0"
23
+ regex = "1"
24
+ unicode-normalization = "0.1"
25
+ encoding_rs = "0.8"
26
+ # Keep preserve_order off to avoid pulling in indexmap/hashbrown 0.16 until
27
+ # saphyr updates hashlink and the dependency graph converges again.
28
+ toml = { version = "1.1.2", default-features = false, features = ["display", "parse", "serde"] }
29
+
30
+ [dev-dependencies]
31
+ semver = "1"
32
+ tempfile = "3"
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Owen Lamont
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,230 @@
1
+ # ryl
2
+
3
+ ryl - the Rust Yaml Linter is intended to ultimately be a drop in replacement for
4
+ [yamllint](https://github.com/adrienverge/yamllint). It is usable today, but
5
+ parity and edge-case behavior are still maturing.
6
+
7
+ Compatibility note:
8
+
9
+ - `ryl` aims to match `yamllint` behavior and includes many parity tests.
10
+ - `ryl` uses the `saphyr` parser stack, while `yamllint` uses the `PyYAML` parser stack.
11
+ - `saphyr` and `PyYAML` do not always agree on which files are valid YAML.
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ uvx ryl .
17
+ ```
18
+
19
+ For `prek` / `pre-commit` integration, see
20
+ [ryl-pre-commit](https://github.com/owenlamont/ryl-pre-commit).
21
+
22
+ ## Installation
23
+
24
+ ### uv
25
+
26
+ ```bash
27
+ uv tool install ryl
28
+ ```
29
+
30
+ ### pip
31
+
32
+ ```bash
33
+ pip install ryl
34
+ ```
35
+
36
+ ### Cargo
37
+
38
+ ```bash
39
+ cargo install ryl
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ ryl accepts one or more paths: files and/or directories.
45
+
46
+ Basic:
47
+
48
+ ```text
49
+ ryl <PATH_OR_FILE> [PATH_OR_FILE...]
50
+ ```
51
+
52
+ Behavior:
53
+
54
+ - Files: parsed as YAML even if the extension is not `.yml`/`.yaml`.
55
+ - Directories: recursively lints `.yml` and `.yaml` files.
56
+ - Respects `.gitignore`, global git ignores, and git excludes.
57
+ - Does not follow symlinks.
58
+
59
+ Exit codes:
60
+
61
+ - `0` when all parsed files are valid (or no files found).
62
+ - `1` when any invalid YAML is found.
63
+ - `2` for CLI usage errors (for example, no paths provided).
64
+
65
+ Examples:
66
+
67
+ ```text
68
+ # Single file
69
+ ryl myfile.yml
70
+
71
+ # Multiple inputs (mix files and directories)
72
+ ryl config/ another.yml
73
+
74
+ # Multiple directories
75
+ ryl dir1 dir2
76
+
77
+ # Explicit non-YAML extension (parsed as YAML)
78
+ ryl notes.txt
79
+ ```
80
+
81
+ Help and version:
82
+
83
+ ```text
84
+ Fast YAML linter written in Rust
85
+
86
+ Usage: ryl [OPTIONS] [PATH_OR_FILE]...
87
+
88
+ Arguments:
89
+ [PATH_OR_FILE]... One or more paths: files and/or directories
90
+
91
+ Options:
92
+ -c, --config-file <FILE> Path to configuration file (YAML or TOML)
93
+ -d, --config-data <YAML> Inline configuration data (yaml)
94
+ -f, --format <FORMAT> Output format (auto, standard, colored, github,
95
+ parsable) [default: auto]
96
+ [possible values: auto, standard, colored,
97
+ github, parsable]
98
+ --migrate-configs Convert discovered legacy YAML config files
99
+ into .ryl.toml files
100
+ --list-files List files that would be linted (reserved)
101
+ -s, --strict Strict mode (reserved)
102
+ --no-warnings Suppress warnings (reserved)
103
+ --migrate-root <DIR> Root path to search for legacy YAML config
104
+ files (default: .)
105
+ --migrate-write Write migrated .ryl.toml files (otherwise
106
+ preview only)
107
+ --migrate-stdout Print generated TOML to stdout during migration
108
+ --migrate-rename-old <SUFFIX> Rename source YAML configs by appending
109
+ this suffix after migration
110
+ --migrate-delete-old Delete source YAML configs after migration
111
+ -h, --help Print help
112
+ -V, --version Print version
113
+ ```
114
+
115
+ ## Performance benchmarking
116
+
117
+ This repo includes a standalone benchmark script that compares PyPI `ryl` and
118
+ `yamllint` using synthetic YAML corpora and `hyperfine`.
119
+
120
+ Prerequisites:
121
+
122
+ - `uv`
123
+ - `hyperfine`
124
+
125
+ Run a quick sample:
126
+
127
+ ```text
128
+ uv run scripts/benchmark_perf_vs_yamllint.py --file-counts 25,100 --file-sizes-kib 1,8 --runs 5 --warmup 1
129
+ ```
130
+
131
+ Run a fuller matrix (explicit lists):
132
+
133
+ ```text
134
+ uv run scripts/benchmark_perf_vs_yamllint.py --file-counts 25,100,400,1000 --file-sizes-kib 1,8,32,128 --runs 10 --warmup 2
135
+ ```
136
+
137
+ Run a fuller matrix (ranges with increments):
138
+
139
+ ```text
140
+ uv run scripts/benchmark_perf_vs_yamllint.py --file-count-start 100 --file-count-end 1000 --file-count-step 100 --file-size-start-kib 4 --file-size-end-kib 64 --file-size-step-kib 4 --runs 10 --warmup 2
141
+ ```
142
+
143
+ The script uses Typer; use `--help` for all options.
144
+
145
+ Artifacts are written under `manual_outputs/benchmarks/<UTC_TIMESTAMP>/`:
146
+
147
+ - `benchmark.png` and `benchmark.svg`: side-by-side facet plot with shared Y axis.
148
+ - `summary.csv`: aggregated timing table.
149
+ - `meta.json`: tool versions and run parameters.
150
+ - `hyperfine-json/`: raw results from `hyperfine`.
151
+
152
+ Example benchmark figure (5x5 matrix, 5 runs per point):
153
+
154
+ ![Benchmark: ryl vs yamllint scaling (5x5 matrix, 5 runs per point)](https://raw.githubusercontent.com/owenlamont/ryl/v0.3.4/img/benchmark-5x5-5runs.svg)
155
+
156
+ ## Configuration
157
+
158
+ - Flags:
159
+ - `-c, --config-file <FILE>`: path to a YAML or TOML config file.
160
+ - `-d, --config-data <YAML>`: inline YAML config (highest precedence).
161
+ - `--list-files`: print files that would be linted after applying ignores and exit.
162
+ - `--migrate-configs`: discover legacy YAML configs and plan TOML migration.
163
+ - `--migrate-root <DIR>`: root to search for legacy YAML configs (default `.`).
164
+ - `--migrate-write`: write migrated `.ryl.toml` files (without this it is preview-only).
165
+ - `--migrate-stdout`: print generated TOML in migration mode.
166
+ - `--migrate-rename-old <SUFFIX>`: rename discovered legacy YAML config files after writing.
167
+ - `--migrate-delete-old`: delete discovered legacy YAML config files after writing.
168
+ - `-f, --format`, `-s, --strict`, `--no-warnings`: reserved for compatibility.
169
+ - Discovery precedence:
170
+ inline `--config-data` > `--config-file` > env `YAMLLINT_CONFIG_FILE`
171
+ (global) > nearest project config up the tree:
172
+ TOML (`.ryl.toml`, `ryl.toml`, `pyproject.toml` with `[tool.ryl]`) then
173
+ YAML fallback (`.yamllint`, `.yamllint.yml`, `.yamllint.yaml`)
174
+ > user-global (`$XDG_CONFIG_HOME/yamllint/config` or
175
+ `~/.config/yamllint/config`) > built-in defaults.
176
+ - TOML and YAML are not merged during discovery. If a TOML project config is
177
+ found, YAML project config discovery is skipped (and `ryl` prints a warning).
178
+ - Per-file behavior: unless a global config is set via `--config-data`,
179
+ `--config-file`, or `YAMLLINT_CONFIG_FILE`, each file discovers its nearest
180
+ project config. Ignores apply to directory scans and explicit files (parity).
181
+ - Presets and extends: supports yamllint’s built-in `default`, `relaxed`, and
182
+ `empty` via `extends`. Rule maps are deep-merged; scalars/sequences overwrite.
183
+ - TOML preset examples: see
184
+ [docs/config-presets.md](/home/owen/Code/ryl_repos/ryl/docs/config-presets.md)
185
+ for `default`/`relaxed` equivalents.
186
+
187
+ Example TOML config (`.ryl.toml`):
188
+
189
+ ```toml
190
+ yaml-files = ["*.yaml", "*.yml"]
191
+ ignore = ["vendor/**", "generated/**"]
192
+ locale = "en_US.UTF-8"
193
+
194
+ [rules]
195
+ document-start = "disable"
196
+
197
+ [rules.line-length]
198
+ max = 120
199
+
200
+ [rules.truthy]
201
+ allowed-values = ["true", "false"]
202
+ ```
203
+
204
+ Migration example:
205
+
206
+ ```text
207
+ # Preview migration actions
208
+ ryl --migrate-configs --migrate-root .
209
+
210
+ # Write .ryl.toml files and keep old files with a suffix
211
+ ryl --migrate-configs --migrate-root . --migrate-write --migrate-rename-old .bak
212
+ ```
213
+
214
+ ## Acknowledgements
215
+
216
+ This project exists thanks to the tooling and ecosystems around YAML linting and
217
+ developer automation, especially:
218
+
219
+ - [yamllint](https://github.com/adrienverge/yamllint) - for giving me the shoulders to
220
+ stand on and the source of many of the automated tests that ryl uses now to check for
221
+ behaviour parity. Copying the behaviour of an existing tool is infinitely easier than
222
+ building one from scratch - there'd be no ryl without yamllint.
223
+ - [ruff](https://github.com/astral-sh/ruff) - for showing the power of Rust tooling for
224
+ Python development and inspiring the config and API for ryl.
225
+ - [rumdl](https://github.com/rvben/rumdl) - for giving me another template to follow for
226
+ Rust tooling and showing me almost the only dev tool I was still using after this that
227
+ wasn't written in Rust was yamllint (which inspired me to tackle this project)
228
+ - [saphyr](https://github.com/saphyr-rs/saphyr) - ryl is built on saphyr and saphyr's
229
+ developers were very patient in showing some of the nuance and complexity of parsing
230
+ YAML which I was embarrassingly ignorant of when start ryl.
package/bin/ryl.js ADDED
@@ -0,0 +1 @@
1
+ console.log('Initializing ryl...');
package/clippy.toml ADDED
@@ -0,0 +1 @@
1
+ msrv = "1.93.1"
@@ -0,0 +1,100 @@
1
+ # ryl config presets (TOML)
2
+
3
+ These TOML presets mirror the built-in YAML presets in `ryl` (`default`,
4
+ `relaxed`, `empty`) from [src/conf/mod.rs](/home/owen/Code/ryl_repos/ryl/src/conf/mod.rs).
5
+
6
+ ## `default` (TOML equivalent)
7
+
8
+ ```toml
9
+ yaml-files = ["*.yaml", "*.yml", ".yamllint"]
10
+
11
+ [rules]
12
+ anchors = "enable"
13
+ braces = "enable"
14
+ brackets = "enable"
15
+ colons = "enable"
16
+ commas = "enable"
17
+ document-end = "disable"
18
+ empty-lines = "enable"
19
+ empty-values = "disable"
20
+ float-values = "disable"
21
+ hyphens = "enable"
22
+ indentation = "enable"
23
+ key-duplicates = "enable"
24
+ key-ordering = "disable"
25
+ line-length = "enable"
26
+ new-line-at-end-of-file = "enable"
27
+ new-lines = "enable"
28
+ octal-values = "disable"
29
+ quoted-strings = "disable"
30
+ trailing-spaces = "enable"
31
+
32
+ [rules.comments]
33
+ level = "warning"
34
+
35
+ [rules.comments-indentation]
36
+ level = "warning"
37
+
38
+ [rules.document-start]
39
+ level = "warning"
40
+
41
+ [rules.truthy]
42
+ level = "warning"
43
+ ```
44
+
45
+ ## `relaxed` (TOML equivalent, fully expanded)
46
+
47
+ ```toml
48
+ yaml-files = ["*.yaml", "*.yml", ".yamllint"]
49
+
50
+ [rules]
51
+ anchors = "enable"
52
+ comments = "disable"
53
+ comments-indentation = "disable"
54
+ document-end = "disable"
55
+ document-start = "disable"
56
+ empty-values = "disable"
57
+ float-values = "disable"
58
+ key-duplicates = "enable"
59
+ key-ordering = "disable"
60
+ new-line-at-end-of-file = "enable"
61
+ new-lines = "enable"
62
+ octal-values = "disable"
63
+ quoted-strings = "disable"
64
+ trailing-spaces = "enable"
65
+ truthy = "disable"
66
+
67
+ [rules.braces]
68
+ level = "warning"
69
+ max-spaces-inside = 1
70
+
71
+ [rules.brackets]
72
+ level = "warning"
73
+ max-spaces-inside = 1
74
+
75
+ [rules.colons]
76
+ level = "warning"
77
+
78
+ [rules.commas]
79
+ level = "warning"
80
+
81
+ [rules.empty-lines]
82
+ level = "warning"
83
+
84
+ [rules.hyphens]
85
+ level = "warning"
86
+
87
+ [rules.indentation]
88
+ level = "warning"
89
+ indent-sequences = "consistent"
90
+
91
+ [rules.line-length]
92
+ level = "warning"
93
+ allow-non-breakable-inline-mappings = true
94
+ ```
95
+
96
+ ## `empty` (TOML equivalent)
97
+
98
+ ```toml
99
+ [rules]
100
+ ```