yamlint 0.1.0 → 1.0.0

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 (136) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +31 -9
  3. data/.serena/.gitignore +1 -0
  4. data/.serena/memories/project_overview.md +25 -0
  5. data/.serena/memories/style_and_conventions.md +7 -0
  6. data/.serena/memories/suggested_commands.md +17 -0
  7. data/.serena/memories/task_completion.md +5 -0
  8. data/.serena/project.yml +89 -0
  9. data/CHANGELOG.md +6 -2
  10. data/Gemfile +9 -7
  11. data/LICENSE.txt +1 -1
  12. data/README.md +155 -17
  13. data/Rakefile +10 -3
  14. data/docs/Yamlint/Cli.html +403 -0
  15. data/docs/Yamlint/Config.html +1034 -0
  16. data/docs/Yamlint/Formatter.html +433 -0
  17. data/docs/Yamlint/Linter.html +423 -0
  18. data/docs/Yamlint/Models/LintContext.html +993 -0
  19. data/docs/Yamlint/Models/Problem.html +951 -0
  20. data/docs/Yamlint/Models/Token.html +713 -0
  21. data/docs/Yamlint/Models.html +117 -0
  22. data/docs/Yamlint/Output/Base.html +290 -0
  23. data/docs/Yamlint/Output/Colored.html +293 -0
  24. data/docs/Yamlint/Output/Github.html +260 -0
  25. data/docs/Yamlint/Output/Parsable.html +258 -0
  26. data/docs/Yamlint/Output/Standard.html +270 -0
  27. data/docs/Yamlint/Output.html +208 -0
  28. data/docs/Yamlint/Parser/Comment.html +795 -0
  29. data/docs/Yamlint/Parser/CommentExtractor.html +287 -0
  30. data/docs/Yamlint/Parser/LineParser.html +423 -0
  31. data/docs/Yamlint/Parser/TokenParser/Handler.html +910 -0
  32. data/docs/Yamlint/Parser/TokenParser.html +291 -0
  33. data/docs/Yamlint/Parser.html +117 -0
  34. data/docs/Yamlint/Presets.html +266 -0
  35. data/docs/Yamlint/Rules/Anchors/AnchorHandler.html +678 -0
  36. data/docs/Yamlint/Rules/Anchors.html +314 -0
  37. data/docs/Yamlint/Rules/Base.html +968 -0
  38. data/docs/Yamlint/Rules/Braces.html +335 -0
  39. data/docs/Yamlint/Rules/Brackets.html +335 -0
  40. data/docs/Yamlint/Rules/Colons.html +313 -0
  41. data/docs/Yamlint/Rules/Commas.html +313 -0
  42. data/docs/Yamlint/Rules/CommentRule.html +298 -0
  43. data/docs/Yamlint/Rules/Comments.html +317 -0
  44. data/docs/Yamlint/Rules/CommentsIndentation.html +328 -0
  45. data/docs/Yamlint/Rules/DocumentEnd.html +332 -0
  46. data/docs/Yamlint/Rules/DocumentStart.html +332 -0
  47. data/docs/Yamlint/Rules/EmptyLines.html +300 -0
  48. data/docs/Yamlint/Rules/EmptyValues.html +273 -0
  49. data/docs/Yamlint/Rules/FloatValues.html +383 -0
  50. data/docs/Yamlint/Rules/Hyphens.html +337 -0
  51. data/docs/Yamlint/Rules/Indentation.html +329 -0
  52. data/docs/Yamlint/Rules/KeyDuplicates/DuplicateKeyHandler.html +716 -0
  53. data/docs/Yamlint/Rules/KeyDuplicates.html +258 -0
  54. data/docs/Yamlint/Rules/KeyOrdering/KeyOrderHandler.html +694 -0
  55. data/docs/Yamlint/Rules/KeyOrdering.html +258 -0
  56. data/docs/Yamlint/Rules/LineLength.html +251 -0
  57. data/docs/Yamlint/Rules/LineRule.html +304 -0
  58. data/docs/Yamlint/Rules/NewLineAtEndOfFile.html +308 -0
  59. data/docs/Yamlint/Rules/NewLines.html +310 -0
  60. data/docs/Yamlint/Rules/OctalValues.html +270 -0
  61. data/docs/Yamlint/Rules/QuotedStrings.html +381 -0
  62. data/docs/Yamlint/Rules/Registry.html +492 -0
  63. data/docs/Yamlint/Rules/TokenRule.html +298 -0
  64. data/docs/Yamlint/Rules/TrailingSpaces.html +321 -0
  65. data/docs/Yamlint/Rules/Truthy.html +288 -0
  66. data/docs/Yamlint/Rules.html +190 -0
  67. data/docs/Yamlint/Runner.html +551 -0
  68. data/docs/Yamlint.html +135 -0
  69. data/docs/_index.html +643 -0
  70. data/docs/class_list.html +54 -0
  71. data/docs/css/common.css +1 -0
  72. data/docs/css/full_list.css +58 -0
  73. data/docs/css/style.css +490 -0
  74. data/docs/file.README.html +276 -0
  75. data/docs/file_list.html +59 -0
  76. data/docs/frames.html +22 -0
  77. data/docs/index.html +276 -0
  78. data/docs/js/app.js +395 -0
  79. data/docs/js/full_list.js +244 -0
  80. data/docs/js/jquery.js +4 -0
  81. data/docs/method_list.html +1582 -0
  82. data/docs/top-level-namespace.html +110 -0
  83. data/exe/yamlint +7 -0
  84. data/lib/yamlint/cli.rb +162 -0
  85. data/lib/yamlint/config.rb +113 -0
  86. data/lib/yamlint/formatter.rb +140 -0
  87. data/lib/yamlint/linter.rb +130 -0
  88. data/lib/yamlint/models/lint_context.rb +43 -0
  89. data/lib/yamlint/models/problem.rb +44 -0
  90. data/lib/yamlint/models/token.rb +22 -0
  91. data/lib/yamlint/models.rb +9 -0
  92. data/lib/yamlint/output/base.rb +15 -0
  93. data/lib/yamlint/output/colored.rb +54 -0
  94. data/lib/yamlint/output/github.rb +20 -0
  95. data/lib/yamlint/output/parsable.rb +19 -0
  96. data/lib/yamlint/output/standard.rb +25 -0
  97. data/lib/yamlint/output.rb +26 -0
  98. data/lib/yamlint/parser/comment_extractor.rb +78 -0
  99. data/lib/yamlint/parser/line_parser.rb +30 -0
  100. data/lib/yamlint/parser/token_parser.rb +92 -0
  101. data/lib/yamlint/parser.rb +10 -0
  102. data/lib/yamlint/presets/default.rb +35 -0
  103. data/lib/yamlint/presets/relaxed.rb +34 -0
  104. data/lib/yamlint/presets.rb +19 -0
  105. data/lib/yamlint/rules/anchors.rb +133 -0
  106. data/lib/yamlint/rules/base.rb +102 -0
  107. data/lib/yamlint/rules/braces.rb +105 -0
  108. data/lib/yamlint/rules/brackets.rb +105 -0
  109. data/lib/yamlint/rules/colons.rb +73 -0
  110. data/lib/yamlint/rules/commas.rb +85 -0
  111. data/lib/yamlint/rules/comments.rb +77 -0
  112. data/lib/yamlint/rules/comments_indentation.rb +66 -0
  113. data/lib/yamlint/rules/document_end.rb +45 -0
  114. data/lib/yamlint/rules/document_start.rb +45 -0
  115. data/lib/yamlint/rules/empty_lines.rb +107 -0
  116. data/lib/yamlint/rules/empty_values.rb +43 -0
  117. data/lib/yamlint/rules/float_values.rb +67 -0
  118. data/lib/yamlint/rules/hyphens.rb +42 -0
  119. data/lib/yamlint/rules/indentation.rb +39 -0
  120. data/lib/yamlint/rules/key_duplicates.rb +127 -0
  121. data/lib/yamlint/rules/key_ordering.rb +126 -0
  122. data/lib/yamlint/rules/line_length.rb +57 -0
  123. data/lib/yamlint/rules/new_line_at_end_of_file.rb +31 -0
  124. data/lib/yamlint/rules/new_lines.rb +59 -0
  125. data/lib/yamlint/rules/octal_values.rb +62 -0
  126. data/lib/yamlint/rules/quoted_strings.rb +73 -0
  127. data/lib/yamlint/rules/registry.rb +48 -0
  128. data/lib/yamlint/rules/trailing_spaces.rb +31 -0
  129. data/lib/yamlint/rules/truthy.rb +48 -0
  130. data/lib/yamlint/rules.rb +41 -0
  131. data/lib/yamlint/runner.rb +80 -0
  132. data/lib/yamlint/version.rb +1 -1
  133. data/lib/yamlint.rb +11 -3
  134. metadata +131 -11
  135. data/CODE_OF_CONDUCT.md +0 -84
  136. data/sig/yamlint.rbs +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ba199cae535ca4513781fcfbcc290cf199f4470d6c95468fd0121b5dc8b41ec
4
- data.tar.gz: 922d412334c7b62e4f02f6cdfa2c778d7133fd27db603b8b2e6b524c6b3d2e08
3
+ metadata.gz: 30f54142723326b9a7faf55cbe53f35c515f9f1465ab237bb172594abf1dff83
4
+ data.tar.gz: 8ef8637b0a0d7f92f1782d6be1afc96be22fd5009f0cba0066a835566e75f332
5
5
  SHA512:
6
- metadata.gz: 61038214855e6ec9e8656efd4c8c199b471c946b417e4284292eac875e76c0d38537915cae4ef658e971fb0fa688eee263d0771d0171ba035c5a130d9cf7674d
7
- data.tar.gz: 134057a5a2293d500c22d9c595f2c09f5ef07e60f55c4a87ee5ffbd9277f9b53711f6e647eb852ab17acfef7436d33568588a6e1f5c7d6f521f8b5343fe359e3
6
+ metadata.gz: 265a6207b6254d8f996564887f86d40a66f51a34437e6c7971e7bfedeedd971b93cd1c9297cb753ccecda7fadf10cb9234b1bc9fef78d88a8354bc3c1d852c7f
7
+ data.tar.gz: dc1d831da8b73704d3f3afaae658d8599c140060751d683e6a25168dc265cc7f882f7d2464559b2b04f85240761a8b09dddfc78580e237a11731adc45006ecf2
data/.rubocop.yml CHANGED
@@ -1,13 +1,35 @@
1
+ plugins:
2
+ - rubocop-performance
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+
1
6
  AllCops:
2
- TargetRubyVersion: 2.6
7
+ NewCops: enable
8
+ TargetRubyVersion: 3.1
9
+
10
+ Metrics:
11
+ Enabled: false
12
+
13
+ RSpec/ExampleLength:
14
+ Enabled: false
15
+
16
+ RSpec/ImplicitSubject:
17
+ Enabled: false
18
+
19
+ RSpec/NamedSubject:
20
+ Enabled: false
21
+
22
+ Style/Documentation:
23
+ Enabled: false
3
24
 
4
- Style/StringLiterals:
5
- Enabled: true
6
- EnforcedStyle: double_quotes
25
+ RSpec/MultipleExpectations:
26
+ Max: 2
7
27
 
8
- Style/StringLiteralsInInterpolation:
9
- Enabled: true
10
- EnforcedStyle: double_quotes
28
+ RSpec/NestedGroups:
29
+ Max: 4
11
30
 
12
- Layout/LineLength:
13
- Max: 120
31
+ RSpec/SpecFilePathFormat:
32
+ Exclude:
33
+ - '**/spec/routing/**/*'
34
+ - 'spec/yamlint/parser/comment_extractor_spec.rb'
35
+ - 'spec/yamlint/rules/base_spec.rb'
@@ -0,0 +1 @@
1
+ /cache
@@ -0,0 +1,25 @@
1
+ # yamlint project overview
2
+
3
+ ## Purpose
4
+ - Pure-Ruby YAML linter and formatter, inspired by Python's `adrienverge/yamllint`.
5
+ - Provides CLI linting and auto-fix formatting with yamllint-compatible config intent.
6
+
7
+ ## Tech stack
8
+ - Ruby gem (Ruby >= 3.1; `.ruby-version` is 3.4.8).
9
+ - Testing: RSpec.
10
+ - Linting: RuboCop (+ performance/rake/rspec plugins).
11
+
12
+ ## Rough structure
13
+ - `lib/yamlint/`: core implementation
14
+ - `cli.rb`, `runner.rb`: CLI entry logic
15
+ - `linter.rb`, `formatter.rb`, `config.rb`
16
+ - `parser/`, `rules/`, `models/`, `output/`, `presets/`
17
+ - `exe/yamlint`: gem executable entrypoint
18
+ - `bin/`: developer scripts (`setup`, `console`, `checker`)
19
+ - `spec/`: RSpec test suite
20
+ - `docs/`: generated documentation
21
+ - `yamlint.gemspec`, `Gemfile`, `Rakefile`: gem/build config
22
+
23
+ ## Architecture notes
24
+ Design doc (`ruby_yamllint_design_and_instructions.md`) describes layered architecture:
25
+ CLI -> core (linter/formatter/config) -> rules registry -> parser -> models.
@@ -0,0 +1,7 @@
1
+ # Style and conventions
2
+
3
+ - Ruby codebase with `# frozen_string_literal: true` headers.
4
+ - RuboCop enabled (plugins: performance, rake, rspec); metrics cops disabled; documentation cop disabled.
5
+ - RSpec used for tests; no strict example length/subject cops.
6
+ - Target Ruby version in RuboCop: 3.1; project `.ruby-version` is 3.4.8.
7
+ - Standard Ruby gem layout and naming under `lib/yamlint`.
@@ -0,0 +1,17 @@
1
+ # Suggested commands
2
+
3
+ ## Setup
4
+ - `bin/setup` (install dependencies)
5
+
6
+ ## Tests
7
+ - `bundle exec rake spec`
8
+ - `bundle exec rake` (default runs `spec` and `rubocop`)
9
+
10
+ ## Linting
11
+ - `bundle exec rubocop`
12
+ - `bundle exec rake rubocop`
13
+
14
+ ## Run CLI / console
15
+ - `bundle exec exe/yamlint ...` (gem executable)
16
+ - `bin/console` (interactive)
17
+ - `bin/checker <files...>` (simple YAML load checker)
@@ -0,0 +1,5 @@
1
+ # Task completion checklist
2
+
3
+ - Run `bundle exec rake` (or at least `bundle exec rake spec` + `bundle exec rubocop`).
4
+ - Update/add RSpec coverage for behavior changes.
5
+ - If altering CLI or config behavior, consider updating docs or README as needed.
@@ -0,0 +1,89 @@
1
+ # list of languages for which language servers are started; choose from:
2
+ # al bash clojure cpp csharp
3
+ # csharp_omnisharp dart elixir elm erlang
4
+ # fortran fsharp go groovy haskell
5
+ # java julia kotlin lua markdown
6
+ # matlab nix pascal perl php
7
+ # powershell python python_jedi r rego
8
+ # ruby ruby_solargraph rust scala swift
9
+ # terraform toml typescript typescript_vts vue
10
+ # yaml zig
11
+ # (This list may be outdated. For the current list, see values of Language enum here:
12
+ # https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py
13
+ # For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
14
+ # Note:
15
+ # - For C, use cpp
16
+ # - For JavaScript, use typescript
17
+ # - For Free Pascal/Lazarus, use pascal
18
+ # Special requirements:
19
+ # - csharp: Requires the presence of a .sln file in the project folder.
20
+ # - pascal: Requires Free Pascal Compiler (fpc) and optionally Lazarus.
21
+ # When using multiple languages, the first language server that supports a given file will be used for that file.
22
+ # The first language is the default language and the respective language server will be used as a fallback.
23
+ # Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
24
+ languages:
25
+ - ruby
26
+
27
+ # the encoding used by text files in the project
28
+ # For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
29
+ encoding: "utf-8"
30
+
31
+ # whether to use project's .gitignore files to ignore files
32
+ ignore_all_files_in_gitignore: true
33
+
34
+ # list of additional paths to ignore in all projects
35
+ # same syntax as gitignore, so you can use * and **
36
+ ignored_paths: []
37
+
38
+ # whether the project is in read-only mode
39
+ # If set to true, all editing tools will be disabled and attempts to use them will result in an error
40
+ # Added on 2025-04-18
41
+ read_only: false
42
+
43
+ # list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
44
+ # Below is the complete list of tools for convenience.
45
+ # To make sure you have the latest list of tools, and to view their descriptions,
46
+ # execute `uv run scripts/print_tool_overview.py`.
47
+ #
48
+ # * `activate_project`: Activates a project by name.
49
+ # * `check_onboarding_performed`: Checks whether project onboarding was already performed.
50
+ # * `create_text_file`: Creates/overwrites a file in the project directory.
51
+ # * `delete_lines`: Deletes a range of lines within a file.
52
+ # * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
53
+ # * `execute_shell_command`: Executes a shell command.
54
+ # * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
55
+ # * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
56
+ # * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
57
+ # * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
58
+ # * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
59
+ # * `initial_instructions`: Gets the initial instructions for the current project.
60
+ # Should only be used in settings where the system prompt cannot be set,
61
+ # e.g. in clients you have no control over, like Claude Desktop.
62
+ # * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
63
+ # * `insert_at_line`: Inserts content at a given line in a file.
64
+ # * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
65
+ # * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
66
+ # * `list_memories`: Lists memories in Serena's project-specific memory store.
67
+ # * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
68
+ # * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
69
+ # * `read_file`: Reads a file within the project directory.
70
+ # * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
71
+ # * `remove_project`: Removes a project from the Serena configuration.
72
+ # * `replace_lines`: Replaces a range of lines within a file with new content.
73
+ # * `replace_symbol_body`: Replaces the full definition of a symbol.
74
+ # * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
75
+ # * `search_for_pattern`: Performs a search for a pattern in the project.
76
+ # * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
77
+ # * `switch_modes`: Activates modes by providing a list of their names
78
+ # * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
79
+ # * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
80
+ # * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
81
+ # * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
82
+ excluded_tools: []
83
+
84
+ # initial prompt for the project. It will always be given to the LLM upon activating the project
85
+ # (contrary to the memories, which are loaded on demand).
86
+ initial_prompt: ""
87
+
88
+ project_name: "yamlint"
89
+ included_optional_tools: []
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
- ## [Unreleased]
1
+ ## Unreleased
2
2
 
3
- ## [0.1.0] - 2022-11-16
3
+ ## 1.0.0 - 2026-01-25
4
+
5
+ - Re-implemented core functions
6
+
7
+ ## 0.1.0 - 2022-11-16
4
8
 
5
9
  - Initial release
data/Gemfile CHANGED
@@ -1,12 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source "https://rubygems.org"
3
+ source 'https://rubygems.org'
4
4
 
5
- # Specify your gem's dependencies in yamlint.gemspec
6
5
  gemspec
7
6
 
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rspec", "~> 3.0"
11
-
12
- gem "rubocop", "~> 1.21"
7
+ gem 'rake'
8
+ gem 'rdoc'
9
+ gem 'rspec'
10
+ gem 'rubocop'
11
+ gem 'rubocop-performance'
12
+ gem 'rubocop-rake'
13
+ gem 'rubocop-rspec'
14
+ gem 'yard'
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022 ydah
3
+ Copyright (c) 2022 Yudai Takada
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,37 +1,175 @@
1
- # Yamlint
1
+ <h1 align="center">yamlint</h1>
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/yamlint`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ <p align="center">
4
+ <img src="https://img.shields.io/badge/ruby-%3E%3D%203.1-ruby.svg" alt="Ruby Version"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"><a href="https://github.com/ydah/yamlint/actions/workflows/test.yml"><img src="https://github.com/ydah/yamlint/actions/workflows/test.yml/badge.svg?branch=main" alt="test"></a><a href="https://badge.fury.io/rb/yamlint"><img src="https://badge.fury.io/rb/yamlint.svg" alt="Gem Version"></a>
5
+ </p>
4
6
 
5
- TODO: Delete this and the text above, and describe your gem
7
+ <p align="center">
8
+ A Ruby CLI for linting and formatting YAML files
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="#features">Features</a> •
13
+ <a href="#quickstart">Quickstart</a> •
14
+ <a href="#installation">Installation</a> •
15
+ <a href="#usage">Usage</a> •
16
+ <a href="#configuration">Configuration</a> •
17
+ <a href="#rules">Rules</a>
18
+ </p>
19
+
20
+ ## Features
21
+
22
+ - Rule-based linting and auto-formatting
23
+ - Configuration via `.yamllint(.yml/.yaml)` with preset `extends`
24
+ - CI-friendly output formats (standard/parsable/colored/github)
25
+ - YAML file patterns and ignore support
26
+
27
+ ## Quickstart
28
+
29
+ ```bash
30
+ gem install yamlint
31
+
32
+ # lint
33
+ yamlint .
34
+
35
+ # format (dry-run)
36
+ yamlint format --dry-run .
37
+ ```
6
38
 
7
39
  ## Installation
8
40
 
9
- Install the gem and add to the application's Gemfile by executing:
41
+ With Bundler:
10
42
 
11
- $ bundle add yamlint
43
+ ```bash
44
+ bundle add yamlint
45
+ ```
12
46
 
13
- If bundler is not being used to manage dependencies, install the gem by executing:
47
+ Without Bundler:
14
48
 
15
- $ gem install yamlint
49
+ ```bash
50
+ gem install yamlint
51
+ ```
16
52
 
17
53
  ## Usage
18
54
 
19
- TODO: Write usage instructions here
55
+ Basic:
20
56
 
21
- ## Development
57
+ ```bash
58
+ yamlint .
59
+ yamlint path/to/file.yml
60
+ ```
22
61
 
23
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
62
+ Formatting:
24
63
 
25
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
64
+ ```bash
65
+ yamlint format .
66
+ yamlint format --dry-run .
67
+ ```
26
68
 
27
- ## Contributing
69
+ CI output:
28
70
 
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/yamlint. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/yamlint/blob/main/CODE_OF_CONDUCT.md).
71
+ ```bash
72
+ yamlint -f github .
73
+ ```
30
74
 
31
- ## License
75
+ Help:
76
+
77
+ ```bash
78
+ yamlint --help
79
+ ```
80
+
81
+ ## Configuration
82
+
83
+ Default config file names:
84
+
85
+ - `.yamllint`
86
+ - `.yamllint.yml`
87
+ - `.yamllint.yaml`
88
+
89
+ Configuration options:
90
+
91
+ | Option | Type | Default | Behavior |
92
+ | --- | --- | --- | --- |
93
+ | `extends` | string | none | Inherit a preset (`default` or `relaxed`). Values from the current file override the preset. |
94
+ | `yaml-files` | list of glob strings | `["*.yaml", "*.yml"]` | Glob patterns used when discovering YAML files in directories. |
95
+ | `ignore` | list of strings | `[]` | List of paths to skip. Parsed by the config loader but not currently applied to file discovery. |
96
+ | `rules` | map | `{}` | Per-rule configuration. Set a rule to `disable` or `false` to turn it off, or provide a map of options. |
97
+
98
+ Notes:
99
+
100
+ - Rule option keys accept either `snake_case` or `kebab-case` and are normalized internally.
101
+ - Rule option defaults come from the rule implementation and are merged with your overrides.
102
+
103
+ Example:
104
+
105
+ ```yaml
106
+ extends: default
107
+
108
+ yaml-files:
109
+ - "*.yml"
110
+ - "*.yaml"
32
111
 
33
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
112
+ ignore:
113
+ - vendor
114
+ - node_modules
34
115
 
35
- ## Code of Conduct
116
+ rules:
117
+ line-length:
118
+ max: 120
119
+ document-start: disable
120
+ truthy:
121
+ allowed-values: ["true", "false"]
122
+ ```
123
+
124
+ ## Presets
125
+
126
+ Available presets:
127
+
128
+ - `default`
129
+ - `relaxed`
130
+
131
+ ```yaml
132
+ extends: relaxed
133
+ ```
134
+
135
+ ## Rules
136
+
137
+ Key rules:
138
+
139
+ - anchors, braces, brackets, colons, commas, comments, comments-indentation
140
+ - document-start, document-end, empty-lines, empty-values, float-values
141
+ - hyphens, indentation, key-duplicates, key-ordering, line-length
142
+ - new-lines, new-line-at-end-of-file, octal-values, quoted-strings
143
+ - trailing-spaces, truthy
144
+
145
+ ## Output formats
146
+
147
+ Use `-f`/`--format` to select an output format:
148
+
149
+ - `standard`
150
+ - `parsable`
151
+ - `colored`
152
+ - `github`
153
+
154
+ ## Development
155
+
156
+ ```bash
157
+ bin/setup
158
+ rake spec
159
+ ```
160
+
161
+ Install locally:
162
+
163
+ ```bash
164
+ bundle exec rake install
165
+ ```
166
+
167
+ Release:
168
+
169
+ ```bash
170
+ bundle exec rake release
171
+ ```
172
+
173
+ ## License
36
174
 
37
- Everyone interacting in the Yamlint project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/yamlint/blob/main/CODE_OF_CONDUCT.md).
175
+ MIT License. See `LICENSE.txt` for details.
data/Rakefile CHANGED
@@ -1,12 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+ require 'yard'
6
+ require 'yard/rake/yardoc_task'
5
7
 
6
8
  RSpec::Core::RakeTask.new(:spec)
7
9
 
8
- require "rubocop/rake_task"
10
+ require 'rubocop/rake_task'
9
11
 
10
12
  RuboCop::RakeTask.new
11
13
 
14
+ YARD::Rake::YardocTask.new do |task|
15
+ task.files = ['lib/**/*.rb']
16
+ task.options = ['--output-dir', 'docs']
17
+ end
18
+
12
19
  task default: %i[spec rubocop]