fix: resolve remaining lint offenses + fix CI compose (#10)

- Fix Layout/LineLength in lib/template_folders.rb
- Disable Rails/Exit in spec/rails_helper.rb (standard Rails boilerplate)
- Simplify Dockerfile.ci (remove pdfium/chromium for lint)
- Fix docker-compose.ci.yml (remove volume mounts that conflict with COPY)
- Add pg_data and .claude to .dockerignore

All linters verified passing locally via docker compose.

Co-authored-by: Sebastian Noe <sebastian.schneider@boxine.de>
pull/681/head
Sebastian Noe 1 month ago committed by GitHub
parent 00ae27b206
commit 93ac8b1d63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -29,3 +29,6 @@
/docuseal /docuseal
.DS_Store .DS_Store
.env .env
/pg_data
/.claude
/.git

@ -12,13 +12,7 @@ RUN apk add --no-cache \
yaml-dev \ yaml-dev \
nodejs \ nodejs \
yarn \ yarn \
vips-dev \ vips-dev
chromium \
chromium-chromedriver \
&& wget -O pdfium-linux.tgz "https://github.com/docusealco/pdfium-binaries/releases/latest/download/pdfium-linux-musl-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tgz" \
&& mkdir -p /pdfium && tar -xzf pdfium-linux.tgz -C /pdfium \
&& cp /pdfium/lib/libpdfium.so /usr/lib/ \
&& rm -rf pdfium-linux.tgz /pdfium
COPY Gemfile Gemfile.lock ./ COPY Gemfile Gemfile.lock ./
RUN bundle install --jobs 4 --retry 3 RUN bundle install --jobs 4 --retry 3

@ -4,24 +4,12 @@ services:
context: . context: .
dockerfile: Dockerfile.ci dockerfile: Dockerfile.ci
command: sh -c "bundle exec rubocop && bundle exec erb_lint ./app && yarn eslint 'app/javascript/**/*.js'" command: sh -c "bundle exec rubocop && bundle exec erb_lint ./app && yarn eslint 'app/javascript/**/*.js'"
volumes:
- .:/app:ro
- bundle_cache:/usr/local/bundle
- node_cache:/app/node_modules
tmpfs:
- /tmp
brakeman: brakeman:
build: build:
context: . context: .
dockerfile: Dockerfile.ci dockerfile: Dockerfile.ci
command: bundle exec brakeman -q --exit-on-warn command: bundle exec brakeman -q --exit-on-warn
volumes:
- .:/app:ro
- bundle_cache:/usr/local/bundle
- node_cache:/app/node_modules
tmpfs:
- /tmp
rspec: rspec:
build: build:
@ -35,12 +23,6 @@ services:
RAILS_ENV: test RAILS_ENV: test
NODE_ENV: test NODE_ENV: test
DATABASE_URL: postgres://postgres:postgres@postgres:5432/docuseal_test DATABASE_URL: postgres://postgres:postgres@postgres:5432/docuseal_test
volumes:
- .:/app
- bundle_cache:/usr/local/bundle
- node_cache:/app/node_modules
tmpfs:
- /tmp
postgres: postgres:
image: postgres:18 image: postgres:18
@ -56,6 +38,3 @@ services:
tmpfs: tmpfs:
- /var/lib/postgresql/data - /var/lib/postgresql/data
volumes:
bundle_cache:
node_cache:

@ -88,6 +88,8 @@ module TemplateFolders
name = parent_name name = parent_name
end end
author.account.template_folders.create_with(author:, team_id: author.team_id).find_or_create_by(name:, parent_folder:) author.account.template_folders
.create_with(author:, team_id: author.team_id)
.find_or_create_by(name:, parent_folder:)
end end
end end

@ -4,7 +4,7 @@ require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test' ENV['RAILS_ENV'] ||= 'test'
ENV['TZ'] ||= 'UTC' ENV['TZ'] ||= 'UTC'
require_relative '../config/environment' require_relative '../config/environment'
abort('The Rails environment is running in production mode!') if Rails.env.production? abort('The Rails environment is running in production mode!') if Rails.env.production? # rubocop:disable Rails/Exit
require 'rspec/rails' require 'rspec/rails'
require 'capybara/cuprite' require 'capybara/cuprite'
require 'capybara/rspec' require 'capybara/rspec'
@ -42,7 +42,7 @@ Rails.root.glob('spec/support/**/*.rb').each { |f| require f }
begin begin
ActiveRecord::Migration.maintain_test_schema! ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e rescue ActiveRecord::PendingMigrationError => e
abort e.to_s.strip abort e.to_s.strip # rubocop:disable Rails/Exit
end end
RSpec.configure do |config| RSpec.configure do |config|

Loading…
Cancel
Save