diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 6fe72226..1e66166c 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -3,4 +3,3 @@ ### What happened? (actual results) ### What should have happened? (expected results) - diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 00000000..9cff6adb --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,14 @@ +default: true +line-length: false +first-line-h1: false +first-header-h1: false +ol-prefix: false +fenced-code-language: false +commands-show-output: false +list-indent: false +no-duplicate-header: false +no-trailing-punctuation: false +no-multiple-space-blockquote: false +no-bare-urls: false +no-inline-html: false +ul-indent: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b6d8f95c..b0d1ed87 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,4 @@ --- -files: | - (?x)^( - ^terraform\/\S+ | - .circleci\/\S+ | - .pre\-commit\-config.yaml - ) - repos: - repo: https://github.com/antonbabenko/pre-commit-terraform rev: v1.86.0 @@ -25,3 +18,29 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml + + - repo: https://github.com/zahorniak/pre-commit-circleci.git + rev: v0.6 + hooks: + - id: circleci_validate + args: + - --org-id=da607531-93bb-4321-90ed-08710434ce1c + + - repo: https://github.com/gitleaks/gitleaks + rev: v8.16.1 + hooks: + - id: gitleaks + + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.38.0 + hooks: + - id: markdownlint + args: + - "--ignore" + - terraform + - "--fix" + + - repo: https://github.com/gitleaks/gitleaks + rev: v8.16.1 + hooks: + - id: gitleaks diff --git a/README.md b/README.md index 924d72b9..d4e882aa 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,15 @@ - Rails 7.0 - NodeJS & Yarn +> Make sure you install and enable all pre-commit hooks https://pre-commit.com/ + ## Setting up the app in development +> Make sure you install and enable all pre-commit hooks https://pre-commit.com/ + 1. Run `bin/setup` 2. Followed by `bin/rails s` -3. Navigate to http://localhost:3002 +3. Navigate to ## Whats included? @@ -22,23 +26,25 @@ - Dotenv (managing environment variables) ## Running specs -``` + +```sh bundle exec rspec ``` ## Running locally in docker-compose -### Prerequisites - -* You have working Docker environment -* You have docker-compose installed +You'll need: +- Working Docker environment +- Docker-compose installed ### Run - 1. Clone this repo and change to it's root directory - 2. Run ``docker-compose up `` - 3. Open your browser to `http://0.0.0.0:3000/duty-calculator/ping` to verify it's running. - 4. Start the journey with the commodity ID you want to test (It uses the dev environment API by default) - e.g `http://0.0.0.0:3000/duty-calculator/uk/9620001000/import-date` +1. Clone this repo and change to it's root directory +2. Run ``docker-compose up`` +3. Open your browser to `http://0.0.0.0:3000/duty-calculator/ping` + to verify it's running. +4. Start the journey with the commodity ID you want to test + (It uses the dev environment API by default) +e.g `http://0.0.0.0:3000/duty-calculator/uk/9620001000/import-date` diff --git a/app/views/steps/certificate_of_origin/show.html.erb b/app/views/steps/certificate_of_origin/show.html.erb index 6db66d85..066fc297 100644 --- a/app/views/steps/certificate_of_origin/show.html.erb +++ b/app/views/steps/certificate_of_origin/show.html.erb @@ -8,4 +8,3 @@ <% end %> <%= render 'shared/commodity_details' %> - diff --git a/app/views/steps/country_of_origin/_xi_options.html.erb b/app/views/steps/country_of_origin/_xi_options.html.erb index e67258bb..19b3c400 100644 --- a/app/views/steps/country_of_origin/_xi_options.html.erb +++ b/app/views/steps/country_of_origin/_xi_options.html.erb @@ -10,7 +10,7 @@ When autocomplete results are available, use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures. <% end %> - + <% end %> <%= f.govuk_submit %> <% end %> diff --git a/app/views/steps/country_of_origin/show.html.erb b/app/views/steps/country_of_origin/show.html.erb index bb015976..ab8e94ce 100644 --- a/app/views/steps/country_of_origin/show.html.erb +++ b/app/views/steps/country_of_origin/show.html.erb @@ -17,4 +17,3 @@ - diff --git a/app/views/steps/duty/show.html.erb b/app/views/steps/duty/show.html.erb index 6da0407a..0b275686 100644 --- a/app/views/steps/duty/show.html.erb +++ b/app/views/steps/duty/show.html.erb @@ -19,4 +19,3 @@

Please note - the current page uses an exchange rate of <%= @gbp_to_eur_exchange_rate %> GBP to EUR.

<% end %> <% end %> - diff --git a/app/views/steps/interstitial/show.html.erb b/app/views/steps/interstitial/show.html.erb index 373b13e5..57de1e70 100644 --- a/app/views/steps/interstitial/show.html.erb +++ b/app/views/steps/interstitial/show.html.erb @@ -5,4 +5,3 @@ <%= render interstitial_partial_options %> <%= link_to('Continue', @step.next_step_path, class: 'govuk-button') %> - diff --git a/app/views/steps/measure_amount/show.html.erb b/app/views/steps/measure_amount/show.html.erb index 6bf8d75e..60db6f4a 100644 --- a/app/views/steps/measure_amount/show.html.erb +++ b/app/views/steps/measure_amount/show.html.erb @@ -35,4 +35,3 @@ - diff --git a/app/webpacker/packs/country-of-origin.js b/app/webpacker/packs/country-of-origin.js index a8245ae3..17aba9e1 100644 --- a/app/webpacker/packs/country-of-origin.js +++ b/app/webpacker/packs/country-of-origin.js @@ -4,4 +4,3 @@ var country_autocomplete = new CountryAutocomplete(); var target = document.querySelector('[id^="steps-country-of-origin-country-of-origin-field"]') country_autocomplete.enhanceElement(target); - diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc index bad28098..5363629f 100644 --- a/config/credentials.yml.enc +++ b/config/credentials.yml.enc @@ -1 +1 @@ -LJp2EUqJuHQDTwyUFYrv3y4I23PhZLBU2+AsEvVcT+9nnKY1J5bvesV9WFiVz+ko/kNTm+COMDlNSox6QWKTZF6FacSVQpXt51J0vxE3b9VVv5gQ3YD7+uHTxfMcnBtRPxwhpyDQ9xPqtc8pO2dteLSevvCKsTGJ2N17hrVvYyqe+wDImRJrElyx6W7a4aQ+jlR02MRegP2DcPvzpHYbiQ/2RP5WGE0m0+d5wmmHqzQqwMwsJEiil6pviOMSf3wdF/lQONXyKM6FvUnXDFS2l6W9QDEOTCJsmd1vRgPs0+/2l72pV/sGdNoMBN15ru8LGyJO8Tp69yH+SNaVYO/nzqXUvIf+HucmbnzMzOvol5i2aq5mdKGKvZMJ93BhCwTKlDGQdg9rnN6ci5OyVd1COhAYkiaMDwyqVffn--vvb8B6enysuxLyD3--/q19OcQU8tU+BtMwi0ojYA== \ No newline at end of file +LJp2EUqJuHQDTwyUFYrv3y4I23PhZLBU2+AsEvVcT+9nnKY1J5bvesV9WFiVz+ko/kNTm+COMDlNSox6QWKTZF6FacSVQpXt51J0vxE3b9VVv5gQ3YD7+uHTxfMcnBtRPxwhpyDQ9xPqtc8pO2dteLSevvCKsTGJ2N17hrVvYyqe+wDImRJrElyx6W7a4aQ+jlR02MRegP2DcPvzpHYbiQ/2RP5WGE0m0+d5wmmHqzQqwMwsJEiil6pviOMSf3wdF/lQONXyKM6FvUnXDFS2l6W9QDEOTCJsmd1vRgPs0+/2l72pV/sGdNoMBN15ru8LGyJO8Tp69yH+SNaVYO/nzqXUvIf+HucmbnzMzOvol5i2aq5mdKGKvZMJ93BhCwTKlDGQdg9rnN6ci5OyVd1COhAYkiaMDwyqVffn--vvb8B6enysuxLyD3--/q19OcQU8tU+BtMwi0ojYA== diff --git a/config/initializers/new_framework_defaults_7_1.rb b/config/initializers/new_framework_defaults_7_1.rb index e18bbf30..d4964ed1 100644 --- a/config/initializers/new_framework_defaults_7_1.rb +++ b/config/initializers/new_framework_defaults_7_1.rb @@ -38,7 +38,7 @@ ### # Active Record Encryption now uses SHA-256 as its hash digest algorithm. -# +# # There are 3 scenarios to consider. # # 1. If you have data encrypted with previous Rails versions, and you have diff --git a/spec/fixtures/uk/commodities/0102291010.json b/spec/fixtures/uk/commodities/0102291010.json index 3feb4154..34cb949e 100644 --- a/spec/fixtures/uk/commodities/0102291010.json +++ b/spec/fixtures/uk/commodities/0102291010.json @@ -9595,4 +9595,4 @@ "description_plain": "Of a weight not exceeding 80 kg" } ] -} \ No newline at end of file +} diff --git a/spec/fixtures/uk/commodities/0809400500.json b/spec/fixtures/uk/commodities/0809400500.json index efde9281..484fd327 100644 --- a/spec/fixtures/uk/commodities/0809400500.json +++ b/spec/fixtures/uk/commodities/0809400500.json @@ -5951,4 +5951,4 @@ "description_plain": "Plums and sloes" } ] -} \ No newline at end of file +} diff --git a/spec/fixtures/uk/commodities/1516209821.json b/spec/fixtures/uk/commodities/1516209821.json index dc506139..15f3c873 100644 --- a/spec/fixtures/uk/commodities/1516209821.json +++ b/spec/fixtures/uk/commodities/1516209821.json @@ -14563,4 +14563,4 @@ "meta": null } ] -} \ No newline at end of file +} diff --git a/spec/fixtures/uk/geographical_areas.json b/spec/fixtures/uk/geographical_areas.json index c4ded02f..13a5f9d5 100644 --- a/spec/fixtures/uk/geographical_areas.json +++ b/spec/fixtures/uk/geographical_areas.json @@ -26019,4 +26019,4 @@ } ] } -] \ No newline at end of file +] diff --git a/spec/fixtures/uk/geographical_areas/countries.json b/spec/fixtures/uk/geographical_areas/countries.json index 940f8f9c..8e53d224 100644 --- a/spec/fixtures/uk/geographical_areas/countries.json +++ b/spec/fixtures/uk/geographical_areas/countries.json @@ -2087,4 +2087,4 @@ ] } -] \ No newline at end of file +] diff --git a/spec/fixtures/xi/commodities/0103921100.json b/spec/fixtures/xi/commodities/0103921100.json index 633a9cdc..8651cca3 100644 --- a/spec/fixtures/xi/commodities/0103921100.json +++ b/spec/fixtures/xi/commodities/0103921100.json @@ -9622,4 +9622,4 @@ "description_plain": "Domestic species" } ] -} \ No newline at end of file +}