Skip to content

Commit

Permalink
Merge pull request #777 from trade-tariff/BAU-consolidate-pre-commit
Browse files Browse the repository at this point in the history
BAU: Consolidate pre-commit configuration
  • Loading branch information
willfish committed Apr 19, 2024
2 parents e2122f2 + c0fc4c8 commit 46d0e17
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 34 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Expand Up @@ -3,4 +3,3 @@
### What happened? (actual results)

### What should have happened? (expected results)

14 changes: 14 additions & 0 deletions .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
33 changes: 26 additions & 7 deletions .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
Expand All @@ -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
28 changes: 17 additions & 11 deletions README.md
Expand Up @@ -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 <http://localhost:3002>

## Whats included?

Expand All @@ -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`
1 change: 0 additions & 1 deletion app/views/steps/certificate_of_origin/show.html.erb
Expand Up @@ -8,4 +8,3 @@
<% end %>
<%= render 'shared/commodity_details' %>

2 changes: 1 addition & 1 deletion app/views/steps/country_of_origin/_xi_options.html.erb
Expand Up @@ -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.
</div>
<% end %>
<% end %>
<%= f.govuk_submit %>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion app/views/steps/country_of_origin/show.html.erb
Expand Up @@ -17,4 +17,3 @@
</li>
</ul>
</div>

1 change: 0 additions & 1 deletion app/views/steps/duty/show.html.erb
Expand Up @@ -19,4 +19,3 @@
<p class="govuk-body-s">Please note - the current page uses an exchange rate of <strong><%= @gbp_to_eur_exchange_rate %> GBP to EUR</strong>.</p>
<% end %>
<% end %>

1 change: 0 additions & 1 deletion app/views/steps/interstitial/show.html.erb
Expand Up @@ -5,4 +5,3 @@
<%= render interstitial_partial_options %>
<%= link_to('Continue', @step.next_step_path, class: 'govuk-button') %>

1 change: 0 additions & 1 deletion app/views/steps/measure_amount/show.html.erb
Expand Up @@ -35,4 +35,3 @@
</li>
</ul>
</div>

1 change: 0 additions & 1 deletion app/webpacker/packs/country-of-origin.js
Expand Up @@ -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);

2 changes: 1 addition & 1 deletion 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==
LJp2EUqJuHQDTwyUFYrv3y4I23PhZLBU2+AsEvVcT+9nnKY1J5bvesV9WFiVz+ko/kNTm+COMDlNSox6QWKTZF6FacSVQpXt51J0vxE3b9VVv5gQ3YD7+uHTxfMcnBtRPxwhpyDQ9xPqtc8pO2dteLSevvCKsTGJ2N17hrVvYyqe+wDImRJrElyx6W7a4aQ+jlR02MRegP2DcPvzpHYbiQ/2RP5WGE0m0+d5wmmHqzQqwMwsJEiil6pviOMSf3wdF/lQONXyKM6FvUnXDFS2l6W9QDEOTCJsmd1vRgPs0+/2l72pV/sGdNoMBN15ru8LGyJO8Tp69yH+SNaVYO/nzqXUvIf+HucmbnzMzOvol5i2aq5mdKGKvZMJ93BhCwTKlDGQdg9rnN6ci5OyVd1COhAYkiaMDwyqVffn--vvb8B6enysuxLyD3--/q19OcQU8tU+BtMwi0ojYA==
2 changes: 1 addition & 1 deletion config/initializers/new_framework_defaults_7_1.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/uk/commodities/0102291010.json
Expand Up @@ -9595,4 +9595,4 @@
"description_plain": "Of a weight not exceeding 80 kg"
}
]
}
}
2 changes: 1 addition & 1 deletion spec/fixtures/uk/commodities/0809400500.json
Expand Up @@ -5951,4 +5951,4 @@
"description_plain": "Plums and sloes"
}
]
}
}
2 changes: 1 addition & 1 deletion spec/fixtures/uk/commodities/1516209821.json
Expand Up @@ -14563,4 +14563,4 @@
"meta": null
}
]
}
}
2 changes: 1 addition & 1 deletion spec/fixtures/uk/geographical_areas.json
Expand Up @@ -26019,4 +26019,4 @@
}
]
}
]
]
2 changes: 1 addition & 1 deletion spec/fixtures/uk/geographical_areas/countries.json
Expand Up @@ -2087,4 +2087,4 @@

]
}
]
]
2 changes: 1 addition & 1 deletion spec/fixtures/xi/commodities/0103921100.json
Expand Up @@ -9622,4 +9622,4 @@
"description_plain": "Domestic species"
}
]
}
}

0 comments on commit 46d0e17

Please sign in to comment.