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
14 changes: 0 additions & 14 deletions .better_html.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .erb_lint.yml

This file was deleted.

13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,17 @@ jobs:
- name: Run Rubocop
run: bundle exec rubocop --parallel

- name: Run ERB lint
run: bundle exec erb_lint --lint-all
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install Node packages
run: npm ci

- name: Run Herb lint
run: npm run lint:erb -- --github

- name: Run tests with coverage
run: bin/rails test
Expand Down
132 changes: 132 additions & 0 deletions .herb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# This file configures Herb for your project and team.
# Settings here take precedence over individual editor preferences.
#
# Herb is a suite of tools for HTML+ERB templates including:
# - Linter: Validates templates and enforces best practices
# - Formatter: Auto-formats templates with intelligent indentation
# - Language Server: Provides IDE support (VS Code, Zed, Neovim, etc.)
#
# Website: https://herb-tools.dev
# Configuration: https://herb-tools.dev/configuration
# GitHub Repo: https://github.com/marcoroth/herb
#

version: 0.11.0

# # Framework and template engine configuration
#
# # Options: ruby | actionview | hanami | sinatra (default: ruby)
framework: actionview
#
# # Options: erubi | erb | herb (default: erubi)
# template_engine: erubi

# files:
# # Additional patterns beyond the defaults (**.html, **.rhtml, **.html.erb, etc.)
# include:
# - '**/*.xml.erb'
# - 'custom/**/*.html'
#
# # Patterns to exclude (can exclude defaults too)
# exclude:
# - 'public/**/*'
# - 'tmp/**/*'

# engine:
# validators:
# security: true # default: true
# nesting: true # default: true
# accessibility: true # default: true

linter:
enabled: true

# # Exit with error code when diagnostics of this severity or higher are present
# # Valid values: error (default), warning, info, hint
# failLevel: warning

# # Only report diagnostics of this severity or higher
# # Affects the CLI output only: lower-severity offenses are still counted in the
# # summary and still show up in your editor, they just aren't printed or
# # annotated in CI. Valid values: error, warning, info, hint (default)
# logLevel: warning

# # Additional patterns beyond the defaults for linting
# include:
# - '**/*.xml.erb'
#
# Templates under app/ only, as erb_lint linted before; public/ holds static pages.
exclude:
- 'public/**/*'

# Rules turned off, each with the reason. Everything else Herb 0.11 ships is on.
rules:
# False positive: a form rendered inside `render layout: "users/card" do`
# is read as nested, though the card holds no form.
html-no-nested-forms:
enabled: false
# False positive: the moment card body renders a link only when
# `linked: true`, and the call site inside a link passes no `linked`.
html-no-nested-links:
enabled: false
# The four `href="#"` links are placeholders whose address a Stimulus
# controller sets (mine check, plan viewer, photo gallery).
html-anchor-require-href:
enabled: false
# `tag.attributes(...)` is Rails' helper for attributes in an open tag, and
# `<%= "checked" if ... %>` toggles one; both are used on purpose.
erb-no-output-in-attribute-name:
enabled: false
# Style: a collection render changes the locals a partial sees, so moving
# to it is a refactor of its own, not part of adopting the linter.
actionview-prefer-collection-render:
enabled: false

# rules:
# # The 'all' pseudo rule sets the default for every rule you don't list.
# # false: start from an empty set and opt back in explicitly
# # true: start from every rule, including the ones off by default
# all:
# enabled: false
#
# erb-no-extra-newline:
# enabled: false
#
# # Rules can have 'include', 'only', and 'exclude' patterns
# some-rule:
# # Additional patterns to check (additive, ignored when 'only' is present)
# include:
# - 'app/components/**/*'
# # Don't apply this rule to files matching these patterns
# exclude:
# - 'app/views/admin/**/*'
#
# another-rule:
# # Only apply this rule to files matching these patterns (overrides all 'include')
# only:
# - 'app/views/**/*'
# # Exclude still applies even with 'only'
# exclude:
# - 'app/views/admin/**/*'

formatter:
enabled: false
indentWidth: 2
indentStyle: space
maxLineLength: 80

# # Additional patterns beyond the defaults for formatting
# include:
# - '**/*.xml.erb'
#
# # Patterns to exclude from formatting
# exclude:
# - 'app/views/admin/**/*'

# # Rewriters modify templates during formatting
# rewriter:
# # Pre-format rewriters (modify AST before formatting)
# pre:
# - tailwind-class-sorter
# # Post-format rewriters (modify formatted output string)
# post: []
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ rather than resolving it.

## Product rules that bind every change

- Tests are mandatory (Minitest). CI runs rubocop, erb_lint and the full
suite; run the same locally before pushing.
- Tests are mandatory (Minitest). CI runs rubocop, Herb lint
(`npm run lint:erb`) and the full suite; run the same locally before
pushing.
- Follow the patterns the code already uses before inventing new ones.
- AI prompts live in `app/prompts/` as text files, loaded with
`PromptHelper#load_prompt`, never inline in a service.
Expand Down
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ group :development, :test do

# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
gem "rubocop-rails-omakase", require: false

# ERB linting [https://github.com/Shopify/erb-lint]
gem "erb_lint", require: false
gem "better_html", require: false
end

group :development do
Expand Down
27 changes: 5 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,6 @@ GEM
bcrypt_pbkdf (1.1.2)
bcrypt_pbkdf (1.1.2-arm64-darwin)
bcrypt_pbkdf (1.1.2-x86_64-darwin)
better_html (2.2.0)
actionview (>= 7.0)
activesupport (>= 7.0)
ast (~> 2.0)
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (4.0.1)
bindex (0.8.1)
bootsnap (1.20.1)
Expand Down Expand Up @@ -177,13 +170,6 @@ GEM
drb (2.2.3)
ed25519 (1.4.0)
erb (6.0.1)
erb_lint (0.9.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
rainbow
rubocop (>= 1)
smart_properties
erubi (1.13.1)
et-orbi (1.4.0)
tzinfo
Expand Down Expand Up @@ -472,15 +458,15 @@ GEM
railties (>= 7.0)
rexml (3.4.4)
rollbar (3.7.0)
rubocop (1.82.1)
json (~> 2.3)
rubocop (1.92.0)
json (>= 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.48.0, < 2.0)
regexp_parser (>= 2.11.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.0)
Expand Down Expand Up @@ -531,7 +517,6 @@ GEM
simplecov-html (0.13.2)
simplecov-lcov (0.9.0)
simplecov_json_formatter (0.1.4)
smart_properties (1.17.0)
snaky_hash (2.0.7)
hashie (>= 0.1.0, < 6)
version_gem (~> 1.1, >= 1.1.14)
Expand Down Expand Up @@ -640,15 +625,13 @@ DEPENDENCIES
avo (~> 4.2)
aws-sdk-s3
bcrypt (~> 3.1.7)
better_html
bootsnap
brakeman
bundler-audit
capybara
debug
devise (~> 5.0)
dotenv-rails
erb_lint
faraday
faraday-follow_redirects
flipper
Expand Down
2 changes: 1 addition & 1 deletion app/assets/builds/tailwind.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions app/assets/stylesheets/application.tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -635,3 +635,9 @@
.story-open [data-pwa-install-target] {
display: none !important;
}

/* The cookie banner slides in once the consent controller marks it visible. */
.cookie-consent-banner.cookie-consent-visible {
transform: translateY(0);
opacity: 1;
}
2 changes: 1 addition & 1 deletion app/views/curator/admin/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<p class="text-sm text-red-700 dark:text-red-400 mb-2">Blocked until: <%= @user.spam_blocked_until&.strftime("%d.%m.%Y %H:%M") %></p>
<p class="text-sm text-red-700 dark:text-red-400 mb-4">Reason: <%= @user.spam_block_reason %></p>

<%= form_with url: unblock_curator_admin_user_path(@user), method: :post do |f| %>
<%= form_with url: unblock_curator_admin_user_path(@user), method: :post do %>
<button type="submit"
class="inline-flex items-center justify-center rounded-md bg-green-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-green-500 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2">
Unblock User
Expand Down
2 changes: 1 addition & 1 deletion app/views/locations/_map_panel.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="h-full overflow-y-auto bg-gray-50 dark:bg-gray-900">
<div class="relative">
<% if location.photos.attached? %>
<%= image_tag location.photos.first.variant(:large),
<%= image_tag location.photos.first.variant(:large), alt: location.name,
class: "h-48 w-full object-cover" %>
<% end %>
<button type="button" data-action="map#closePanel"
Expand Down
1 change: 1 addition & 0 deletions app/views/locations/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
<% youtube_id = @location.video_url.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&\?]+)/)&.[](1) %>
<% if youtube_id %>
<iframe
title="<%= @location.name %>"
src="https://www.youtube.com/embed/<%= youtube_id %>"
class="w-full h-full"
frameborder="0"
Expand Down
10 changes: 5 additions & 5 deletions app/views/new_design/explore.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@
class="rounded-full border-0 bg-white dark:bg-gray-700 py-2 pl-3 pr-8 text-sm text-gray-900 dark:text-white shadow-sm ring-1 ring-inset ring-gray-200 dark:ring-gray-600 focus:ring-2 focus:ring-blue-600 dark:focus:ring-yellow-500"
data-explore-target="radiusSelect"
data-action="change->explore#onRadiusChange">
<option value="5" <%= @radius.to_i == 5 ? 'selected' : '' %>>5 km</option>
<option value="10" <%= @radius.to_i == 10 ? 'selected' : '' %>>10 km</option>
<option value="25" <%= @radius.to_i == 25 || @radius.blank? ? 'selected' : '' %>>25 km</option>
<option value="50" <%= @radius.to_i == 50 ? 'selected' : '' %>>50 km</option>
<option value="100" <%= @radius.to_i == 100 ? 'selected' : '' %>>100 km</option>
<option value="5" <% if @radius.to_i == 5 %>selected<% end %>>5 km</option>
<option value="10" <% if @radius.to_i == 10 %>selected<% end %>>10 km</option>
<option value="25" <% if @radius.to_i == 25 || @radius.blank? %>selected<% end %>>25 km</option>
<option value="50" <% if @radius.to_i == 50 %>selected<% end %>>50 km</option>
<option value="100" <% if @radius.to_i == 100 %>selected<% end %>>100 km</option>
</select>
</div>
</div>
Expand Down
Loading