Skip to content

Commit bedf69d

Browse files
committed
unify make lint & ~fix
1 parent 644fe25 commit bedf69d

5 files changed

Lines changed: 78 additions & 49 deletions

File tree

Makefile

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
.PHONY: help test lint fix setup dev clean frontend-setup frontend-format frontend-format-check frontend-lint
3+
.PHONY: help test lint lint-js lint-ruby lintfix lintfix-js lintfix-ruby setup dev clean frontend-setup
44

55
# Default target
66
help: ## Show this help message
@@ -51,11 +51,31 @@ test-frontend-unit: ## Run frontend unit tests only
5151
test-frontend-integration: ## Run frontend integration tests only
5252
@cd frontend && npm run test:integration
5353

54-
lint: ## Run linter
54+
lint: lint-ruby lint-js ## Run all linters (Ruby + Frontend) - errors when issues found
55+
@echo "All linting complete!"
56+
57+
lint-ruby: ## Run Ruby linter (RuboCop) - errors when issues found
58+
@echo "Running RuboCop linting..."
5559
bundle exec rubocop
60+
@echo "Ruby linting complete!"
61+
62+
lint-js: ## Run JavaScript/Frontend linter (Prettier) - errors when issues found
63+
@echo "Running Prettier format check..."
64+
@cd frontend && npm run format:check
65+
@echo "JavaScript linting complete!"
5666

57-
fix: ## Auto-fix linting issues
58-
bundle exec rubocop -a
67+
lintfix: lintfix-ruby lintfix-js ## Auto-fix all linting issues (Ruby + Frontend)
68+
@echo "All lintfix complete!"
69+
70+
lintfix-ruby: ## Auto-fix Ruby linting issues
71+
@echo "Running RuboCop auto-correct..."
72+
-bundle exec rubocop --auto-correct
73+
@echo "Ruby lintfix complete!"
74+
75+
lintfix-js: ## Auto-fix JavaScript/Frontend linting issues
76+
@echo "Running Prettier formatting..."
77+
@cd frontend && npm run format
78+
@echo "JavaScript lintfix complete!"
5979

6080
clean: ## Clean temporary files
6181
@rm -rf tmp/rack-cache-* coverage/
@@ -66,15 +86,3 @@ frontend-setup: ## Setup frontend dependencies
6686
@echo "Setting up frontend dependencies..."
6787
@cd frontend && npm install
6888
@echo "Frontend setup complete!"
69-
70-
frontend-format: ## Format frontend code
71-
@echo "Formatting frontend code..."
72-
@cd frontend && npm run format
73-
@echo "Frontend formatting complete!"
74-
75-
frontend-format-check: ## Check frontend code formatting
76-
@echo "Checking frontend code formatting..."
77-
@cd frontend && npm run format:check
78-
79-
frontend-lint: frontend-format-check ## Lint frontend code (formatting check)
80-
@echo "Frontend linting complete!"

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,23 @@ The project includes a modern Astro frontend alongside the Ruby backend:
9292

9393
### Development Commands
9494

95-
| Command | Description |
96-
| ------------ | --------------------------- |
97-
| `make help` | Show all available commands |
98-
| `make setup` | Full development setup |
99-
| `make dev` | Start development server |
100-
| `make test` | Run tests |
101-
| `make lint` | Run linter |
102-
| `make fix` | Auto-fix linting issues |
103-
| `make clean` | Clean temporary files |
104-
105-
### Development Commands
106-
107-
| Command | Description |
108-
| ---------------------- | ------------------------------------- |
109-
| `make dev` | Start both Ruby and Astro dev servers |
110-
| `make dev-ruby` | Start Ruby server only |
111-
| `make dev-frontend` | Start Astro dev server only |
112-
| `make frontend-format` | Format frontend code |
95+
| Command | Description |
96+
| -------------------- | ------------------------------------- |
97+
| `make help` | Show all available commands |
98+
| `make setup` | Full development setup |
99+
| `make dev` | Start both Ruby and Astro dev servers |
100+
| `make dev-ruby` | Start Ruby server only |
101+
| `make dev-frontend` | Start Astro dev server only |
102+
| `make test` | Run all tests (Ruby + Frontend) |
103+
| `make test-ruby` | Run Ruby tests only |
104+
| `make test-frontend` | Run frontend tests only |
105+
| `make lint` | Run all linters (Ruby + Frontend) |
106+
| `make lint-ruby` | Run Ruby linter only |
107+
| `make lint-js` | Run frontend linter only |
108+
| `make lintfix` | Auto-fix all linting issues |
109+
| `make lintfix-ruby` | Auto-fix Ruby linting issues |
110+
| `make lintfix-js` | Auto-fix frontend linting issues |
111+
| `make clean` | Clean temporary files |
113112

114113
### Frontend Commands
115114

frontend/.prettierignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
dist/
6+
.astro/
7+
8+
# Generated files
9+
*.min.js
10+
*.min.css
11+
12+
# Package files
13+
package-lock.json
14+
yarn.lock
15+
16+
# Test coverage
17+
coverage/
18+
19+
# Logs
20+
*.log

frontend/.prettierrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

frontend/prettier.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export const config = {
2+
tabWidth: 2,
3+
useTabs: false,
4+
semi: false,
5+
printWidth: 110,
6+
plugins: ["prettier-plugin-astro"],
7+
overrides: [
8+
{
9+
files: "*.astro",
10+
options: {
11+
parser: "astro"
12+
}
13+
}
14+
]
15+
}
16+
17+
export default config

0 commit comments

Comments
 (0)