Skip to content

Commit

Permalink
Add spell check GitHub Workflow. (#17)
Browse files Browse the repository at this point in the history
* Add spell check GitHub Workflow.

* Fix spelling Pt 1

* Remove unused

* Add back in the required.
  • Loading branch information
MatthewKennedy authored Nov 5, 2021
1 parent 345a785 commit e8d7187
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 25 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/spelling_lint.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion app/assets/images/backend-eye-open.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/images/backend-view.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/javascripts/spree/backend/global/bootstrap.es6
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}`
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
populateSelectOptionsFromApi(params)
Allows you to easily fetch data from API (Platfrom v2) and populate an empty <select> with <option> tags, including a selected <option> tag.
Allows you to easily fetch data from API (Platform v2) and populate an empty <select> with <option> tags, including a selected <option> tag.
## EXAMPLE A
# Populating a list of all taxons including a selected item
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/spree/backend/menus/menu.es6
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', function() {
swapThreshold: 0.5,
emptyInsertThreshold: 8,
dragClass: 'menu-item-dragged',
draggable: '.dragable',
draggable: '.draggable',
animation: 350,
forceFallback: false,
onEnd: function (evt) {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/spree/backend/plugins/_nav_x.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

// Bug fix for iOS jittery elastic scroll from Bootstrap
// transaition on pills and buttons.
// transition on pills and buttons.
& > li > a {
transition: none !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
z-index: 1028;
}

// Hides the empty <li> tag highligted in open select2-dropdown.
// Hides the empty <li> tag highlighted in open select2-dropdown.
ul.select2-results__options {
li:empty {
display: none;
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/spree/admin/menu_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ def menu_item_bar(menu, item)
end

def build_menu_item(menu, item)
decendents = []
descendants = []

unless item.leaf?
item.children.each do |child_item|
decendents << build_menu_item(menu, child_item) unless item.leaf?
descendants << build_menu_item(menu, child_item) unless item.leaf?
end
end

info_row = menu_item_bar(menu, item)
menu_container = content_tag(:div, raw(decendents.join), class: 'menu-container', data: { parent_id: item.id })
menu_container = content_tag(:div, raw(descendants.join), class: 'menu-container', data: { parent_id: item.id })

content_tag(:div, info_row + menu_container,
class: 'menu-item menu-container-item dragable removable-dom-element',
class: 'menu-item menu-container-item draggable removable-dom-element',
data: { item_id: item.id })
end

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/spree/admin/navigation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Admin
module NavigationHelper
# Makes an admin navigation tab (<li> tag) that links to a routing resource under /admin.
# The arguments should be a list of symbolized controller names that will cause this tab to
# be highlighted, with the first being the name of the resouce to link (uses URL helpers).
# be highlighted, with the first being the name of the resource to link (uses URL helpers).
#
# Option hash may follow. Valid options are
# * :label to override link text, otherwise based on the first resource name (translated)
Expand Down
2 changes: 1 addition & 1 deletion app/views/spree/admin/general_settings/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

<div class="card-body">
<div class="alert alert-warning col-12">
This can be overriden by individual Store settings
This can be overridden by individual Store settings
</div>
<div class="form-group">
<%= label_tag :currency, Spree.t(:default_currency) %>
Expand Down
8 changes: 8 additions & 0 deletions codespell.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
devels
fo
wan
te
ue
nd
optionel
ot
2 changes: 1 addition & 1 deletion spec/controllers/spree/admin/orders_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def initialize(_user)
describe '#resend' do
let(:order) { create(:order, state: 'canceled', store: store) }

it 'resends oder mailer' do
it 'resends order mailer' do
put :resend, params: { id: order.number }
expect(flash[:success]).to eq Spree.t(:order_email_resent)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
end.to change { return_item.reload.acceptance_status }.from(old_acceptance_status).to(new_acceptance_status)
end

it 'redirects to the custome return' do
it 'redirects to the customer return' do
subject
expect(response).to redirect_to spree.edit_admin_order_customer_return_path(customer_return.order, customer_return)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/admin/orders/payments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
fill_in 'Card Number', with: '4111 1111 1111 1111'
fill_in 'Name', with: 'Test User'
fill_in 'Expiration', with: "09 / #{Time.current.year + 1}"
fill_in 'Card Varification Code (CVC)', with: '007'
fill_in 'Card Verification Code (CVC)', with: '007'
# Regression test for #4277
expect(page).to have_field(class: 'ccType', type: :hidden, with: 'visa')
click_button 'Continue'
Expand Down
2 changes: 1 addition & 1 deletion spec/features/admin/store_credits_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
allow_any_instance_of(Spree::Admin::StoreCreditsController).to receive(:try_spree_current_user).and_return(admin_user)
end

it 'displays flash withe error' do
it 'displays flash with error' do
expect(page).to have_content(Spree.t(:user_not_found))
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/admin/store_selector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
visit spree.admin_path
end

it 'allows to change the url to the seleted store and returns you to orders page' do
it 'allows to change the url to the selected store and returns you to orders page' do
find('a#storeSelectorDropdown').click

expect(page).to have_selector(:css, "a[href*='#{store_one.formatted_url}:#{port}/admin/orders']")
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/spree/admin/base_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
expect(order_time(time)).to eq "2016-05-06 1:33 PM #{time.zone}"
end

it 'return empty stirng when nil is supplied' do
it 'return empty string when nil is supplied' do
expect(order_time(nil)).to eq ''
end
end
Expand Down
4 changes: 2 additions & 2 deletions vendor/assets/javascripts/jquery.jstree/jquery.jstree.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
});
}
if(done) {
// TODO: find a more elegant approach to syncronizing returning requests
// TODO: find a more elegant approach to synchronizing returning requests
if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
this.data.core.refreshing = false;
Expand Down Expand Up @@ -2225,7 +2225,7 @@
}

// maybe use a scrolling parent element instead of document?
if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse position is n/a
var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
if(e.pageY - t < 20) {
if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
* DOMPurify. */
var RETURN_DOM_IMPORT = false;

/* Try to return a Trusted Type object instead of a string, retrun a string in
/* Try to return a Trusted Type object instead of a string, return a string in
* case Trusted Types are not supported */
var RETURN_TRUSTED_TYPE = false;

Expand Down

0 comments on commit e8d7187

Please sign in to comment.