|
13 | 13 | ## Build, Test, and Development Commands |
14 | 14 | This repo is Docker-only; do not use system Ruby/Bundler. |
15 | 15 | - Start/stop: `make up`, `make down`, logs with `make logs`. |
| 16 | +- Prod/dev switch: `STREAMSOURCE_ENV=prod make up` uses `docker-compose.prod.yml` plus base compose. |
16 | 17 | - Rails console: `make shell` or `docker compose exec web bin/rails console`. |
17 | 18 | - Migrations: `make migrate`. |
18 | 19 | - Tests: `make test` or `docker compose exec web bin/test [path]`. |
19 | | -- Lint/security: `docker compose exec web bundle exec rubocop`, `docker compose exec web bundle exec brakeman -q -w2`. |
| 20 | +- Lint: `make lint` (runs RuboCop + ESLint). |
| 21 | +- Rebuild: `make rebuild` (clean + rebuild containers). |
| 22 | +- Security: `docker compose exec web bundle exec brakeman -q -w2`, `docker compose exec web bundle exec bundler-audit check --update`. |
20 | 23 | - JS/CSS build: `docker compose exec web yarn build` and `docker compose exec web yarn build:css`. |
21 | 24 |
|
22 | 25 | ## Coding Style & Naming Conventions |
23 | 26 | - Indentation: 2 spaces (EditorConfig). |
24 | 27 | - Ruby: RuboCop (Rails/RSpec), line length 120, prefer double quotes. |
25 | 28 | - JavaScript: ESLint Standard; single quotes, no semicolons, 2-space indent. |
26 | 29 | - Naming: specs use `*_spec.rb`; factories live in `spec/factories/`. |
| 30 | +- Gemfile entries must be alphabetized within each group (Bundler/OrderedGems). |
27 | 31 |
|
28 | 32 | ## Testing Guidelines |
29 | 33 | - Framework: RSpec with FactoryBot; avoid fixtures. |
30 | 34 | - Run a single spec: `docker compose exec web bin/test spec/models/user_spec.rb`. |
31 | 35 | - Coverage target is >90% (see `docs/LINTING.md`); add edge-case coverage for controllers and services. |
| 36 | +- CI uses the `RspecJunitFormatter`; keep `rspec_junit_formatter` in the test group. |
| 37 | + |
| 38 | +## Test Helpers & Auth |
| 39 | +- Prefer real login helpers over controller stubbing; avoid `allow_any_instance_of` in request specs. |
| 40 | +- `sign_in_admin` posts top-level `email`/`password` params (admin sessions controller does not use nested params). |
| 41 | + |
| 42 | +## CI/Workflow Notes |
| 43 | +- GitHub Actions versions are bumped in both `.github/workflows/pr-validation.yml` and `.github/workflows/deploy.yml`. |
| 44 | +- JavaScript linting runs via `yarn lint` (alias of ESLint). |
32 | 45 |
|
33 | 46 | ## Commit & Pull Request Guidelines |
34 | 47 | - Commit messages are short, imperative, and lowercase (e.g., “simplify makefile”). |
|
0 commit comments