zackstrap 1.5.1

A CLI tool to bootstrap project configuration files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
use assert_fs::prelude::*;
use assert_fs::TempDir;
use zackstrap::ConfigGenerator;

#[tokio::test]
async fn test_generate_basic_config() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test basic generation
    generator.generate_basic(true).await.unwrap();

    // Verify files were created
    temp_dir
        .child(".editorconfig")
        .assert(predicates::path::exists());
    temp_dir
        .child(".prettierrc")
        .assert(predicates::path::exists());
    // Verify .editorconfig content
    let editor_config = std::fs::read_to_string(temp_dir.child(".editorconfig").path()).unwrap();
    assert!(editor_config.contains("root = true"));
    assert!(editor_config.contains("charset = utf-8"));
    assert!(editor_config.contains("end_of_line = lf"));
    // Verify .prettierrc content
    let prettier_config = std::fs::read_to_string(temp_dir.child(".prettierrc").path()).unwrap();
    assert!(prettier_config.contains("\"semi\": true"));
    assert!(prettier_config.contains("\"singleQuote\": true"));
}

#[tokio::test]
async fn test_generate_ruby_config() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Ruby generation
    generator.generate_ruby().await.unwrap();

    // Verify all files were created
    temp_dir
        .child(".editorconfig")
        .assert(predicates::path::exists());
    temp_dir
        .child(".prettierrc")
        .assert(predicates::path::exists());
    temp_dir
        .child(".ruby-version")
        .assert(predicates::path::exists());
    temp_dir
        .child(".node-version")
        .assert(predicates::path::exists());
    temp_dir
        .child(".rubocop.yml")
        .assert(predicates::path::exists());
    temp_dir
        .child("package.json")
        .assert(predicates::path::exists());
    // Verify Ruby-specific content
    let ruby_version = std::fs::read_to_string(temp_dir.child(".ruby-version").path()).unwrap();
    assert_eq!(ruby_version.trim(), "3.4.9");

    let node_version = std::fs::read_to_string(temp_dir.child(".node-version").path()).unwrap();
    assert_eq!(node_version.trim(), "25.9.0");

    let package_json = std::fs::read_to_string(temp_dir.child("package.json").path()).unwrap();
    assert!(package_json.contains("prettier-plugin-ruby"));
    assert!(package_json.contains("github:prettier/plugin-ruby"));

    let rubocop_config = std::fs::read_to_string(temp_dir.child(".rubocop.yml").path()).unwrap();
    assert!(rubocop_config.contains("TargetRubyVersion: 3.3"));
    assert!(rubocop_config.contains("Max: 120"));
}

#[tokio::test]
async fn test_generate_python_config() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Python generation
    generator
        .generate_python_with_template("default")
        .await
        .unwrap();

    // Verify all files were created
    temp_dir
        .child(".editorconfig")
        .assert(predicates::path::exists());
    temp_dir
        .child(".prettierrc")
        .assert(predicates::path::exists());
    temp_dir
        .child(".python-version")
        .assert(predicates::path::exists());
    temp_dir
        .child("pyproject.toml")
        .assert(predicates::path::exists());
    temp_dir.child(".flake8").assert(predicates::path::exists());
    temp_dir
        .child("requirements-dev.txt")
        .assert(predicates::path::exists());

    // Verify Python-specific content
    let python_version = std::fs::read_to_string(temp_dir.child(".python-version").path()).unwrap();
    assert_eq!(python_version.trim(), "3.12");

    let pyproject_toml = std::fs::read_to_string(temp_dir.child("pyproject.toml").path()).unwrap();
    assert!(pyproject_toml.contains("line-length = 88"));
    assert!(pyproject_toml.contains("target-version = ['py312']"));
    assert!(pyproject_toml.contains("strict = true"));

    let flake8_config = std::fs::read_to_string(temp_dir.child(".flake8").path()).unwrap();
    assert!(flake8_config.contains("max-line-length = 88"));
    assert!(flake8_config.contains("extend-ignore = E203, W503"));

    let requirements_dev =
        std::fs::read_to_string(temp_dir.child("requirements-dev.txt").path()).unwrap();
    assert!(requirements_dev.contains("black=="));
    assert!(requirements_dev.contains("flake8=="));
    assert!(requirements_dev.contains("mypy=="));
    assert!(requirements_dev.contains("pytest=="));
}

#[tokio::test]
async fn test_generate_python_config_with_templates() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Django template
    generator
        .generate_python_with_template("django")
        .await
        .unwrap();
    let pyproject_toml = std::fs::read_to_string(temp_dir.child("pyproject.toml").path()).unwrap();
    assert!(pyproject_toml.contains("django_settings_module"));

    // Clean and test Flask template
    std::fs::remove_file(temp_dir.child("pyproject.toml").path()).unwrap();
    std::fs::remove_file(temp_dir.child("justfile").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".editorconfig").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".prettierrc").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".python-version").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".flake8").path()).unwrap();
    std::fs::remove_file(temp_dir.child("requirements-dev.txt").path()).unwrap();
    generator
        .generate_python_with_template("flask")
        .await
        .unwrap();
    let pyproject_toml = std::fs::read_to_string(temp_dir.child("pyproject.toml").path()).unwrap();
    assert!(pyproject_toml.contains("app_name = \"app\""));
}

#[tokio::test]
async fn test_generate_node_config() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Node.js generation
    generator
        .generate_node_with_template("default")
        .await
        .unwrap();

    // Verify all files were created
    temp_dir
        .child(".editorconfig")
        .assert(predicates::path::exists());
    temp_dir
        .child(".prettierrc")
        .assert(predicates::path::exists());
    temp_dir.child(".nvmrc").assert(predicates::path::exists());
    temp_dir
        .child(".eslintrc.json")
        .assert(predicates::path::exists());
    temp_dir
        .child("package.json")
        .assert(predicates::path::exists());

    // Verify Node.js-specific content
    let nvmrc = std::fs::read_to_string(temp_dir.child(".nvmrc").path()).unwrap();
    assert_eq!(nvmrc.trim(), "20");

    let eslint_config = std::fs::read_to_string(temp_dir.child(".eslintrc.json").path()).unwrap();
    assert!(eslint_config.contains("es2021"));
    assert!(eslint_config.contains("browser"));
    assert!(eslint_config.contains("node"));

    let package_json = std::fs::read_to_string(temp_dir.child("package.json").path()).unwrap();
    assert!(package_json.contains("node-app"));
    assert!(package_json.contains("0.1.0"));
}

#[tokio::test]
async fn test_generate_node_config_with_templates() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Express template — server-side, so no "browser" env
    generator
        .generate_node_with_template("express")
        .await
        .unwrap();
    let eslint_config = std::fs::read_to_string(temp_dir.child(".eslintrc.json").path()).unwrap();
    assert!(eslint_config.contains("es2021"));
    assert!(eslint_config.contains("node"));
    assert!(eslint_config.contains("no-console"));

    // Clean and test React template — client-side, has "browser" and jsx
    std::fs::remove_file(temp_dir.child(".eslintrc.json").path()).unwrap();
    std::fs::remove_file(temp_dir.child("package.json").path()).unwrap();
    std::fs::remove_file(temp_dir.child("justfile").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".editorconfig").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".prettierrc").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".nvmrc").path()).unwrap();
    generator
        .generate_node_with_template("react")
        .await
        .unwrap();
    let eslint_config = std::fs::read_to_string(temp_dir.child(".eslintrc.json").path()).unwrap();
    assert!(eslint_config.contains("es2021"));
    assert!(eslint_config.contains("browser"));
    assert!(eslint_config.contains("jsx"));
}

#[tokio::test]
async fn test_generate_go_config() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Go generation
    generator
        .generate_go_with_template("default")
        .await
        .unwrap();

    // Verify all files were created
    temp_dir
        .child(".editorconfig")
        .assert(predicates::path::exists());
    temp_dir
        .child(".prettierrc")
        .assert(predicates::path::exists());
    temp_dir.child("go.mod").assert(predicates::path::exists());
    temp_dir
        .child(".golangci.yml")
        .assert(predicates::path::exists());

    // Verify Go-specific content
    let go_mod = std::fs::read_to_string(temp_dir.child("go.mod").path()).unwrap();
    assert!(go_mod.contains("module myproject"));
    assert!(go_mod.contains("go 1.21"));

    let golangci_config = std::fs::read_to_string(temp_dir.child(".golangci.yml").path()).unwrap();
    assert!(golangci_config.contains("gofmt"));
    assert!(golangci_config.contains("golint"));
    assert!(golangci_config.contains("govet"));
    assert!(golangci_config.contains("errcheck"));
}

#[tokio::test]
async fn test_generate_go_config_with_templates() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test web template
    generator
        .generate_go_with_template("web")
        .await
        .unwrap();
    let justfile = std::fs::read_to_string(temp_dir.child("justfile").path()).unwrap();
    assert!(justfile.contains("go-web"));

    // Clean and test CLI template
    std::fs::remove_file(temp_dir.child("justfile").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".editorconfig").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".prettierrc").path()).unwrap();
    std::fs::remove_file(temp_dir.child("go.mod").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".golangci.yml").path()).unwrap();
    // Note: .gitignore is updated, not created, so we don't remove it
    let force_generator = ConfigGenerator::with_options(temp_dir.path().to_path_buf(), false, true);
    force_generator
        .generate_go_with_template("cli")
        .await
        .unwrap();
    let justfile = std::fs::read_to_string(temp_dir.child("justfile").path()).unwrap();
    assert!(justfile.contains("go-cli"));
}

#[tokio::test]
async fn test_generate_rust_config() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Rust generation
    generator
        .generate_rust_with_template("default")
        .await
        .unwrap();

    // Verify all files were created
    temp_dir
        .child(".editorconfig")
        .assert(predicates::path::exists());
    temp_dir
        .child(".prettierrc")
        .assert(predicates::path::exists());
    temp_dir
        .child("rustfmt.toml")
        .assert(predicates::path::exists());
    temp_dir
        .child(".clippy.toml")
        .assert(predicates::path::exists());
    temp_dir
        .child(".cargo/config.toml")
        .assert(predicates::path::exists());

    // Verify Rust-specific content
    let rustfmt_config = std::fs::read_to_string(temp_dir.child("rustfmt.toml").path()).unwrap();
    assert!(rustfmt_config.contains("edition = \"2021\""));
    assert!(rustfmt_config.contains("max_width = 100"));

    let cargo_config =
        std::fs::read_to_string(temp_dir.child(".cargo/config.toml").path()).unwrap();
    assert!(cargo_config.contains("target-cpu=native"));
}

#[tokio::test]
async fn test_generate_rust_config_with_templates() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test web template
    generator
        .generate_rust_with_template("web")
        .await
        .unwrap();
    let justfile = std::fs::read_to_string(temp_dir.child("justfile").path()).unwrap();
    assert!(justfile.contains("cargo-web"));

    // Clean and test CLI template
    std::fs::remove_file(temp_dir.child("justfile").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".editorconfig").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".prettierrc").path()).unwrap();
    std::fs::remove_file(temp_dir.child("rustfmt.toml").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".clippy.toml").path()).unwrap();
    std::fs::remove_dir_all(temp_dir.child(".cargo").path()).unwrap();
    generator
        .generate_rust_with_template("cli")
        .await
        .unwrap();
    let justfile = std::fs::read_to_string(temp_dir.child("justfile").path()).unwrap();
    assert!(justfile.contains("cargo-cli"));
}

#[tokio::test]
async fn test_generate_bash_config() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Bash generation
    generator
        .generate_bash_with_template("default")
        .await
        .unwrap();

    // Verify all files were created
    temp_dir
        .child(".editorconfig")
        .assert(predicates::path::exists());
    temp_dir
        .child(".prettierrc")
        .assert(predicates::path::exists());
    temp_dir
        .child(".shellcheckrc")
        .assert(predicates::path::exists());
    temp_dir
        .child("justfile")
        .assert(predicates::path::exists());

    // Verify Bash-specific content
    let shellcheckrc = std::fs::read_to_string(temp_dir.child(".shellcheckrc").path()).unwrap();
    assert!(shellcheckrc.contains("shell=bash"));
    assert!(shellcheckrc.contains("enable=require-variable-braces"));
    assert!(shellcheckrc.contains("disable=SC1091"));

    let justfile = std::fs::read_to_string(temp_dir.child("justfile").path()).unwrap();
    assert!(justfile.contains("ShellCheck"));
    assert!(justfile.contains("shfmt"));
    assert!(justfile.contains("bats"));
}

#[tokio::test]
async fn test_generate_bash_config_with_templates() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test devops template
    generator
        .generate_bash_with_template("devops")
        .await
        .unwrap();
    let justfile = std::fs::read_to_string(temp_dir.child("justfile").path()).unwrap();
    assert!(justfile.contains("DevOps"));
    assert!(justfile.contains("deploy"));

    // Clean and test CLI template
    std::fs::remove_file(temp_dir.child("justfile").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".editorconfig").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".prettierrc").path()).unwrap();
    std::fs::remove_file(temp_dir.child(".shellcheckrc").path()).unwrap();
    generator
        .generate_bash_with_template("cli")
        .await
        .unwrap();
    let justfile = std::fs::read_to_string(temp_dir.child("justfile").path()).unwrap();
    assert!(justfile.contains("CLI"));
    assert!(justfile.contains("main.sh"));
    assert!(justfile.contains("install"));
}

#[tokio::test]
async fn test_project_type_detection() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Python detection
    std::fs::write(temp_dir.child("main.py").path(), "print('Hello')").unwrap();
    let project_type = generator.detect_project_type().await.unwrap();
    assert!(matches!(project_type, zackstrap::ProjectType::Python));

    // Test Node.js detection
    std::fs::remove_file(temp_dir.child("main.py").path()).unwrap();
    std::fs::write(temp_dir.child("package.json").path(), "{}").unwrap();
    let project_type = generator.detect_project_type().await.unwrap();
    assert!(matches!(project_type, zackstrap::ProjectType::Node));

    // Test Go detection
    std::fs::remove_file(temp_dir.child("package.json").path()).unwrap();
    std::fs::write(temp_dir.child("main.go").path(), "package main").unwrap();
    let project_type = generator.detect_project_type().await.unwrap();
    assert!(matches!(project_type, zackstrap::ProjectType::Go));

    // Test Rust detection
    std::fs::remove_file(temp_dir.child("main.go").path()).unwrap();
    std::fs::write(temp_dir.child("main.rs").path(), "fn main() {}").unwrap();
    let project_type = generator.detect_project_type().await.unwrap();
    assert!(matches!(project_type, zackstrap::ProjectType::Rust));

    // Test Ruby detection
    std::fs::remove_file(temp_dir.child("main.rs").path()).unwrap();
    std::fs::write(
        temp_dir.child("Gemfile").path(),
        "source 'https://rubygems.org'",
    )
    .unwrap();
    let project_type = generator.detect_project_type().await.unwrap();
    assert!(matches!(project_type, zackstrap::ProjectType::Ruby));

    // Test Bash detection
    std::fs::remove_file(temp_dir.child("Gemfile").path()).unwrap();
    std::fs::write(temp_dir.child(".shellcheckrc").path(), "shell=bash").unwrap();
    let project_type = generator.detect_project_type().await.unwrap();
    assert!(matches!(project_type, zackstrap::ProjectType::Bash));

    // Test basic detection (default)
    std::fs::remove_file(temp_dir.child(".shellcheckrc").path()).unwrap();
    let project_type = generator.detect_project_type().await.unwrap();
    assert!(matches!(project_type, zackstrap::ProjectType::Basic));
}

#[tokio::test]
async fn test_dry_run_modes() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::with_options(temp_dir.path().to_path_buf(), true, false);

    // Test Python dry run
    generator
        .generate_python_with_template("default")
        .await
        .unwrap();

    // Test Node.js dry run
    generator
        .generate_node_with_template("default")
        .await
        .unwrap();

    // Test Go dry run
    generator.generate_go_with_template("default").await.unwrap();

    // Test Rust dry run
    generator
        .generate_rust_with_template("default")
        .await
        .unwrap();

    // Test Bash dry run
    generator
        .generate_bash_with_template("default")
        .await
        .unwrap();

    // Verify no files were actually created
    assert!(!temp_dir.child(".python-version").exists());
    assert!(!temp_dir.child(".nvmrc").exists());
    assert!(!temp_dir.child("go.mod").exists());
    assert!(!temp_dir.child("rustfmt.toml").exists());
    assert!(!temp_dir.child(".shellcheckrc").exists());
}

#[tokio::test]
async fn test_force_overwrite_for_new_languages() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Test Python force overwrite - language projects use fail_on_exists=false, so they succeed on second generation
    generator
        .generate_python_with_template("default")
        .await
        .unwrap();
    // Second generation should succeed (fail_on_exists=false for language projects)
    let result = generator
        .generate_python_with_template("default")
        .await;
    assert!(result.is_ok());
    // Force overwrite should also succeed
    let force_gen = ConfigGenerator::with_options(temp_dir.path().to_path_buf(), false, true);
    force_gen
        .generate_python_with_template("default")
        .await
        .unwrap();

    // Test Node.js force overwrite - language projects use fail_on_exists=false, so they succeed on second generation
    let _ = std::fs::remove_file(temp_dir.child("package.json").path());
    let _ = std::fs::remove_file(temp_dir.child(".nvmrc").path());
    let _ = std::fs::remove_file(temp_dir.child(".eslintrc.json").path());
    let _ = std::fs::remove_file(temp_dir.child("justfile").path());
    let _ = std::fs::remove_file(temp_dir.child(".editorconfig").path());
    let _ = std::fs::remove_file(temp_dir.child(".prettierrc").path());
    generator
        .generate_node_with_template("default")
        .await
        .unwrap();
    // Second generation should succeed (fail_on_exists=false for language projects)
    let result = generator
        .generate_node_with_template("default")
        .await;
    assert!(result.is_ok());
    // Force overwrite should also succeed
    let force_gen2 = ConfigGenerator::with_options(temp_dir.path().to_path_buf(), false, true);
    force_gen2
        .generate_node_with_template("default")
        .await
        .unwrap();
}

#[tokio::test]
async fn test_force_overwrite() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    // Create initial config
    generator.generate_basic(true).await.unwrap();

    // Try to generate again without force - should fail
    let result = generator.generate_basic(true).await;
    assert!(result.is_err());

    // Generate with force - should succeed
    let force_generator = ConfigGenerator::with_options(temp_dir.path().to_path_buf(), false, true);
    force_generator.generate_basic(true).await.unwrap();
}

#[tokio::test]
async fn test_editor_config_sections() {
    let temp_dir = TempDir::new().unwrap();
    let generator = ConfigGenerator::new(temp_dir.path().to_path_buf());

    generator.generate_basic(true).await.unwrap();

    let editor_config = std::fs::read_to_string(temp_dir.child(".editorconfig").path()).unwrap();

    // Check for default section
    assert!(editor_config.contains("[*]"));
    assert!(editor_config.contains("indent_style = space"));
    assert!(editor_config.contains("indent_size = 2"));

    // Check for Ruby section
    assert!(editor_config.contains("[*.{rb,erb,ru,rake,gemspec}]"));

    // Check for JavaScript/TypeScript section
    assert!(editor_config.contains("[*.{yml,yaml,haml,jbuilder,jsx,html,sls,tf}]"));

    // makefiles
    assert!(editor_config.contains("[{*[Mm]akefile*,*.mak,*.mk,depend}]"));

    // enc/
    assert!(editor_config.contains("[enc/*]"));

    // reg  *.[ch]
    assert!(editor_config.contains("[reg*.[ch]]"));
}