diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f229b42a..57913d54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: sed -i "s@/home/runner/work/DEFRA/pafs_core@/github/workspace@g" coverage/coverage.json - name: Analyze with SonarCloud - uses: sonarsource/sonarqube-scan-action@master + uses: sonarsource/sonarqube-scan-action@v6.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This is provided automatically by GitHub SONAR_TOKEN: ${{ secrets.RUBY_SONAR_TOKEN }} # This needs to be set in your repo; settings -> secrets diff --git a/Gemfile b/Gemfile index 1e63e98e..0dc567d7 100644 --- a/Gemfile +++ b/Gemfile @@ -38,7 +38,9 @@ group :development, :test do gem "rspec-rails" gem "rubocop" gem "rubocop-capybara" + gem "rubocop-factory_bot" gem "rubocop-rails" + gem "rubocop-rake" gem "rubocop-rspec" gem "rubocop-rspec_rails" gem "shoulda-matchers" diff --git a/Gemfile.lock b/Gemfile.lock index 1bdd7765..4c65513a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -129,8 +129,8 @@ GEM async-pool (0.11.0) async (>= 2.0) aws-eventstream (1.4.0) - aws-partitions (1.1164.0) - aws-sdk-core (3.233.0) + aws-partitions (1.1175.0) + aws-sdk-core (3.234.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) @@ -138,18 +138,18 @@ GEM bigdecimal jmespath (~> 1, >= 1.6.1) logger - aws-sdk-kms (1.112.0) - aws-sdk-core (~> 3, >= 3.231.0) + aws-sdk-kms (1.115.0) + aws-sdk-core (~> 3, >= 3.234.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.199.0) - aws-sdk-core (~> 3, >= 3.231.0) + aws-sdk-s3 (1.201.0) + aws-sdk-core (~> 3, >= 3.234.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) aws-sigv4 (1.12.1) aws-eventstream (~> 1, >= 1.0.2) base64 (0.3.0) - benchmark (0.4.1) - bigdecimal (3.2.3) + benchmark (0.5.0) + bigdecimal (3.3.1) bstard (0.2.4) builder (3.3.0) byebug (12.0.0) @@ -184,11 +184,7 @@ GEM date (3.4.1) defra_ruby_alert (2.2.1) airbrake - defra_ruby_style (0.4.0) - rubocop (>= 1.0, < 2.0) - rubocop-factory_bot - rubocop-rake - rubocop-rspec + defra_ruby_style (0.4.1) defra_ruby_template (5.11.0) diff-lcs (1.6.2) docile (1.4.1) @@ -203,7 +199,7 @@ GEM railties (>= 6.1.0) faker (3.5.2) i18n (>= 1.8.11, < 2) - faraday (2.13.4) + faraday (2.14.0) faraday-net_http (>= 2.0, < 3.5) json logger @@ -248,7 +244,7 @@ GEM rdoc (>= 4.0.0) reline (>= 0.4.2) jmespath (1.6.2) - json (2.15.0) + json (2.15.1) json_schemer (2.4.0) bigdecimal hana (~> 1.3) @@ -284,7 +280,7 @@ GEM metrics (0.15.0) mini_mime (1.1.5) mini_portile2 (2.8.9) - minitest (5.25.5) + minitest (5.26.0) multi_json (1.17.0) net-http (0.6.0) uri @@ -312,7 +308,7 @@ GEM pp (0.6.2) prettyprint prettyprint (0.2.0) - prism (1.5.1) + prism (1.6.0) protocol-hpack (1.5.1) protocol-http (0.54.0) protocol-http1 (0.35.1) @@ -330,7 +326,7 @@ GEM stringio public_suffix (6.0.2) racc (1.8.1) - rack (2.2.17) + rack (2.2.20) rack-cors (2.0.2) rack (>= 2.0.0) rack-session (1.0.2) @@ -405,7 +401,7 @@ GEM rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.13.6) - rubocop (1.80.2) + rubocop (1.81.6) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -413,7 +409,7 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.46.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.47.1) @@ -425,7 +421,7 @@ GEM rubocop-factory_bot (2.27.1) lint_roller (~> 1.1) rubocop (~> 1.72, >= 1.72.1) - rubocop-rails (2.33.3) + rubocop-rails (2.33.4) activesupport (>= 4.2.0) lint_roller (~> 1.1) rack (>= 1.1) @@ -478,7 +474,7 @@ GEM unicode-display_width (3.2.0) unicode-emoji (~> 4.1) unicode-emoji (4.1.0) - uri (1.0.3) + uri (1.0.4) useragent (0.16.11) vcr (6.3.1) base64 @@ -521,7 +517,9 @@ DEPENDENCIES rspec-retry rubocop rubocop-capybara + rubocop-factory_bot rubocop-rails + rubocop-rake rubocop-rspec rubocop-rspec_rails rubyzip diff --git a/app/steps/pafs_core/carbon_operational_cost_forecast_step.rb b/app/steps/pafs_core/carbon_operational_cost_forecast_step.rb index 405f0561..23b6f0e4 100644 --- a/app/steps/pafs_core/carbon_operational_cost_forecast_step.rb +++ b/app/steps/pafs_core/carbon_operational_cost_forecast_step.rb @@ -5,7 +5,8 @@ class CarbonOperationalCostForecastStep < BasicStep include PafsCore::Carbon validates :carbon_operational_cost_forecast, presence: { - message: "You must enter a value" + message: "You must enter a value. If there is no operation or maintenance " \ + "element enter 0. Otherwise enter an estimate above 0." } validates :carbon_operational_cost_forecast, numericality: {