|
| 1 | +# YARD-Lint Configuration |
| 2 | +# See https://github.com/mensfeld/yard-lint for documentation |
| 3 | + |
| 4 | +# Global settings for all validators |
| 5 | +AllValidators: |
| 6 | + # YARD command-line options (applied to all validators by default) |
| 7 | + YardOptions: [] |
| 8 | + |
| 9 | + # Global file exclusion patterns |
| 10 | + Exclude: |
| 11 | + - '\.git' |
| 12 | + - 'vendor/**/*' |
| 13 | + - 'node_modules/**/*' |
| 14 | + - 'spec/**/*' |
| 15 | + - 'test/**/*' |
| 16 | + - 'test_engine/**/*' |
| 17 | + - 'performance/**/*' |
| 18 | + - 'lib/docs/**/*' |
| 19 | + - 'lib/generators/**/*' |
| 20 | + |
| 21 | + # Exit code behavior (error, warning, convention, never) |
| 22 | + FailOnSeverity: warning |
| 23 | + |
| 24 | + # Minimum documentation coverage percentage (0-100) |
| 25 | + # Fails if coverage is below this threshold |
| 26 | + # MinCoverage: 80.0 |
| 27 | + |
| 28 | + # Diff mode settings |
| 29 | + DiffMode: |
| 30 | + # Default base ref for --diff (auto-detects main/master if not specified) |
| 31 | + DefaultBaseRef: ~ |
| 32 | + |
| 33 | +# Documentation validators |
| 34 | +Documentation/UndocumentedObjects: |
| 35 | + Description: 'Checks for classes, modules, and methods without documentation.' |
| 36 | + Enabled: true |
| 37 | + Severity: warning |
| 38 | + ExcludedMethods: |
| 39 | + - 'initialize/0' # Exclude parameter-less initialize |
| 40 | + - '/^_/' # Exclude private methods (by convention) |
| 41 | + |
| 42 | +Documentation/UndocumentedMethodArguments: |
| 43 | + Description: 'Checks for method parameters without @param tags.' |
| 44 | + Enabled: true |
| 45 | + Severity: warning |
| 46 | + |
| 47 | +Documentation/UndocumentedBooleanMethods: |
| 48 | + Description: 'Checks that question mark methods document their boolean return.' |
| 49 | + Enabled: true |
| 50 | + Severity: warning |
| 51 | + |
| 52 | +Documentation/UndocumentedOptions: |
| 53 | + Description: 'Detects methods with options hash parameters but no @option tags.' |
| 54 | + Enabled: true |
| 55 | + Severity: warning |
| 56 | + |
| 57 | +Documentation/MarkdownSyntax: |
| 58 | + Description: 'Detects common markdown syntax errors in documentation.' |
| 59 | + Enabled: true |
| 60 | + Severity: warning |
| 61 | + |
| 62 | +Documentation/EmptyCommentLine: |
| 63 | + Description: 'Detects empty comment lines at the start or end of documentation blocks.' |
| 64 | + Enabled: true |
| 65 | + Severity: convention |
| 66 | + EnabledPatterns: |
| 67 | + Leading: true |
| 68 | + Trailing: true |
| 69 | + |
| 70 | +Documentation/BlankLineBeforeDefinition: |
| 71 | + Description: 'Detects blank lines between YARD documentation and method definition.' |
| 72 | + Enabled: true |
| 73 | + Severity: convention |
| 74 | + OrphanedSeverity: convention |
| 75 | + EnabledPatterns: |
| 76 | + SingleBlankLine: true |
| 77 | + OrphanedDocs: true |
| 78 | + |
| 79 | +# Tags validators |
| 80 | +Tags/Order: |
| 81 | + Description: 'Enforces consistent ordering of YARD tags.' |
| 82 | + Enabled: true |
| 83 | + Severity: convention |
| 84 | + EnforcedOrder: |
| 85 | + - param |
| 86 | + - option |
| 87 | + - yield |
| 88 | + - yieldparam |
| 89 | + - yieldreturn |
| 90 | + - return |
| 91 | + - raise |
| 92 | + - see |
| 93 | + - example |
| 94 | + - note |
| 95 | + - todo |
| 96 | + |
| 97 | +Tags/InvalidTypes: |
| 98 | + Description: 'Validates type definitions in @param, @return, @option tags.' |
| 99 | + Enabled: true |
| 100 | + Severity: warning |
| 101 | + ValidatedTags: |
| 102 | + - param |
| 103 | + - option |
| 104 | + - return |
| 105 | + |
| 106 | +Tags/TypeSyntax: |
| 107 | + Description: 'Validates YARD type syntax using YARD parser.' |
| 108 | + Enabled: true |
| 109 | + Severity: warning |
| 110 | + ValidatedTags: |
| 111 | + - param |
| 112 | + - option |
| 113 | + - return |
| 114 | + - yieldreturn |
| 115 | + |
| 116 | +Tags/MeaninglessTag: |
| 117 | + Description: 'Detects @param/@option tags on classes, modules, or constants.' |
| 118 | + Enabled: true |
| 119 | + Severity: warning |
| 120 | + CheckedTags: |
| 121 | + - param |
| 122 | + - option |
| 123 | + InvalidObjectTypes: |
| 124 | + - class |
| 125 | + - module |
| 126 | + - constant |
| 127 | + |
| 128 | +Tags/CollectionType: |
| 129 | + Description: 'Validates Hash collection syntax consistency.' |
| 130 | + Enabled: true |
| 131 | + Severity: convention |
| 132 | + EnforcedStyle: long # 'long' for Hash{K => V} (YARD standard), 'short' for {K => V} |
| 133 | + ValidatedTags: |
| 134 | + - param |
| 135 | + - option |
| 136 | + - return |
| 137 | + - yieldreturn |
| 138 | + |
| 139 | +Tags/TagTypePosition: |
| 140 | + Description: 'Validates type annotation position in tags.' |
| 141 | + Enabled: true |
| 142 | + Severity: convention |
| 143 | + CheckedTags: |
| 144 | + - param |
| 145 | + - option |
| 146 | + # EnforcedStyle: 'type_after_name' (YARD standard: @param name [Type]) |
| 147 | + # or 'type_first' (@param [Type] name) |
| 148 | + EnforcedStyle: type_after_name |
| 149 | + |
| 150 | +Tags/ApiTags: |
| 151 | + Description: 'Enforces @api tags on public objects.' |
| 152 | + Enabled: false # Opt-in validator |
| 153 | + Severity: warning |
| 154 | + AllowedApis: |
| 155 | + - public |
| 156 | + - private |
| 157 | + - internal |
| 158 | + |
| 159 | +Tags/OptionTags: |
| 160 | + Description: 'Requires @option tags for methods with options parameters.' |
| 161 | + Enabled: true |
| 162 | + Severity: warning |
| 163 | + YardOptions: [] |
| 164 | + |
| 165 | +Tags/ExampleSyntax: |
| 166 | + Description: 'Validates Ruby syntax in @example tags.' |
| 167 | + Enabled: true |
| 168 | + Severity: warning |
| 169 | + |
| 170 | +Tags/RedundantParamDescription: |
| 171 | + Description: 'Detects meaningless parameter descriptions that add no value.' |
| 172 | + Enabled: true |
| 173 | + Severity: convention |
| 174 | + CheckedTags: |
| 175 | + - param |
| 176 | + - option |
| 177 | + Articles: |
| 178 | + - The |
| 179 | + - the |
| 180 | + - A |
| 181 | + - a |
| 182 | + - An |
| 183 | + - an |
| 184 | + MaxRedundantWords: 6 |
| 185 | + GenericTerms: |
| 186 | + - object |
| 187 | + - instance |
| 188 | + - value |
| 189 | + - data |
| 190 | + - item |
| 191 | + - element |
| 192 | + EnabledPatterns: |
| 193 | + ArticleParam: true |
| 194 | + PossessiveParam: true |
| 195 | + TypeRestatement: true |
| 196 | + ParamToVerb: true |
| 197 | + IdPattern: true |
| 198 | + DirectionalDate: true |
| 199 | + TypeGeneric: true |
| 200 | + |
| 201 | +Tags/InformalNotation: |
| 202 | + Description: 'Detects informal tag notation patterns like "Note:" instead of @note.' |
| 203 | + Enabled: true |
| 204 | + Severity: warning |
| 205 | + CaseSensitive: false |
| 206 | + RequireStartOfLine: true |
| 207 | + Patterns: |
| 208 | + Note: '@note' |
| 209 | + Todo: '@todo' |
| 210 | + TODO: '@todo' |
| 211 | + FIXME: '@todo' |
| 212 | + See: '@see' |
| 213 | + See also: '@see' |
| 214 | + Warning: '@deprecated' |
| 215 | + Deprecated: '@deprecated' |
| 216 | + Author: '@author' |
| 217 | + Version: '@version' |
| 218 | + Since: '@since' |
| 219 | + Returns: '@return' |
| 220 | + Raises: '@raise' |
| 221 | + Example: '@example' |
| 222 | + |
| 223 | +Tags/NonAsciiType: |
| 224 | + Description: 'Detects non-ASCII characters in type annotations.' |
| 225 | + Enabled: true |
| 226 | + Severity: warning |
| 227 | + ValidatedTags: |
| 228 | + - param |
| 229 | + - option |
| 230 | + - return |
| 231 | + - yieldreturn |
| 232 | + - yieldparam |
| 233 | + |
| 234 | +Tags/TagGroupSeparator: |
| 235 | + Description: 'Enforces blank line separators between different YARD tag groups.' |
| 236 | + Enabled: false # Opt-in validator |
| 237 | + Severity: convention |
| 238 | + TagGroups: |
| 239 | + param: [param, option] |
| 240 | + return: [return] |
| 241 | + error: [raise, throws] |
| 242 | + example: [example] |
| 243 | + meta: [see, note, todo, deprecated, since, version, api] |
| 244 | + yield: [yield, yieldparam, yieldreturn] |
| 245 | + RequireAfterDescription: false |
| 246 | + |
| 247 | +Tags/ForbiddenTags: |
| 248 | + Description: 'Detects forbidden tag and type combinations.' |
| 249 | + Enabled: false # Opt-in validator |
| 250 | + Severity: convention |
| 251 | + ForbiddenPatterns: [] |
| 252 | + # Example patterns: |
| 253 | + # - Tag: return |
| 254 | + # Types: |
| 255 | + # - void |
| 256 | + # - Tag: param |
| 257 | + # Types: |
| 258 | + # - Object |
| 259 | + # - Tag: api # Forbids @api tag entirely (no Types = any occurrence) |
| 260 | + |
| 261 | +# Warnings validators - catches YARD parser errors |
| 262 | +Warnings/UnknownTag: |
| 263 | + Description: 'Detects unknown YARD tags.' |
| 264 | + Enabled: true |
| 265 | + Severity: error |
| 266 | + |
| 267 | +Warnings/UnknownDirective: |
| 268 | + Description: 'Detects unknown YARD directives.' |
| 269 | + Enabled: true |
| 270 | + Severity: error |
| 271 | + |
| 272 | +Warnings/InvalidTagFormat: |
| 273 | + Description: 'Detects malformed tag syntax.' |
| 274 | + Enabled: true |
| 275 | + Severity: error |
| 276 | + |
| 277 | +Warnings/InvalidDirectiveFormat: |
| 278 | + Description: 'Detects malformed directive syntax.' |
| 279 | + Enabled: true |
| 280 | + Severity: error |
| 281 | + |
| 282 | +Warnings/DuplicatedParameterName: |
| 283 | + Description: 'Detects duplicate @param tags.' |
| 284 | + Enabled: true |
| 285 | + Severity: error |
| 286 | + |
| 287 | +Warnings/UnknownParameterName: |
| 288 | + Description: 'Detects @param tags for non-existent parameters.' |
| 289 | + Enabled: true |
| 290 | + Severity: error |
| 291 | + |
| 292 | +# Semantic validators |
| 293 | +Semantic/AbstractMethods: |
| 294 | + Description: 'Ensures @abstract methods do not have real implementations.' |
| 295 | + Enabled: true |
| 296 | + Severity: warning |
0 commit comments