Skip to content

Commit a8ec60a

Browse files
authored
Merge pull request #5554 from joelhawksley/herb-ci
Add Herb to CI
2 parents 59382c5 + 410e74d commit a8ec60a

File tree

4 files changed

+93
-4
lines changed

4 files changed

+93
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
ruby-version: 3.4
1313
bundler-cache: true
1414
- run: bundle exec rake rubocop
15+
- run: npx @herb-tools/linter@0.8.10
1516
system_tests:
1617
runs-on: ubuntu-latest
1718
steps:

.herb.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# This file configures Herb for your project and team.
2+
# Settings here take precedence over individual editor preferences.
3+
#
4+
# Herb is a suite of tools for HTML+ERB templates including:
5+
# - Linter: Validates templates and enforces best practices
6+
# - Formatter: Auto-formats templates with intelligent indentation
7+
# - Language Server: Provides IDE support (VS Code, Zed, Neovim, etc.)
8+
#
9+
# Website: https://herb-tools.dev
10+
# Configuration: https://herb-tools.dev/configuration
11+
# GitHub Repo: https://github.com/marcoroth/herb
12+
#
13+
14+
version: 0.8.10
15+
16+
# files:
17+
# # Additional patterns beyond the defaults (**.html, **.rhtml, **.html.erb, etc.)
18+
# include:
19+
# - '**/*.xml.erb'
20+
# - 'custom/**/*.html'
21+
#
22+
# # Patterns to exclude (can exclude defaults too)
23+
# exclude:
24+
# - 'public/**/*'
25+
# - 'tmp/**/*'
26+
27+
linter:
28+
enabled: true
29+
30+
exclude:
31+
- '**/*.html'
32+
- 'vendor/**/*'
33+
34+
# # Exit with error code when diagnostics of this severity or higher are present
35+
# # Valid values: error (default), warning, info, hint
36+
# failLevel: warning
37+
38+
# # Additional patterns beyond the defaults for linting
39+
# include:
40+
# - '**/*.xml.erb'
41+
#
42+
# # Patterns to exclude from linting
43+
# exclude:
44+
# - 'app/views/admin/**/*'
45+
46+
rules:
47+
erb-prefer-image-tag-helper:
48+
enabled: false
49+
# erb-no-extra-newline:
50+
# enabled: false
51+
#
52+
# # Rules can have 'include', 'only', and 'exclude' patterns
53+
# some-rule:
54+
# # Additional patterns to check (additive, ignored when 'only' is present)
55+
# include:
56+
# - 'app/components/**/*'
57+
# # Don't apply this rule to files matching these patterns
58+
# exclude:
59+
# - 'app/views/admin/**/*'
60+
#
61+
# another-rule:
62+
# # Only apply this rule to files matching these patterns (overrides all 'include')
63+
# only:
64+
# - 'app/views/**/*'
65+
# # Exclude still applies even with 'only'
66+
# exclude:
67+
# - 'app/views/admin/**/*'
68+
69+
formatter:
70+
enabled: false
71+
indentWidth: 2
72+
maxLineLength: 80
73+
74+
# # Additional patterns beyond the defaults for formatting
75+
# include:
76+
# - '**/*.xml.erb'
77+
#
78+
# # Patterns to exclude from formatting
79+
# exclude:
80+
# - 'app/views/admin/**/*'
81+
82+
# # Rewriters modify templates during formatting
83+
# rewriter:
84+
# # Pre-format rewriters (modify AST before formatting)
85+
# pre:
86+
# - tailwind-class-sorter
87+
# # Post-format rewriters (modify formatted output string)
88+
# post: []

lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<title>GraphQL Dashboard <%= content_for?(:title) ? " · #{content_for(:title)}" : "" %> </title>
8-
<link rel="stylesheet" href="<%= graphql_dashboard.static_path("bootstrap-5.3.3.min.css") %>" media="screen" />
9-
<link rel="stylesheet" href="<%= graphql_dashboard.static_path("charts.min.css") %>" media="screen" />
10-
<link rel="stylesheet" href="<%= graphql_dashboard.static_path("dashboard.css") %>" media="screen" />
8+
<link rel="stylesheet" href="<%= graphql_dashboard.static_path("bootstrap-5.3.3.min.css") %>" media="screen">
9+
<link rel="stylesheet" href="<%= graphql_dashboard.static_path("charts.min.css") %>" media="screen">
10+
<link rel="stylesheet" href="<%= graphql_dashboard.static_path("dashboard.css") %>" media="screen">
1111
<script src="<%= graphql_dashboard.static_path("bootstrap-5.3.3.min.js") %>"></script>
1212
<script src="<%= graphql_dashboard.static_path("dashboard.js") %>"></script>
1313
<%= csrf_meta_tags %>

spec/dummy/test/controllers/dashboard/landings_controller_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def test_it_doesnt_load_autoloads_files
1010
def test_it_shows_a_landing_page_with_local_static_asset_links
1111
get graphql_dashboard.root_path
1212
assert_includes response.body, "Welcome to the GraphQL-Ruby Dashboard"
13-
assert_includes response.body, '<link rel="stylesheet" href="/dash/statics/bootstrap-5.3.3.min.css" media="screen" />', "it doesn't use config.asset_host"
13+
assert_includes response.body, '<link rel="stylesheet" href="/dash/statics/bootstrap-5.3.3.min.css" media="screen">', "it doesn't use config.asset_host"
1414
end
1515

1616
def test_it_shows_version_and_schema_info

0 commit comments

Comments
 (0)