diff --git a/rails/erb_lint.yml b/rails/erb_lint.yml new file mode 100644 index 0000000000000000000000000000000000000000..7db595afb110c6cb1457ae847eb018ce40f351f3 --- /dev/null +++ b/rails/erb_lint.yml @@ -0,0 +1,30 @@ +glob: '**/*.{html,text,js}{+*,}.erb' +exclude: + - '**/vendor/**/*' +EnableDefaultLinters: true +linters: + ErbSafety: + enabled: true + FinalNewline: + enabled: true + 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/rails/gitlab-ci.yml b/rails/gitlab-ci.yml index b24c97b2de2a797547c176def2e9fe78213f543d..17f2b0cdfdd209139a4fc7063b7c8b921289df1e 100644 --- a/rails/gitlab-ci.yml +++ b/rails/gitlab-ci.yml @@ -18,7 +18,7 @@ rubocop: - rails script: - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/rubocop.yml" -O ".rubocop.yml" - - gem install rubocop:1.65.1 rubocop-capybara:2.21.0 rubocop-minitest:0.35.1 rubocop-performance:1.21.1 rubocop-rails:2.25.1 --silent + - gem install rubocop:1.70.0 rubocop-capybara:2.21.0 rubocop-minitest:0.36.0 rubocop-performance:1.23.1 rubocop-rails:2.29.0 --silent - rubocop erb_lint: @@ -28,9 +28,9 @@ erb_lint: - rails script: - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/rubocop.yml" -O ".rubocop.yml" - - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/erb-lint.yml" -O ".erb-lint.yml" - - gem install rubocop:1.65.1 rubocop-capybara:2.21.0 rubocop-minitest:0.35.1 rubocop-performance:1.21.1 rubocop-rails:2.25.1 erb_lint:0.6.0 --silent - - erblint --lint-all --allow-no-files true + - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/erb_lint.yml" -O ".erb_lint.yml" + - gem install rubocop:1.70.0 rubocop-capybara:2.21.0 rubocop-minitest:0.36.0 rubocop-performance:1.23.1 rubocop-rails:2.29.0 erb_lint:0.8.0 --silent + - erb_lint --lint-all --allow-no-files true haml_lint: stage: test @@ -40,7 +40,7 @@ haml_lint: script: - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/rubocop.yml" -O ".rubocop.yml" - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/haml-lint.yml" -O ".haml-lint.yml" - - gem install rubocop:1.65.1 rubocop-capybara:2.21.0 rubocop-minitest:0.35.1 rubocop-performance:1.21.1 rubocop-rails:2.25.1 haml_lint:0.58.0 --silent + - gem install rubocop:1.70.0 rubocop-capybara:2.21.0 rubocop-minitest:0.36.0 rubocop-performance:1.23.1 rubocop-rails:2.29.0 haml_lint:0.59.0 --silent - haml-lint brakeman: @@ -50,7 +50,7 @@ brakeman: - rails script: - rm -f ./config/brakeman.yml ./config/brakeman.ignore - - gem install brakeman:6.2.1 --silent + - gem install brakeman:7.0.0 --silent - brakeman -A --except UnscopedFind rails_test_all: diff --git a/rails/rubocop-for-gem.yml b/rails/rubocop-for-gem.yml index 93f3f5330b34765c5e48e2a62f418e29881c8a46..88024554613b03bbc00f59a44674311adfbafa88 100644 --- a/rails/rubocop-for-gem.yml +++ b/rails/rubocop-for-gem.yml @@ -56,7 +56,7 @@ Metrics/BlockLength: # default is too restrictive, having some restriction incentivizes to split up overly large classes Metrics/ClassLength: CountAsOne: *array_hash_heredoc_method_call # default: [] - Max: 200 # default: 100 + Max: 300 # default: 100 Exclude: *test_config_db_gemspec_subconfig # default is too restrictive, allow higher complexity @@ -72,7 +72,7 @@ Metrics/MethodLength: # default is too restrictive, allow longer modules Metrics/ModuleLength: CountAsOne: *array_hash_heredoc_method_call # default: [] - Max: 200 # default: 100 + Max: 300 # default: 100 Exclude: *test_config_db_gemspec_subconfig # long parameter lists add too much complexity, keyword args are named and thus more obvious what is expected, ignore them diff --git a/rails/rubocop.yml b/rails/rubocop.yml index 5464a2a10448795e856b0f87785cb720f975917d..1ed3eaab81ed35d6640f4a26d5a27326b9b3a3d2 100644 --- a/rails/rubocop.yml +++ b/rails/rubocop.yml @@ -4,11 +4,11 @@ require: - rubocop-performance - rubocop-rails -# gem "rubocop", "1.65.1", require: false +# gem "rubocop", "1.70.0", require: false # gem "rubocop-capybara", "2.21.0", require: false -# gem "rubocop-minitest", "0.35.1", require: false -# gem "rubocop-performance", "1.21.1", require: false -# gem "rubocop-rails", "2.25.1", require: false +# gem "rubocop-minitest", "0.36.0", require: false +# gem "rubocop-performance", "1.23.1", require: false +# gem "rubocop-rails", "2.29.0", require: false AllCops: NewCops: enable # pending cops get enabled by default and must be disabled by hand, if needed diff --git a/rails/rubocop/rubocop-base.yml b/rails/rubocop/rubocop-base.yml index 207d8efac3298dc41e28c0e2f11ab99737286b9b..6a5e39db2b2986406645e66cc323d7ac11973c7b 100644 --- a/rails/rubocop/rubocop-base.yml +++ b/rails/rubocop/rubocop-base.yml @@ -1,8 +1,8 @@ require: - rubocop-performance -# gem 'rubocop', '1.65.1', require: false -# gem 'rubocop-performance', '1.21.1', require: false +# gem 'rubocop', '1.70.0', require: false +# gem 'rubocop-performance', '1.23.1', require: false AllCops: NewCops: enable # pending cops get enabled by default and must be disabled by hand, if needed @@ -45,7 +45,7 @@ Metrics/BlockLength: # default is too restrictive, having some restriction incentivizes to split up overly large classes Metrics/ClassLength: CountAsOne: *array_hash_heredoc_method_call # default: [] - Max: 200 # default: 100 + Max: 300 # default: 100 Exclude: *test_config_db # default is too restrictive, allow higher complexity @@ -61,7 +61,7 @@ Metrics/MethodLength: # default is too restrictive, allow longer modules Metrics/ModuleLength: CountAsOne: *array_hash_heredoc_method_call # default: [] - Max: 200 # default: 100 + Max: 300 # default: 100 Exclude: *test_config_db # long parameter lists add too much complexity, keyword args are named and thus more obvious what is expected, ignore them diff --git a/rails/rubocop/rubocop-minitest.yml b/rails/rubocop/rubocop-minitest.yml index 575b66fd716267e4c311fb4a3005ba844938e789..216f40d47588c2b30a4dd9a78ac6d5171423264a 100644 --- a/rails/rubocop/rubocop-minitest.yml +++ b/rails/rubocop/rubocop-minitest.yml @@ -1,8 +1,8 @@ require: - rubocop-minitest -# gem 'rubocop', '1.65.1', require: false -# gem 'rubocop-minitest', '0.35.1', require: false +# gem 'rubocop', '1.70.0', require: false +# gem 'rubocop-minitest', '0.36.0', require: false AllCops: NewCops: enable # pending cops get enabled by default and must be disabled by hand, if needed diff --git a/rails/rubocop/rubocop-rails.yml b/rails/rubocop/rubocop-rails.yml index e39255a81e23296c04c866ca7b7817929bc65a72..ad3e10c396d5c0012d909972b2f0959032d467fa 100644 --- a/rails/rubocop/rubocop-rails.yml +++ b/rails/rubocop/rubocop-rails.yml @@ -1,8 +1,8 @@ require: - rubocop-rails -# gem 'rubocop', '1.65.1', require: false -# gem 'rubocop-rails', '2.25.1', require: false +# gem 'rubocop', '1.70.0', require: false +# gem 'rubocop-rails', '2.29.0', require: false AllCops: NewCops: enable # pending cops get enabled by default and must be disabled by hand, if needed @@ -11,7 +11,7 @@ AllCops: # BEGIN Rails # file paths should be built with arguments instead of a single string Rails/ApplicationController: - Exclude: ['app/controllers/api/**/*', 'app/controllers/a_p_i/**/*'] # exclude API namespace, but not others (convention) + Exclude: ['app/controllers/api/**/*', 'app/controllers/a_p_i/**/*'] # exclude API namespace, but not others (ITC convention) # exclude migrations since non-ApplicationRecord behavior might be desired Rails/ApplicationRecord: