diff --git a/.erb_lint.yml b/.erb_lint.yml new file mode 100644 index 0000000..ef83977 --- /dev/null +++ b/.erb_lint.yml @@ -0,0 +1,26 @@ +glob: "**/*.{html,text,js}{+*,}.erb" +exclude: + - '**/vendor/**/*' + - '**/node_modules/**/*' +linters: + Rubocop: + enabled: true + rubocop_config: + inherit_from: + - .rubocop.yml + Layout/InitialIndentation: + Enabled: false + Layout/LineLength: + Enabled: false + Layout/TrailingEmptyLines: + Enabled: false + Layout/TrailingWhitespace: + Enabled: false + Naming/FileName: + Enabled: false + Style/FrozenStringLiteralComment: + Enabled: false + Lint/UselessAssignment: + Enabled: false + Rails/OutputSafety: + Enabled: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 038861c..3be9891 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,6 +53,9 @@ jobs: - name: Lint code for consistent style run: bin/rubocop -f github + - name: Lint ERB templates + run: bundle exec erb_lint --lint-all + test: runs-on: ubuntu-latest diff --git a/Gemfile b/Gemfile index 729436f..e8dff7a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,6 @@ ruby "3.3.5" gem "bootsnap", require: false gem "dotenv-rails", "~> 3.1" -gem "haml-rails", "~> 2.1" gem "httparty", "~> 0.22.0" gem "importmap-rails" gem "jbuilder" @@ -21,6 +20,7 @@ group :development, :test do gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" gem "brakeman", require: false gem "rubocop-rails-omakase", require: false + gem "erb_lint", "~> 0.7.0" end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 13fb6dc..d702d12 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,6 +75,13 @@ GEM public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) base64 (0.2.0) + better_html (2.1.1) + actionview (>= 6.0) + activesupport (>= 6.0) + ast (~> 2.0) + erubi (~> 1.4) + parser (>= 2.4) + smart_properties bigdecimal (3.1.8) bindex (0.8.1) bootsnap (1.18.4) @@ -104,18 +111,16 @@ GEM dotenv (= 3.1.4) railties (>= 6.1) drb (2.2.1) + erb_lint (0.7.0) + activesupport + better_html (>= 2.0.1) + parser (>= 2.7.1.4) + rainbow + rubocop (>= 1) + smart_properties erubi (1.13.0) globalid (1.2.1) activesupport (>= 6.1) - haml (6.3.0) - temple (>= 0.8.2) - thor - tilt - haml-rails (2.1.0) - actionpack (>= 5.1) - activesupport (>= 5.1) - haml (>= 4.0.6) - railties (>= 5.1) httparty (0.22.0) csv mini_mime (>= 1.0.0) @@ -267,6 +272,7 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) + smart_properties (1.17.0) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -286,9 +292,7 @@ GEM tailwindcss-ruby (3.4.14-arm64-darwin) tailwindcss-ruby (3.4.14-x86_64-darwin) tailwindcss-ruby (3.4.14-x86_64-linux) - temple (0.10.3) thor (1.3.2) - tilt (2.4.0) timeout (0.4.1) turbo-rails (2.0.11) actionpack (>= 6.0.0) @@ -325,7 +329,7 @@ DEPENDENCIES capybara debug dotenv-rails (~> 3.1) - haml-rails (~> 2.1) + erb_lint (~> 0.7.0) httparty (~> 0.22.0) importmap-rails jbuilder diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 19ca21a..23394dd 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -2,9 +2,9 @@

IBK Dashboard

- Code is auf <%= link_to('Github', 'https://github.com/bonflintstone/ibk-dashboard', target: '_blank', class: 'underline') %> -
- Feedback and Suggestions via <%= link_to("Mail", "mailto:waxen_junkier.0v@icloud.com", class: 'underline') %> + Code is auf <%= link_to("Github", "https://github.com/bonflintstone/ibk-dashboard", target: "_blank", class: "underline") %> +
+ Feedback and Suggestions via <%= link_to("Mail", "mailto:waxen_junkier.0v@icloud.com", class: "underline") %>

@@ -13,17 +13,17 @@

- <%= link_to 'All', root_path, class: 'gap-1 rounded px-2 py-1 m-1 border' %> + <%= link_to "All", root_path, class: "gap-1 rounded px-2 py-1 m-1 border" %> <% Event::ORGANIZATIONS_BY_TYPE.each do |type, organizations| %> - <%= link_to type, root_path(organizations:), class: 'gap-1 rounded px-2 py-1 m-1 border' %> + <%= link_to type, root_path(organizations:), class: "gap-1 rounded px-2 py-1 m-1 border" %> <% end %>
- <%= form_tag(root_path, method: 'GET', data: { controller: :form }) do |f| %> + <%= form_tag(root_path, method: "GET", data: { controller: :form }) do |f| %>
<% Event::ORGANIZATIONS.each do |organization| %> <% end %> @@ -34,15 +34,15 @@

<%= l(date, format: "%A %d.%m.%Y") %>

<% events.each do |event| %> - <%= link_to event.link, target: '_blank' do %> + <%= link_to event.link, target: "_blank" do %>

<%= event.datetime.strftime("%H:%M") %> - <%= event.location != event.organization ? "#{event.organization}," : '' %> + <%= event.location != event.organization ? "#{event.organization}," : "" %> <%= event.location %>

<%= event.name %>

-

<%= event.description.truncate_words(20, omission: '...') %>

+

<%= event.description.truncate_words(20, omission: "...") %>

<% end %> <% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2795ec5..f0f8aee 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,7 +12,7 @@ - <%= favicon_link_tag asset_path('favicon.png') %> + <%= favicon_link_tag asset_path("favicon.png") %> <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> <%= javascript_importmap_tags %>