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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
bundler-cache: true

- name: Scan for common Rails security vulnerabilities using static analysis
run: bin/brakeman --no-pager
run: bin/brakeman --no-pager --no-exit-on-warn

scan_js:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -66,11 +66,11 @@ jobs:
- 5432:5432
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3

# redis:
# image: redis
# ports:
# - 6379:6379
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Install packages
Expand Down
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ inherit_gem: { rubocop-rails-omakase: rubocop.yml }
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
# Layout/SpaceInsideArrayLiteralBrackets:
# Enabled: false

AllCops:
Exclude:
- "db/schema.rb"
- "bin/**/*"
- "node_modules/**/*"
- "vendor/**/*"
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ gem "httparty", "~> 0.22"

# AWS SDK for Cloudflare R2 (S3-compatible)
gem "aws-sdk-s3", "~> 1.0"
gem "brakeman", "~> 7.1.0"
gem "brakeman", "~> 8.0"

# Markdown processing
gem "redcarpet", "~> 3.5"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ GEM
bindex (0.8.1)
bootsnap (1.18.4)
msgpack (~> 1.2)
brakeman (7.1.2)
brakeman (8.0.4)
racc
builder (3.3.0)
capybara (3.40.0)
Expand Down Expand Up @@ -240,6 +240,7 @@ GEM
parser (3.3.7.1)
ast (~> 2.4.1)
racc
pdf-core (0.10.0)
pg (1.5.9)
pp (0.6.2)
prettyprint
Expand All @@ -249,7 +250,6 @@ GEM
ttfunk (~> 1.8)
prawn-table (0.2.2)
prawn (>= 1.3.0, < 3.0.0)
pdf-core (0.10.0)
prettyprint (0.2.0)
propshaft (1.1.0)
actionpack (>= 7.0.0)
Expand Down Expand Up @@ -452,7 +452,7 @@ PLATFORMS
DEPENDENCIES
aws-sdk-s3 (~> 1.0)
bootsnap
brakeman (~> 7.1.0)
brakeman (~> 8.0)
capybara
cssbundling-rails
debug
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/invoices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def set_invoice
def invoice_params
params.require(:invoice).permit(
:client_id, :issue_date, :due_date, :status, :notes, :tax_rate,
line_items_attributes: [:id, :description, :quantity, :unit_price_cents, :_destroy]
line_items_attributes: [ :id, :description, :quantity, :unit_price_cents, :_destroy ]
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/harness/diff/fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def call(pr_url)
def parse_url(url)
match = url.match(GITHUB_PR_PATTERN)
raise Harness::Error, "Invalid GitHub PR URL: #{url}" unless match
[match[1], match[2], match[3]]
[ match[1], match[2], match[3] ]
end

def fetch_diff(owner, repo, number)
Expand Down
4 changes: 2 additions & 2 deletions app/lib/harness/diff/hunk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def deletions
end

def to_s
[header, *lines].join("\n")
[ header, *lines ].join("\n")
end

private

def parse_header
match = header.match(/@@ -(\d+)(?:,\d+)? \+(\d+)/)
[match[1].to_i, match[2].to_i]
[ match[1].to_i, match[2].to_i ]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/harness/review/section_review.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(llm_client:)

def call(file_change:, context: "")
prompt = build_prompt(file_change, context)
response = @llm.complete(messages: [prompt], system: system_prompt)
response = @llm.complete(messages: [ prompt ], system: system_prompt)
parse_findings(response.parsed_json, file_change.filename)
end

Expand Down
2 changes: 1 addition & 1 deletion app/lib/harness/review/synthesis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(llm_client:)

def call(findings:, human_comments: [])
prompt = build_prompt(findings, human_comments)
response = @llm.complete(messages: [prompt], system: system_prompt)
response = @llm.complete(messages: [ prompt ], system: system_prompt)
response.parsed_json
end

Expand Down
2 changes: 1 addition & 1 deletion app/lib/harness/review/triage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(llm_client:)

def call(file_changes:, pr_description: "")
prompt = build_prompt(file_changes, pr_description)
response = @llm.complete(messages: [prompt], system: system_prompt)
response = @llm.complete(messages: [ prompt ], system: system_prompt)
classify(file_changes, response.parsed_json)
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Client < ApplicationRecord
validates :zip, presence: true

def full_address
parts = [address_line1]
parts = [ address_line1 ]
parts << address_line2 if address_line2.present?
parts << "#{city}, #{state} #{zip}"
parts.join("\n")
Expand Down
2 changes: 1 addition & 1 deletion app/models/review.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Review < ApplicationRecord
COMPLETE = "complete"
FAILED = "failed"

STATUSES = [PENDING, REVIEWING, COMPLETE, FAILED].freeze
STATUSES = [ PENDING, REVIEWING, COMPLETE, FAILED ].freeze

has_many :review_sections, dependent: :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/models/review_section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class ReviewSection < ApplicationRecord
REVIEWING = "reviewing"
COMPLETE = "complete"

STATUSES = [PENDING, REVIEWING, COMPLETE].freeze
STATUSES = [ PENDING, REVIEWING, COMPLETE ].freeze

belongs_to :review

Expand Down
26 changes: 13 additions & 13 deletions app/services/invoice_pdf_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(invoice)
end

def generate
pdf = Prawn::Document.new(page_size: "LETTER", margin: [50, 50, 50, 50])
pdf = Prawn::Document.new(page_size: "LETTER", margin: [ 50, 50, 50, 50 ])

draw_header(pdf)
draw_divider(pdf)
Expand All @@ -26,7 +26,7 @@ def draw_header(pdf)
pdf.font "Helvetica"

# Left side - sender info
pdf.bounding_box([0, pdf.cursor], width: 300) do
pdf.bounding_box([ 0, pdf.cursor ], width: 300) do
pdf.font("Helvetica", style: :bold, size: 22) { pdf.text "AUSTIN FRENCH" }
pdf.move_down 4
pdf.font("Helvetica", size: 10) do
Expand All @@ -41,7 +41,7 @@ def draw_header(pdf)

# Right side - invoice meta
top = pdf.bounds.top
pdf.bounding_box([pdf.bounds.width - 200, top], width: 200) do
pdf.bounding_box([ pdf.bounds.width - 200, top ], width: 200) do
pdf.fill_color "999999"
pdf.font("Helvetica", style: :bold, size: 28) do
pdf.text "INVOICE", align: :right
Expand All @@ -65,7 +65,7 @@ def draw_header(pdf)

def draw_divider(pdf)
pdf.fill_color ACCENT_COLOR
pdf.fill_rectangle [0, pdf.cursor], pdf.bounds.width, 2
pdf.fill_rectangle [ 0, pdf.cursor ], pdf.bounds.width, 2
pdf.fill_color "000000"
pdf.move_down 20
end
Expand Down Expand Up @@ -103,11 +103,11 @@ def draw_line_items_table(pdf)
]
end

pdf.table([header] + rows, width: pdf.bounds.width, cell_style: { size: 10, padding: [8, 6] }) do |t|
pdf.table([ header ] + rows, width: pdf.bounds.width, cell_style: { size: 10, padding: [ 8, 6 ] }) do |t|
t.row(0).font_style = :bold
t.row(0).text_color = "999999"
t.row(0).size = 9
t.row(0).borders = [:bottom]
t.row(0).borders = [ :bottom ]
t.row(0).border_width = 1
t.row(0).border_color = "E5E5E5"

Expand All @@ -117,7 +117,7 @@ def draw_line_items_table(pdf)
t.columns(3).width = pdf.bounds.width * 0.19

(1..rows.length).each do |i|
t.row(i).borders = [:bottom]
t.row(i).borders = [ :bottom ]
t.row(i).border_width = 0.5
t.row(i).border_color = "F0F0F0"
t.row(i).text_color = "333333"
Expand All @@ -133,7 +133,7 @@ def draw_line_items_table(pdf)
def draw_totals(pdf)
totals_x = pdf.bounds.width - 220

pdf.bounding_box([totals_x, pdf.cursor], width: 220) do
pdf.bounding_box([ totals_x, pdf.cursor ], width: 220) do
# Subtotal
draw_total_row(pdf, "Subtotal", format_money(@invoice.subtotal_cents))

Expand All @@ -143,15 +143,15 @@ def draw_totals(pdf)

pdf.move_down 4
pdf.fill_color ACCENT_COLOR
pdf.fill_rectangle [0, pdf.cursor], 220, 2
pdf.fill_rectangle [ 0, pdf.cursor ], 220, 2
pdf.fill_color "000000"
pdf.move_down 8

# Total
pdf.font("Helvetica", style: :bold, size: 13) do
pdf.text_box "TOTAL", at: [0, pdf.cursor], width: 110
pdf.text_box "TOTAL", at: [ 0, pdf.cursor ], width: 110
pdf.fill_color ACCENT_COLOR
pdf.text_box format_money(@invoice.total_cents), at: [110, pdf.cursor], width: 110, align: :right
pdf.text_box format_money(@invoice.total_cents), at: [ 110, pdf.cursor ], width: 110, align: :right
pdf.fill_color "000000"
end
pdf.move_down 20
Expand All @@ -162,9 +162,9 @@ def draw_total_row(pdf, label, amount)
pdf.font("Helvetica", size: 10) do
start_y = pdf.cursor
pdf.fill_color "666666"
pdf.text_box label, at: [0, start_y], width: 110
pdf.text_box label, at: [ 0, start_y ], width: 110
pdf.fill_color "333333"
pdf.text_box amount, at: [110, start_y], width: 110, align: :right
pdf.text_box amount, at: [ 110, start_y ], width: 110, align: :right
pdf.fill_color "000000"
end
pdf.move_down 18
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
get "/endless/:id/timer", to: "endless#timer", as: :endless_story_timer

# Code Review Harness
resources :reviews, only: [:index, :create, :show] do
resources :reviews, only: [ :index, :create, :show ] do
member do
post :synthesize
end
Expand Down
81 changes: 80 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading