From 281ecdd0e87264c9083d8c93bf1675ac16db797d Mon Sep 17 00:00:00 2001 From: Andreas Zuber Date: Mon, 27 Aug 2018 18:11:18 +0200 Subject: [PATCH] Add haml-lint and generated todo list --- .haml-lint.yml | 3 ++ .haml-lint_todo.yml | 115 ++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 1 + Gemfile | 3 +- Gemfile.lock | 8 +++ 5 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 .haml-lint.yml create mode 100644 .haml-lint_todo.yml diff --git a/.haml-lint.yml b/.haml-lint.yml new file mode 100644 index 000000000..57b49c418 --- /dev/null +++ b/.haml-lint.yml @@ -0,0 +1,3 @@ +inherits_from: .haml-lint_todo.yml +exclude: + - 'vendor/**/*' diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml new file mode 100644 index 000000000..9f9eb6cf4 --- /dev/null +++ b/.haml-lint_todo.yml @@ -0,0 +1,115 @@ +# This configuration was generated by +# `haml-lint --auto-gen-config` +# on 2018-08-27 17:51:09 +0200 using Haml-Lint version 0.28.0. +# The point is for the user to remove these configuration records +# one by one as the lints are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of Haml-Lint, may require this file to be generated again. + +linters: + + # Offense count: 7 + ImplicitDiv: + exclude: + - "app/views/delayed_job_failures/index.html.haml" + - "app/views/layouts/application.html.haml" + - "app/views/nodes/_inventory_service.html.haml" + - "app/views/pages/home.html.haml" + - "app/views/reports/_report.html.haml" + + # Offense count: 142 + LineLength: + enabled: false + + # Offense count: 35 + RuboCop: + enabled: false + + # Offense count: 323 + SpaceInsideHashAttributes: + enabled: false + + # Offense count: 54 + ConsecutiveSilentScripts: + enabled: false + + # Offense count: 12 + InstanceVariables: + exclude: + - "app/views/layouts/_radiator.html.haml" + - "app/views/node_class_memberships/_form.html.haml" + - "app/views/node_group_class_memberships/_form.html.haml" + - "app/views/node_groups/_form.html.haml" + - "app/views/nodes/_form.html.haml" + - "app/views/nodes/_nodes.html.haml" + - "app/views/shared/_node_summary.html.haml" + - "app/views/timeline_events/_timeline_event.html.haml" + + # Offense count: 27 + IdNames: + enabled: false + + # Offense count: 21 + InlineStyles: + enabled: false + + # Offense count: 5 + FinalNewline: + exclude: + - "app/views/node_class_memberships/show.html.haml" + - "app/views/node_group_class_memberships/show.html.haml" + - "app/views/shared/_error.html.haml" + - "app/views/shared/_parameters_part1.html.haml" + - "app/views/shared/_variable_conflicts_table.html.haml" + + # Offense count: 4 + ObjectReferenceAttributes: + exclude: + - "app/views/node_classes/index.html.haml" + - "app/views/node_classes/show.html.haml" + - "app/views/node_groups/index.html.haml" + - "app/views/reports/_reports_table.html.haml" + + # Offense count: 8 + UnnecessaryStringOutput: + exclude: + - "app/views/nodes/_inventory_service.html.haml" + - "app/views/pages/_node_summary_row.haml" + - "app/views/parameters/_parameter_input.html.haml" + - "app/views/shared/_node_manager_sidebar.html.haml" + - "app/views/shared/_skiplink.html.haml" + + # Offense count: 6 + HtmlAttributes: + exclude: + - "app/views/nodes/_nodes.html.haml" + - "app/views/pages/home.html.haml" + - "app/views/reports/_report.html.haml" + + # Offense count: 1 + MultilinePipe: + exclude: + - "app/views/nodes/_nodes.html.haml" + + # Offense count: 3 + TrailingWhitespace: + exclude: + - "app/views/nodes/_reports.html.haml" + - "app/views/reports/_report_title.html.haml" + - "app/views/statuses/_run_failure.html.haml" + + # Offense count: 5 + ClassesBeforeIds: + exclude: + - "app/views/pages/home.html.haml" + - "app/views/parameters/_parameter_input.html.haml" + - "app/views/reports/_report.html.haml" + - "app/views/reports/index.html.haml" + - "app/views/shared/_global_nav.html.haml" + + # Offense count: 5 + RubyComments: + exclude: + - "app/views/parameters/_parameter_input.html.haml" + - "app/views/shared/_parameters.html.haml" + - "app/views/shared/_variables.html.haml" \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 25e172e1d..63473f6b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,3 +20,4 @@ before_script: script: - bundle exec rails spec - bundle exec rubocop + - bundle exec haml-lint diff --git a/Gemfile b/Gemfile index 021fdc632..297723386 100644 --- a/Gemfile +++ b/Gemfile @@ -43,7 +43,8 @@ group :development, :test do gem 'listen' gem 'simplecov' gem 'simplecov-console' - gem "rubocop-rails_config" + gem 'rubocop-rails_config' + gem 'haml_lint', require: false end group :postgresql do diff --git a/Gemfile.lock b/Gemfile.lock index 4fe69b672..893a12b48 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -80,6 +80,12 @@ GEM haml (>= 4.0.6, < 6.0) html2haml (>= 1.0.1) railties (>= 4.0.1) + haml_lint (0.28.0) + haml (>= 4.0, < 5.1) + rainbow + rake (>= 10, < 13) + rubocop (>= 0.50.0) + sysexits (~> 1.1) has_scope (0.7.2) actionpack (>= 4.1) activesupport (>= 4.1) @@ -249,6 +255,7 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.13) + sysexits (1.2.0) temple (0.8.0) therubyracer (0.12.3) libv8 (~> 3.16.14.15) @@ -288,6 +295,7 @@ DEPENDENCIES factory_bot_rails haml haml-rails + haml_lint i18n inherited_resources jquery-rails