Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
FROM mcr.microsoft.com/devcontainers/ruby:3.3-bookworm
FROM mcr.microsoft.com/devcontainers/ruby:3.4-bookworm

# Default value to allow debug server to serve content over GitHub Codespace's port forwarding service
# The value is a comma-separated list of allowed domains
# The value is a comma-separated list of allowed domains
ENV RAILS_DEVELOPMENT_HOSTS=".githubpreview.dev,.preview.app.github.dev,.app.github.dev"

# Fix for expired Yarn GPG key
RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg \
| sudo gpg \
--batch \
--yes \
--dearmor \
-o /usr/share/keyrings/yarn-archive-keyring.gpg

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# Force a recent bundler version.
RUN gem install bundler ruby-lsp ruby-lsp-rails ruby-lsp-rails-factory-bot ruby-lsp-rspec
RUN gem update --system 4.0.6

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
62 changes: 49 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Features to add to the dev container. More info: https://containers.dev/features.
// Features to add to the
// dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "libpq-dev, libvips, postgresql-client" // For postgres tooling
Expand All @@ -17,7 +18,7 @@
"version": "3.4.4" // Change to match Ruby version from Gemfile
},
"ghcr.io/devcontainers/features/node:1": {
"version": 19 // Change Node version as required
"version": 20 // Change Node version as required
},
"ghcr.io/devcontainers/features/common-utils:2.4.3": {
"username": "vscode",
Expand All @@ -36,10 +37,40 @@
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"workbench.iconTheme": "vscode-icons",
"editor.formatOnSave": false,
"emmet.includeLanguages": {
"erb": "html"
},
"rubocop.yjitEnabled": false,
"rubyLsp.enabledFeatures": {
"codeActions": true,
"codeLens": true,
"completion": true,
"definition": true,
"diagnostics": true,
"documentHighlights": true,
"documentLink": true,
"documentSymbols": true,
"foldingRanges": true,
"formatting": true,
"hover": true,
"inlayHint": true,
"onTypeFormatting": true,
"selectionRanges": true,
"semanticHighlighting": true,
"signatureHelp": true,
"typeHierarchy": true,
"workspaceSymbol": true
},
"rubyLsp.featuresConfiguration": {},
"rubyLsp.formatter": "auto",
"rubyLsp.rubyVersionManager": {
"identifier": "auto"
},
"rubyLsp.rubyExecutablePath": "bundle exec ruby",
"rubyLsp.useBundler": true,
"rubyTestExplorer.debugCommand": "bundle exec rdebug-ide",
"rubyTestExplorer.testFramework": "rspec",
"sqltools.connections": [
{
"name": "Rails Development Database",
Expand All @@ -64,27 +95,32 @@
"password": "postgres"
}
],
"ruby.format": "rubocop",
"rubocop.yjitEnabled": false,
"editor.formatOnSave": false
"workbench.iconTheme": "vscode-icons",
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp", // Use the Ruby LSP as the default formatter
"editor.formatOnSave": true, // Format files automatically when saving
"editor.tabSize": 2, // Use 2 spaces for indentation
"editor.insertSpaces": true, // Use spaces and not tabs for indentation
"editor.semanticHighlighting.enabled": true, // Enable semantic highlighting
"editor.formatOnType": true // Enable formatting while typing
}
},
"extensions": [
"IBM.output-colorizer",
"aki77.rails-db-schema",
"bung87.rails",
"bung87.vscode-gemfile",
"connorshea.vscode-ruby-test-adapter",
"eamodio.gitlens",
"github.vscode-github-actions",
"hbenl.vscode-test-explorer",
"IBM.output-colorizer",
"iliazeus.vscode-ansi",
"manuelpuyol.erb-linter",
"ms-azuretools.vscode-docker",
"mtxr.sqltools",
"mtxr.sqltools-driver-pg",
"rubocop.vscode-rubocop",
"mtxr.sqltools",
"ruby-slim.tmbundle",
"Shopify.ruby-lsp",
"vscode-icons-team.vscode-icons",
"waderyan.gitblame",
"github.vscode-github-actions"
"waderyan.gitblame"
]
}
},
Expand Down
31 changes: 31 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "ruby_lsp",
"name": "Launch Server (debug)",
"request": "launch",
"program": "bundle exec rdbg -O -n -c -- bin/rails server --no-log-to-stdout",
},
{
"type": "ruby_lsp",
"name": "Attach debugger",
"request": "attach"
},
// This will prompt for a rake task name and attach a debugger to it.
{
"type": "ruby_lsp",
"name": "Rake Task",
"request": "launch",
"program": "bundle exec rake ${input:rakeTaskName}",
},
],
"inputs": [
{
"id": "rakeTaskName",
"type": "promptString",
"description": "Enter rake task name",
"default": ""
}
]
}
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gem 'rails', '~> 7'
gem 'pg', '~> 1.1'

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '~> 6.4'
gem 'puma'

gem 'parslet'

Expand Down Expand Up @@ -58,8 +58,7 @@ group :development, :test do
# Lock to 8.0.3 because we don't have CSP middleware and the next version crashes without it.
gem 'bullet', '8.0.3'
gem 'bundler-audit', '~> 0.9.0'
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'debug', platforms: %i[mri mingw x64_mingw]
gem 'debug'
gem 'factory_bot_rails'
gem 'faker'
gem 'graphiti_spec_helpers'
Expand Down
Loading