Skip to content

Commit 1d4b2b8

Browse files
authored
Merge pull request #69 from capotej/crush
add CRUSH.md and ruby-lsp config
2 parents 2b17bf8 + 0bc8a75 commit 1d4b2b8

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

.crush.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://charm.land/crush.json",
3+
"lsp": {
4+
"ruby": {
5+
"command": "bundle",
6+
"args": ["exec", "ruby-lsp"]
7+
}
8+
}
9+
}

CRUSH.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# CRUSH.md
2+
3+
## Commands
4+
5+
**Test**
6+
- `rails test` - Run all tests except system tests
7+
- `rails test test/models/post_test.rb` - Run specific test file
8+
- `rails test test/models/post_test.rb:27` - Run specific test by line number
9+
- `rails test:system` - Run system tests
10+
11+
**Lint/Format**
12+
- `bundle exec rubocop` - Run linter (uses rubocop-rails-omakase)
13+
- `bundle exec rubocop -a` - Auto-fix safe corrections
14+
- `bundle exec brakeman` - Security analysis
15+
16+
**Development**
17+
- `rails server` - Start development server
18+
- `rails console` - Start Rails console
19+
- `rails db:migrate` - Run migrations
20+
- `rails db:seed` - Seed database
21+
22+
## Code Style
23+
24+
**Testing**: Uses Minitest with ActiveSupport::TestCase. Test files in `test/` directory.
25+
26+
**Linting**: Uses rubocop-rails-omakase (Omakase Ruby styling for Rails).
27+
28+
**Models**: Include concerns from `concerns/` directory. Use `validates_presence_of`, scopes, and lifecycle callbacks.
29+
30+
**Controllers**: Inherit from ApplicationController. Use `allow_unauthenticated_access` for public actions. Find records with `find_by_slug!` for posts.
31+
32+
**Naming**: Snake_case for methods/variables, CamelCase for classes. Use descriptive method names like `rendered_body` and `post_scope`.
33+
34+
**Structure**: Standard Rails MVC. Models in `app/models/`, controllers in `app/controllers/`, tests mirror app structure in `test/`.

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ group :development, :test do
4949

5050
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
5151
gem "rubocop-rails-omakase", require: false
52+
53+
gem "ruby-lsp"
5254
end
5355

5456
group :development do

Gemfile.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ GEM
266266
pp (0.6.2)
267267
prettyprint
268268
prettyprint (0.2.0)
269+
prism (1.4.0)
269270
propshaft (1.2.1)
270271
actionpack (>= 7.0.0)
271272
activesupport (>= 7.0.0)
@@ -317,6 +318,8 @@ GEM
317318
zeitwerk (~> 2.6)
318319
rainbow (3.1.1)
319320
rake (13.3.0)
321+
rbs (3.9.4)
322+
logger
320323
rdoc (6.14.2)
321324
erb
322325
psych (>= 4.0.0)
@@ -353,6 +356,10 @@ GEM
353356
rubocop (>= 1.72)
354357
rubocop-performance (>= 1.24)
355358
rubocop-rails (>= 2.30)
359+
ruby-lsp (0.26.1)
360+
language_server-protocol (~> 3.17.0)
361+
prism (>= 1.2, < 2.0)
362+
rbs (>= 3, < 5)
356363
ruby-progressbar (1.13.0)
357364
ruby-vips (2.2.3)
358365
ffi (~> 1.12)
@@ -473,6 +480,7 @@ DEPENDENCIES
473480
redcarpet (~> 3.6)
474481
rouge (~> 4.6)
475482
rubocop-rails-omakase
483+
ruby-lsp
476484
selenium-webdriver
477485
solid_cable
478486
solid_cache

0 commit comments

Comments
 (0)