From e8d7187278556917ea0b66beb7551d4791eb68e7 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Fri, 5 Nov 2021 18:52:38 +0000 Subject: [PATCH] Add spell check GitHub Workflow. (#17) * Add spell check GitHub Workflow. * Fix spelling Pt 1 * Remove unused * Add back in the required. --- .github/workflows/spelling_lint.yml | 34 +++++++++++++++++++ app/assets/images/backend-eye-open.svg | 2 +- app/assets/images/backend-view.svg | 2 +- .../spree/backend/global/bootstrap.es6 | 2 +- .../backend/global/select2_autocomplete.es6 | 6 ++-- .../spree/backend/global/select2_populate.es6 | 2 +- .../javascripts/spree/backend/menus/menu.es6 | 2 +- .../spree/backend/plugins/_nav_x.scss | 2 +- .../backend/plugins/_select2_custom.scss | 2 +- app/helpers/spree/admin/menu_helper.rb | 8 ++--- app/helpers/spree/admin/navigation_helper.rb | 2 +- .../admin/general_settings/edit.html.erb | 2 +- codespell.txt | 8 +++++ .../spree/admin/orders_controller_spec.rb | 2 +- .../admin/return_items_controller_spec.rb | 2 +- spec/features/admin/orders/payments_spec.rb | 2 +- spec/features/admin/store_credits_spec.rb | 2 +- spec/features/admin/store_selector_spec.rb | 2 +- spec/helpers/spree/admin/base_helper_spec.rb | 2 +- .../jquery.jstree/jquery.jstree.js | 4 +-- vendor/assets/javascripts/purify.js | 2 +- 21 files changed, 67 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/spelling_lint.yml create mode 100644 codespell.txt diff --git a/.github/workflows/spelling_lint.yml b/.github/workflows/spelling_lint.yml new file mode 100644 index 0000000000..7793695c53 --- /dev/null +++ b/.github/workflows/spelling_lint.yml @@ -0,0 +1,34 @@ +--- +name: Lint Code Spelling + +on: [pull_request] + +jobs: + codespell: + name: Check spelling all files with codespell + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install codespell + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Check spelling with codespell + run: codespell --ignore-words=codespell.txt || exit 1 + misspell: + name: Check spelling all files in commit with misspell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install + run: wget -O - -q https://git.io/misspell | sh -s -- -b . + - name: Misspell + run: git ls-files --empty-directory | xargs ./misspell -i 'aircrafts,devels,invertions' -error diff --git a/app/assets/images/backend-eye-open.svg b/app/assets/images/backend-eye-open.svg index 15777d07d6..67a3fd9395 100644 --- a/app/assets/images/backend-eye-open.svg +++ b/app/assets/images/backend-eye-open.svg @@ -3,6 +3,6 @@ - + diff --git a/app/assets/images/backend-view.svg b/app/assets/images/backend-view.svg index 15777d07d6..67a3fd9395 100644 --- a/app/assets/images/backend-view.svg +++ b/app/assets/images/backend-view.svg @@ -3,6 +3,6 @@ - + diff --git a/app/assets/javascripts/spree/backend/global/bootstrap.es6 b/app/assets/javascripts/spree/backend/global/bootstrap.es6 index 4cee2eb27d..2fb6438ea5 100644 --- a/app/assets/javascripts/spree/backend/global/bootstrap.es6 +++ b/app/assets/javascripts/spree/backend/global/bootstrap.es6 @@ -1,4 +1,4 @@ -// Use this file for Boostrap customization applied across the Spree Backend +// Use this file for Bootstrap customization applied across the Spree Backend document.addEventListener('DOMContentLoaded', function() { $('.with-tip').each(function() { diff --git a/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 b/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 index 3b621dec05..caa5ca0630 100644 --- a/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 +++ b/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 @@ -8,14 +8,14 @@ // data-autocomplete-url-value="products_api_v2" // OPTIONAL: -// data-autocomplete-placeholder-value="Seach Pages" <- Sets the placeholder | DEFAULT is: 'Search'. +// data-autocomplete-placeholder-value="Search Pages" <- Sets the placeholder | DEFAULT is: 'Search'. // data-autocomplete-clear-value=boolean <- Allow select2 to be cleared | DEFAULT is: false (no clear button). // data-autocomplete-multiple-value=boolean <- Multiple or Single select | DEFAULT is: false (single). // data-autocomplete-return-attr-value="pretty_name" <- Return Attribute. | DEFAULT is: 'name'. // data-autocomplete-min-input-value="4" <- Minimum input for search | DEFAULT is: 3. // data-autocomplete-search-query-value="title_i_cont" <- Custom search query | DEFAULT is: 'name_i_cont'. // data-autocomplete-custom-return-id-value="permalink" <- Return a custom attribute | DEFAULT: returns id. -// data-autocomplete-debug-mode-value=boolean <- Turn on console loggin of data returned by the request. +// data-autocomplete-debug-mode-value=boolean <- Turn on console login of data returned by the request. // // Add your own custom URL params to the request as needed // EXAMPLE: @@ -77,7 +77,7 @@ $.fn.select2Autocomplete = function(params) { // URL + Additional URL Params + Sparse Fields apiUrl = `${params.apiUrl}?${additionalUrlParams}&${sparseFields}` } else { - // URL + Sparse Fields (the default response for a noraml Select2) + // URL + Sparse Fields (the default response for a normal Select2) apiUrl = `${params.apiUrl}?${sparseFields}` } diff --git a/app/assets/javascripts/spree/backend/global/select2_populate.es6 b/app/assets/javascripts/spree/backend/global/select2_populate.es6 index a93ac86cd6..06eb4f82c5 100644 --- a/app/assets/javascripts/spree/backend/global/select2_populate.es6 +++ b/app/assets/javascripts/spree/backend/global/select2_populate.es6 @@ -1,6 +1,6 @@ /** populateSelectOptionsFromApi(params) - Allows you to easily fetch data from API (Platfrom v2) and populate an empty with