Skip to content

Commit a5d6666

Browse files
committed
Introduce Makefile for common dev commands
- Also includes Yard
1 parent 03e7533 commit a5d6666

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ yarn-debug.log*
3333

3434
.DS_Store
3535
.vscode/
36+
.yardoc

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ group :development do
3838
gem 'rubocop'
3939
gem 'rubocop-rails'
4040
gem 'web-console'
41+
gem 'yard'
4142
end
4243

4344
group :test do

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ GEM
392392
websocket-extensions (0.1.5)
393393
xpath (3.2.0)
394394
nokogiri (~> 1.8)
395+
yard (0.9.37)
395396
zeitwerk (2.7.3)
396397

397398
PLATFORMS
@@ -443,6 +444,7 @@ DEPENDENCIES
443444
vcr
444445
web-console
445446
webmock
447+
yard
446448

447449
RUBY VERSION
448450
ruby 3.4.7p58

Makefile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.PHONY: test
2+
3+
help: # display Makefile commands
4+
@awk 'BEGIN { FS = ":.*#"; print "Usage: make <target>\n\nTargets:" } \
5+
/^[-_[:alpha:]]+:.?*#/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)
6+
7+
#######################
8+
# Local development commands
9+
#######################
10+
11+
run: # runs server on localhost
12+
bin/rails server
13+
14+
console: # runs console
15+
bin/rails console
16+
17+
test: # Run tests
18+
bin/rails test
19+
20+
coverage: test # Run tests and open coverage report in default web browser
21+
open coverage/index.html
22+
23+
#######################
24+
# Documentation commands
25+
#######################
26+
27+
annotate: # update Rails models documentation header
28+
bundle exec annotate --models
29+
30+
docserver: # runs local documentation server
31+
rm -rf .yardoc # Clears cache as it's sketchy af
32+
yard server --reload
33+
34+
#######################
35+
# Dependency commands
36+
#######################
37+
38+
install: # Install dependencies
39+
bundle install
40+
41+
outdated: # List outdated dependencies
42+
bundle outdated
43+
44+
####################################
45+
# Code quality and safety commands
46+
####################################
47+
48+
lint:
49+
bundle exec rubocop
50+
51+
lint-models:
52+
bundle exec rubocop app/models
53+
54+
lint-controllers:
55+
bundle exec rubocop app/controllers

0 commit comments

Comments
 (0)