Skip to content

Commit 3a97375

Browse files
TSS-28: Add linter for YARD comments (#77)
# Enforce YARD comments with RuboCop linter This PR adds a RuboCop plugin to enforce YARD documentation standards in the codebase. ## Changes - Added the rubocop-yard gem to the Gemfile - Configured RuboCop to enforce YARD documentation for classes, modules, and methods - Added settings to ensure parameters and return values are properly documented Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Loren Yu <loren@navapbc.com>
1 parent db5ab4e commit 3a97375

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

.rubocop.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ plugins:
33
inherit_gem:
44
rubocop-rails-omakase: rubocop.yml
55

6+
require:
7+
- rubocop-yard
8+
69
RSpec/ExampleLength:
710
Enabled: false
811
RSpec/MultipleExpectations:
@@ -15,3 +18,25 @@ AllCops:
1518
- "spec/dummy/tmp/**/*"
1619
- "spec/dummy/log/**/*"
1720
- "spec/dummy/storage/**/*"
21+
22+
# YARD documentation configuration
23+
YARD:
24+
Enabled: true
25+
26+
YARD/CollectionStyle:
27+
Enabled: true
28+
29+
YARD/CollectionType:
30+
Enabled: true
31+
32+
YARD/MeaninglessTag:
33+
Enabled: true
34+
35+
YARD/MismatchName:
36+
Enabled: true
37+
38+
YARD/TagTypePosition:
39+
Enabled: true
40+
41+
YARD/TagTypeSyntax:
42+
Enabled: true

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ group :development do
2727
# Linting
2828
gem "rubocop-rails-omakase", require: false
2929
gem "rubocop-rspec", require: false
30+
gem "rubocop-yard", require: false
3031

3132
# Hot reloading for Lookbook
3233
gem "listen"

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ GEM
324324
rubocop-rspec (3.5.0)
325325
lint_roller (~> 1.1)
326326
rubocop (~> 1.72, >= 1.72.1)
327+
rubocop-yard (0.10.0)
328+
rubocop (~> 1.21)
329+
yard
327330
ruby-progressbar (1.13.0)
328331
securerandom (0.4.1)
329332
shellany (0.0.1)
@@ -395,6 +398,7 @@ DEPENDENCIES
395398
rspec-rails (~> 7.0.0)
396399
rubocop-rails-omakase
397400
rubocop-rspec
401+
rubocop-yard
398402
shoulda-matchers (~> 6.0)
399403
simplecov
400404
sprockets-rails

0 commit comments

Comments
 (0)