diff --git a/.erb-lint.yml b/.erb-lint.yml new file mode 100644 index 00000000..5b4eaa6b --- /dev/null +++ b/.erb-lint.yml @@ -0,0 +1,9 @@ +EnableDefaultLinters: true +linters: + Rubocop: + enabled: true + only: [Style/StringLiterals] + rubocop_config: + Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26daf58e..ebb49a02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,9 @@ jobs: - name: Lint code for consistent style run: bin/rubocop -f github + - name: Lint templates for consistent style + run: ./bin/erblint ./app/**/*.erb + test: runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/Gemfile b/Gemfile index 39428350..083f8a91 100644 --- a/Gemfile +++ b/Gemfile @@ -48,6 +48,7 @@ group :development, :test do gem "dotenv-rails" gem "letter_opener" gem "i18n-tasks" + gem "erb_lint" end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index e149054d..1b60a41c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -148,6 +148,13 @@ GEM dotenv (= 3.1.0) railties (>= 6.1) drb (2.2.1) + erb_lint (0.5.0) + activesupport + better_html (>= 2.0.1) + parser (>= 2.7.1.4) + rainbow + rubocop + smart_properties erubi (1.12.0) et-orbi (1.2.11) tzinfo @@ -418,6 +425,7 @@ DEPENDENCIES capybara debug dotenv-rails + erb_lint faraday good_job hotwire-livereload diff --git a/app/views/accounts/_account.html.erb b/app/views/accounts/_account.html.erb index ac7c27bc..c8eb02ae 100644 --- a/app/views/accounts/_account.html.erb +++ b/app/views/accounts/_account.html.erb @@ -20,4 +20,4 @@ <% end %> -<% end%> \ No newline at end of file +<% end %> diff --git a/app/views/accounts/_account_list.html.erb b/app/views/accounts/_account_list.html.erb index 7f8319b9..23f71a8c 100644 --- a/app/views/accounts/_account_list.html.erb +++ b/app/views/accounts/_account_list.html.erb @@ -21,7 +21,7 @@
<%= format_money account_value_node.original.balance_money %>
<% end %> <% end %> - <%= link_to new_account_path(step: 'method', type: type.name.demodulize), class: "flex items-center gap-4 px-2 py-3 mb-1 text-gray-500 text-sm font-medium rounded-[10px] hover:bg-gray-100", data: { turbo_frame: "modal" } do %> + <%= link_to new_account_path(step: "method", type: type.name.demodulize), class: "flex items-center gap-4 px-2 py-3 mb-1 text-gray-500 text-sm font-medium rounded-[10px] hover:bg-gray-100", data: { turbo_frame: "modal" } do %> <%= lucide_icon("plus", class: "w-5 h-5") %>New <%= type.model_name.human.downcase %>
<% end %> diff --git a/app/views/accounts/_account_type.html.erb b/app/views/accounts/_account_type.html.erb index d0b1ebe2..b37ebe29 100644 --- a/app/views/accounts/_account_type.html.erb +++ b/app/views/accounts/_account_type.html.erb @@ -1,4 +1,4 @@ -<%= link_to new_account_path(step: 'method', type: type.class.name.demodulize), class: "flex items-center gap-4 w-full text-center focus:outline-none focus:bg-gray-25 border border-transparent focus:border focus:border-gray-200 block px-2 hover:bg-gray-25 rounded-lg p-2" do %> +<%= link_to new_account_path(step: "method", type: type.class.name.demodulize), class: "flex items-center gap-4 w-full text-center focus:outline-none focus:bg-gray-25 border border-transparent focus:border focus:border-gray-200 block px-2 hover:bg-gray-25 rounded-lg p-2" do %> <%= lucide_icon(icon, class: "#{text_color} w-5 h-5") %> diff --git a/app/views/accounts/_account_valuation_list.html.erb b/app/views/accounts/_account_valuation_list.html.erb index f1e83caf..3e0833a3 100644 --- a/app/views/accounts/_account_valuation_list.html.erb +++ b/app/views/accounts/_account_valuation_list.html.erb @@ -25,26 +25,24 @@ <% end %><%= to_accountable_title(Accountable.from_type(group)) %>
·<%= accounts.count %>
-<%= format_money accounts.sum(&:balance_money) %>
+<%= format_money accounts.sum(&:balance_money) %>