diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..4791fb4a8a --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,*.pdf,*.svg,locale,vendor,*.lock,*.css,*.min.*,.codespellrc,locales,language_presenter.rb +check-hidden = true +# ignore-regex = +ignore-words-list = ans,rememberable,requestor,reord diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..c59e047376 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/.rubocop.yml b/.rubocop.yml index 86266fead8..ee9648f86c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -131,7 +131,7 @@ Metrics/MethodLength: Max: 20 # mnicholson Oct. 6th 2021 -# Default lenght for block is 25 lines, which it would be very restrictive for +# Default length for block is 25 lines, which it would be very restrictive for # the Rspec views methods. So I'll just exclude some files. Metrics/BlockLength: Exclude: diff --git a/CHANGELOG.md b/CHANGELOG.md index f5ff8b632c..2e8bb2a9a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -233,7 +233,7 @@ As Webpacker is no longer maintained by the Rails community, we have replaced it - Removed `font-awesome-sass` gem and used `@fortawesome/fontawesome-free` npm package - Issue with `@import 'font-awesome-sprockets';` line in `app/assets/stylesheets/application.scss`. Removed that line after referring to the latest font-awesome install/setup guide which no longer includes it. -With the removal of Webpacker, the Javascript/SASS code is no longer automaticaly compiled when using the `rails server` command. It has been replaced by the `bin/dev` command that launch the rails server and the processes that watch for changes in the SASS and Javascript code. +With the removal of Webpacker, the Javascript/SASS code is no longer automatically compiled when using the `rails server` command. It has been replaced by the `bin/dev` command that launch the rails server and the processes that watch for changes in the SASS and Javascript code. #### SASS update : removal of the `@import` keyword @@ -287,7 +287,7 @@ For more detailed explanation, please refer to this video : https://www.youtube. - Froze mail gem version [#3254](https://github.com/DMPRoadmap/roadmap/issues/3254) - Updated the CSV export so that it now includes research outputs - Updated sans-serif font used in PDF downloads to Roboto since Google API no longer offers Helvetica -- Fixed discrepencies with default/max per_page values for API and UI pagination +- Fixed discrepancies with default/max per_page values for API and UI pagination - Updated JS that used to call the TinyMCE `setMode()` function so that it now calls `mode.set()` because the former is now deprecated. - Patched an issue that was causing a template's visibility to change to 'organizationally_visible' when saving on the template details page. - Fixed an issue with the Rails 6 keyword arguments change that was causing the `paginable_sort_link` to fail diff --git a/app/assets/stylesheets/blocks/README.md b/app/assets/stylesheets/blocks/README.md index 295713a06d..1d7d7be716 100644 --- a/app/assets/stylesheets/blocks/README.md +++ b/app/assets/stylesheets/blocks/README.md @@ -1,6 +1,6 @@ # CSS Blocks -Blocks refer to reusable units within the CSS files. Where practicable, we should always try to define a general block or UX concept, rather than styling indivudual elements. +Blocks refer to reusable units within the CSS files. Where practicable, we should always try to define a general block or UX concept, rather than styling individual elements. Example: diff --git a/app/assets/stylesheets/blocks/_cards.scss b/app/assets/stylesheets/blocks/_cards.scss index edb25d6e1f..52bff403e5 100644 --- a/app/assets/stylesheets/blocks/_cards.scss +++ b/app/assets/stylesheets/blocks/_cards.scss @@ -33,7 +33,7 @@ color: $color-secondary-text; } -// Classes from Boostrap 3 panels (renamed card) - interim solution +// Classes from Bootstrap 3 panels (renamed card) - interim solution .card-default { border-color: #ddd; border-radius: 0rem; diff --git a/app/assets/stylesheets/blocks/_labels.scss b/app/assets/stylesheets/blocks/_labels.scss index 0830ac244a..72780c468d 100644 --- a/app/assets/stylesheets/blocks/_labels.scss +++ b/app/assets/stylesheets/blocks/_labels.scss @@ -1,7 +1,7 @@ @import "../../../../node_modules/bootstrap/scss/functions"; @import "../../../../node_modules/bootstrap/scss/variables"; -/* label stlying */ +/* label styling */ label { font-weight: 700; } diff --git a/app/controllers/api/v1/base_api_controller.rb b/app/controllers/api/v1/base_api_controller.rb index c1ddc36547..999404964a 100644 --- a/app/controllers/api/v1/base_api_controller.rb +++ b/app/controllers/api/v1/base_api_controller.rb @@ -109,7 +109,7 @@ def paginate_response(results:) end # ========================= - # PERMIITTED PARAMS HEPERS + # PERMIITTED PARAMS HELPERS # ========================= def plan_permitted_params %i[created title description language ethical_issues_exist diff --git a/app/controllers/concerns/conditional_user_mailer.rb b/app/controllers/concerns/conditional_user_mailer.rb index e7eddc58fe..bb664f1084 100644 --- a/app/controllers/concerns/conditional_user_mailer.rb +++ b/app/controllers/concerns/conditional_user_mailer.rb @@ -8,7 +8,7 @@ module ConditionalUserMailer # # recipients - User or Enumerable object or any object that includes Enumerable class # key - A key (dot notation) whose value is true/false and belongs to - # prefences.email (see dmproadmap.rb initializer) + # preferences.email (see dmproadmap.rb initializer) # # Returns Boolean def deliver_if(key:, recipients: [], &block) diff --git a/app/controllers/concerns/paginable.rb b/app/controllers/concerns/paginable.rb index 7d558e3db4..412d90d012 100644 --- a/app/controllers/concerns/paginable.rb +++ b/app/controllers/concerns/paginable.rb @@ -137,7 +137,7 @@ def refine_query(scope) # Can raise ActiveRecord::StatementInvalid (e.g. column does not # exist, ambiguity on column, etc) - # how we contruct scope depends on whether sort field is in the + # how we construct scope depends on whether sort field is in the # main table or in a related table scope_table = scope.klass.name.underscore parts = @args[:sort_field].partition('.') diff --git a/app/controllers/concerns/versionable.rb b/app/controllers/concerns/versionable.rb index 0a98723907..0b5092c958 100644 --- a/app/controllers/concerns/versionable.rb +++ b/app/controllers/concerns/versionable.rb @@ -4,7 +4,7 @@ module Versionable private - # Takes in a Template, phase, Section, Question, or Annotaion + # Takes in a Template, phase, Section, Question, or Annotation # IF the template is published, generates a new template # finds the passed object in the new template # diff --git a/app/controllers/org_admin/template_customization_transfers_controller.rb b/app/controllers/org_admin/template_customization_transfers_controller.rb index f0b98e28b7..32574cce50 100644 --- a/app/controllers/org_admin/template_customization_transfers_controller.rb +++ b/app/controllers/org_admin/template_customization_transfers_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module OrgAdmin - # Controller that handles transfering parent template changes to a customized template + # Controller that handles transferring parent template changes to a customized template class TemplateCustomizationTransfersController < ApplicationController include Versionable diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index 8f7c44393a..f9c371eb2d 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -398,7 +398,7 @@ def duplicate end # rubocop:enable Metrics/AbcSize - # TODO: This should probablly just be merged with the update route + # TODO: This should probably just be merged with the update route # POST /plans/:id/visibility # rubocop:disable Metrics/AbcSize, Metrics/MethodLength def visibility @@ -433,7 +433,7 @@ def visibility end # rubocop:enable Metrics/AbcSize, Metrics/MethodLength - # TODO: This should probablly just be merged with the update route + # TODO: This should probably just be merged with the update route # POST /plans/:id/set_test def set_test plan = Plan.find(params[:id]) diff --git a/app/controllers/public_pages_controller.rb b/app/controllers/public_pages_controller.rb index 1b5d9cff93..62d8fb5f42 100644 --- a/app/controllers/public_pages_controller.rb +++ b/app/controllers/public_pages_controller.rb @@ -29,7 +29,7 @@ def template_export # only export live templates, id passed is family_id @template = Template.live(params[:id]) # covers authorization for this action. - # Pundit dosent support passing objects into scoped policies + # Pundit doesn't support passing objects into scoped policies unless PublicPagePolicy.new(current_user, @template).template_export? msg = 'You are not authorized to export that template' redirect_to public_templates_path, notice: msg and return diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 53492a3f9e..09d60c6c84 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -269,7 +269,7 @@ def do_update_password(current_user, args) elsif args[:password_confirmation].blank? message = _('Please enter a password confirmation') elsif args[:password] != args[:password_confirmation] - message = _('Password and comfirmation must match') + message = _('Password and confirmation must match') else successfully_updated = current_user.update_with_password(args) end diff --git a/app/javascript/src/answers/edit.js b/app/javascript/src/answers/edit.js index 9dbbdd6b7b..d9fad88824 100644 --- a/app/javascript/src/answers/edit.js +++ b/app/javascript/src/answers/edit.js @@ -34,7 +34,7 @@ $(() => { * form with class form-answer. The key represents a question id and the value holds * the debounced function for a given input, textarea or select. Note, this map is * populated on demand, i.e. the first time a change is made at a given input, textarea - * or select within the form, a new key-value should be created. Succesive times, the + * or select within the form, a new key-value should be created. Successive times, the * debounced function should be retrieved instead. */ const debounceMap = {}; diff --git a/app/javascript/src/answers/rdaMetadata.js b/app/javascript/src/answers/rdaMetadata.js index 0cb96bc10c..c1a904edc1 100644 --- a/app/javascript/src/answers/rdaMetadata.js +++ b/app/javascript/src/answers/rdaMetadata.js @@ -139,7 +139,7 @@ $(() => { function waitAndUpdate() { if (noWaiting > 0) { - // if we are waiting on api responces, call this function in 1 seccond + // if we are waiting on api responses, call this function in 1 second setTimeout(waitAndUpdate, 1000); } else { // update all the dropdowns/ standards explore box (calling on subject @@ -183,7 +183,7 @@ $(() => { // update the standards display selector $('.rda_metadata .sub-subject select').change(); } else { - // show the sub-subject incase it was previously hidden + // show the sub-subject in case it was previously hidden subSubject.closest('div').show(); // update the sub-subject display selector subSubject.find('option').remove(); diff --git a/app/javascript/src/orgAdmin/conditions/updateConditions.js b/app/javascript/src/orgAdmin/conditions/updateConditions.js index 7daa01eff5..7b630b7881 100644 --- a/app/javascript/src/orgAdmin/conditions/updateConditions.js +++ b/app/javascript/src/orgAdmin/conditions/updateConditions.js @@ -22,7 +22,7 @@ export default function updateConditions(id) { if (webhook === false) { if ($(selectObject).val() === 'add_webhook') { // condition type is webhook - // Retreive 'data-bs-target' for modal and create Jquery element + // Retrieve 'data-bs-target' for modal and create Jquery element const associatedModal = $(condition.find('.pseudo-webhook-btn').attr('data-bs-target')); associatedModal.modal('show'); condition.find('.display-if-action-remove').hide(); @@ -60,7 +60,7 @@ export default function updateConditions(id) { condition.find('.webhook-replacement').show(); $(condition.find('.webhook-replacement')).on('click', (event) => { event.preventDefault(); - // Retreive 'data-bs-target' for modal and create Jquery element + // Retrieve 'data-bs-target' for modal and create Jquery element const associatedModal1 = $(condition.find('.pseudo-webhook-btn').attr('data-bs-target')); associatedModal1.modal('show'); }); diff --git a/app/javascript/src/usage/index.js b/app/javascript/src/usage/index.js index 9c32cde92f..182b900610 100644 --- a/app/javascript/src/usage/index.js +++ b/app/javascript/src/usage/index.js @@ -19,7 +19,7 @@ $(() => { }; // attach listener to separator select menu - // on change look for "stat" elements and chnage their query param + // on change look for "stat" elements and change their query param const fieldSep = document.getElementById('csv-field-sep'); if (fieldSep !== null) { fieldSep.addEventListener('click', (e) => { diff --git a/app/javascript/src/utils/accordion.js b/app/javascript/src/utils/accordion.js index fdb7da12d1..b4e03b8ef7 100644 --- a/app/javascript/src/utils/accordion.js +++ b/app/javascript/src/utils/accordion.js @@ -9,7 +9,7 @@ * <%= _('collapse all') %> * * - * Your accordion should follow the Boostrap 5.x layout: + * Your accordion should follow the Bootstrap 5.x layout: * ------------------------------------------------------------ n* *
- <%= _('Hello %{recepientname}') %{ recepientname: @recepient.name } %> + <%= _('Hello %{recepientname}') %{ recepientname: @recipient.name } %>
<%= _('Your permissions relating to %{plan_title} have changed. You now have %{type} access. This means you can %{placeholder1} %{placeholder2}') % { diff --git a/config/initializers/_dmproadmap.rb b/config/initializers/_dmproadmap.rb index 200b7ddac5..46e3b208d0 100644 --- a/config/initializers/_dmproadmap.rb +++ b/config/initializers/_dmproadmap.rb @@ -21,7 +21,7 @@ class Application < Rails::Application # ORGANISATION SETTINGS # # --------------------- # - # Your organisation name, used in various places throught the application + # Your organisation name, used in various places throughout the application config.x.organisation.name = 'Curation Center' # Your organisation's abbreviation config.x.organisation.abbreviation = 'CC' diff --git a/config/initializers/dmproadmap_schema_dumper.rb b/config/initializers/dmproadmap_schema_dumper.rb index 1305d80189..6a53dcac5b 100644 --- a/config/initializers/dmproadmap_schema_dumper.rb +++ b/config/initializers/dmproadmap_schema_dumper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module ActiveRecord - # The Rails 5.x SchemaDumper includes an `options:` arrgument on table definitions + # The Rails 5.x SchemaDumper includes an `options:` argument on table definitions # that is not DB agnostic. This Monkey Patch comments out the `options:` section. # # TODO: Determine if this is still necessary in Rails 6.x+ diff --git a/config/initializers/htmlto_word_xslt_helper.rb b/config/initializers/htmlto_word_xslt_helper.rb index 5eda752980..cca06a1256 100644 --- a/config/initializers/htmlto_word_xslt_helper.rb +++ b/config/initializers/htmlto_word_xslt_helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This helper method xslt_path prepends the htmltoword method, -# to allow us to overide the numbering.xslt styleheet with one +# to allow us to override the numbering.xslt styleheet with one # with fix in https://github.com/karnov/htmltoword/issues/73 # We applied this gem gem htmltoword-1.1.0. diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index bfebb7b682..92a33a3d33 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# This initilializer should not be removed unless all internationalisation is handled by +# This initializer should not be removed unless all internationalisation is handled by # gettext_rails DMPRoadmap::Application.config.i18n.load_path += Dir[ Rails.root.join('config', 'locales', '**', '*.yml').to_s diff --git a/config/initializers/translation.rb b/config/initializers/translation.rb index ba2ecc31df..ea8ca93fc0 100644 --- a/config/initializers/translation.rb +++ b/config/initializers/translation.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # New with Rails 6+, we need to define the list of locales outside the context of -# the Database since thiss runs during startup. Trying to access the DB causes +# the Database since this runs during startup. Trying to access the DB causes # issues with autoloading; 'DEPRECATION WARNING: Initialization autoloaded the constants ... Language' # # Note that the entries here must have a corresponding directory in config/locale, a diff --git a/config/storage.yml b/config/storage.yml index d32f76e8fb..25faa9eebd 100644 --- a/config/storage.yml +++ b/config/storage.yml @@ -14,7 +14,7 @@ local: # region: us-east-1 # bucket: your_own_bucket -# Remember not to checkin your GCS keyfile to a repository +# Remember not to check in your GCS keyfile to a repository # google: # service: GCS # project: your_project diff --git a/db/migrate/20161122152339_new_plan_template_structure.rb b/db/migrate/20161122152339_new_plan_template_structure.rb index 0f3aa398bb..ad8a1fa495 100644 --- a/db/migrate/20161122152339_new_plan_template_structure.rb +++ b/db/migrate/20161122152339_new_plan_template_structure.rb @@ -147,7 +147,7 @@ def up puts "" puts "beginning number #{proj_number}" proj_number +=1 - if project.dmptemplate.nil? # one of the templates dosent exist + if project.dmptemplate.nil? # one of the templates doesn't exist next end new_plan = initNewPlan(project) # copy data from project to NewPlan object @@ -230,7 +230,7 @@ def up # template/phases/sections/questions/question_options/question_themes # now need to init answers, notes, answers_options #new_plan.template.new_phases.each do |new_phase| - puts "transfering plan data" + puts "transferring plan data" project.project_groups.each do |group| role = initRole(group, new_plan) role.save! diff --git a/db/migrate/20161206122926_add_foreign_keys.rb b/db/migrate/20161206122926_add_foreign_keys.rb index bb0e1a9f68..4e702a9c07 100644 --- a/db/migrate/20161206122926_add_foreign_keys.rb +++ b/db/migrate/20161206122926_add_foreign_keys.rb @@ -1,6 +1,6 @@ class AddForeignKeys < ActiveRecord::Migration[4.2] # this migraiton modifies data in tables, and thus depends on being at a specific - # point in the history of the codebase. Specificly the models must reflect the + # point in the history of the codebase. Specifically the models must reflect the # relationships expected within this code def change # remove broken references diff --git a/lib/data_cleanup/README.md b/lib/data_cleanup/README.md index 0574bf30da..939c5f5bf1 100644 --- a/lib/data_cleanup/README.md +++ b/lib/data_cleanup/README.md @@ -65,7 +65,7 @@ These are defined in `lib/data_cleanup/rules`. ### Creating a new rule -You can create a new rule by running the following genrator: +You can create a new rule by running the following generator: ``` bash $ rails g data_cleanup_rule user/fix_missing_emails @@ -73,7 +73,7 @@ $ rails g data_cleanup_rule user/fix_missing_emails This will create a file `lib/data_cleanup/rules/user/fix_missing_emails.rb` which contains the rules for updating users with missing emails. -Feel free to add your own rules where neccesary to fix your own data. +Feel free to add your own rules where necessary to fix your own data. ## Logging output diff --git a/lib/global_helpers.rb b/lib/global_helpers.rb index 7d52c0c4df..02b0935a86 100644 --- a/lib/global_helpers.rb +++ b/lib/global_helpers.rb @@ -3,10 +3,10 @@ # Helpers for GetText strings module GlobalHelpers # overloading the method - # came across a wierd issue where the function would refused to be called from + # came across a weird issue where the function would refused to be called from # class functions of other classes... but it will work if this is a class function # easiest way to give this functionality is to overload the function - # if you have a better solution, please impliment it as this is ugly + # if you have a better solution, please implement it as this is ugly def self.constant(str) I18n.t("magic_strings.#{str}", locale: I18n.default_locale) end @@ -16,7 +16,7 @@ def self.constant(str) ## # Takes in a string which is meant to be constant, and looks it up in the default # (en_GB) locale. This should ensure that the back-end remains constant and - # consistantly called + # consistently called # # str - The String which will be looked up in the localisation # diff --git a/lib/tasks/data_cleanup.rake b/lib/tasks/data_cleanup.rake index 11e4108f5c..9f54e8ae72 100644 --- a/lib/tasks/data_cleanup.rake +++ b/lib/tasks/data_cleanup.rake @@ -209,7 +209,7 @@ namespace :data_cleanup do ids = [] if filter.options[:with].present? filter.attributes.each do |attr| - # skip password validaton since the field is encrypted through Devise + # skip password validation since the field is encrypted through Devise unless attr == :password # If this is the users.email field send it to the EmailValidator. Devise has its own Regex # but running a Regex query gets messy between different DB types diff --git a/lib/tasks/upgrade.rake b/lib/tasks/upgrade.rake index 39c83aacf9..c9818b91ec 100644 --- a/lib/tasks/upgrade.rake +++ b/lib/tasks/upgrade.rake @@ -847,7 +847,7 @@ namespace :upgrade do end count = Identifier.where(identifiable_type: 'User').length - p "Transfer complete. Orginal user_identifier count #{identifiers.length}, new identifiers count #{count}" + p "Transfer complete. Original user_identifier count #{identifiers.length}, new identifiers count #{count}" if identifiers.length > count p '' p "#{identifiers.length - count} records could not be transferred." @@ -884,7 +884,7 @@ namespace :upgrade do identifiable: oi.org, value: oi.identifier) end count = Identifier.where(identifiable_type: 'Org').length - p "Transfer complete. Orginal org_identifier count #{identifiers.length}, new identifiers count #{count}" + p "Transfer complete. Original org_identifier count #{identifiers.length}, new identifiers count #{count}" # rubocop:disable Layout/LineLength if identifiers.length > count p '' @@ -1203,7 +1203,7 @@ namespace :upgrade do p '' p " Assigned #{number_with_delimiter(rors_added)} ROR identifiers to your Orgs" p " Assigned #{number_with_delimiter(fundrefs_added)} Crossref Funder identifiers to your Orgs" - p ' NOTE: Please refer to the tmp/ror_fundref_ids.csv file to see how the assigment worked.' + p ' NOTE: Please refer to the tmp/ror_fundref_ids.csv file to see how the assignment worked.' p ' You should make any adjustments BEFORE running part 2 of the upgrade scripts!' p ' For example ROR sometimes incorrectly matches Orgs. For example:' p " 'University of Somewhere' may match to 'Univerity of Somewhere - Medical Center'" diff --git a/lib/tasks/utils/templates.rake b/lib/tasks/utils/templates.rake index da9c5bdef6..075061b453 100644 --- a/lib/tasks/utils/templates.rake +++ b/lib/tasks/utils/templates.rake @@ -30,7 +30,7 @@ namespace :templates do funder_template.phases.select { |phase| phase.versionable_id.nil? }.each do |phase| p "Processing Template: #{funder_template.id} - #{funder_template.title}" - # Run all of this within a transation so that it rolls back if there is an issue! + # Run all of this within a transaction so that it rolls back if there is an issue! phase.transaction do phase_version = SecureRandom.uuid p " Updating versionable_id for Phase: #{phase.id} to #{phase_version}" @@ -53,7 +53,7 @@ namespace :templates do versionable_id: section_version ) - section.questions.select { |ques| ques.versionable_id.nil? }.each do |question| + section.questions.select { |ques| ques.versionable_id.nil? }.each do |question| # codespell:ignore question_version = SecureRandom.uuid p " Updating versionable_id for Question: #{question.id} to #{question_version}" question.update_columns(versionable_id: question_version) diff --git a/public/i18n.js b/public/i18n.js index 9797f5b2c9..9031caa370 100644 --- a/public/i18n.js +++ b/public/i18n.js @@ -38,7 +38,7 @@ return ("0" + number.toString()).substr(-2); }; - // Improved toFixed number rounding function with support for unprecise floating points + // Improved toFixed number rounding function with support for imprecise floating points // JavaScript's standard toFixed function does not round certain numbers correctly (for example 0.105 with precision 2). var toFixed = function(number, precision) { return decimalAdjust('round', number, -precision).toFixed(precision); @@ -364,7 +364,7 @@ } }; - // Merge serveral hash options, checking if value is set before + // Merge several hash options, checking if value is set before // overwriting any value. The precedence is from left to right. // // I18n.prepareOptions({name: "John Doe"}, {name: "Mary Doe", role: "user"}); diff --git a/spec/controllers/contributors_controller_spec.rb b/spec/controllers/contributors_controller_spec.rb index 1545c6a901..b6356b89ee 100644 --- a/spec/controllers/contributors_controller_spec.rb +++ b/spec/controllers/contributors_controller_spec.rb @@ -73,7 +73,7 @@ expect(contrib.email).to eql(params[:email]) expect(contrib.phone).to eql(params[:phone].to_s) - # Verify that the corrrect roles were assigned + # Verify that the correct roles were assigned contrib.all_roles.each do |role| expect(contrib.send(:"#{role}?")).to eql(params[:"#{role}"] == '1') end @@ -99,7 +99,7 @@ expect(@contributor.email).to eql(params[:email]) expect(@contributor.phone).to eql(params[:phone].to_s) - # Verify that the corrrect roles were assigned + # Verify that the correct roles were assigned @contributor.all_roles.each do |role| expect(@contributor.send(:"#{role}?")).to eql(params[:"#{role}"] == '1') end diff --git a/spec/features/annotations/annotations_editing_spec.rb b/spec/features/annotations/annotations_editing_spec.rb index 0edfc4a25e..9662d7c109 100644 --- a/spec/features/annotations/annotations_editing_spec.rb +++ b/spec/features/annotations/annotations_editing_spec.rb @@ -47,7 +47,7 @@ within("fieldset#fields_annotation_#{template.annotation_ids.last}") do id = "question_annotations_attributes_annotation_#{template.annotation_ids.last}_text" - tinymce_fill_in(id, with: 'Noo bar') + tinymce_fill_in(id, with: 'Noo bar') # codespell:ignore end # NOTE: This is question 2, since Annotation was copied upon clicking "Customise" @@ -56,7 +56,7 @@ expect { click_button 'Save' }.not_to change { Annotation.count } end expect(annotation.text).to eql('Foo bar') - expect(Annotation.order('created_at').last.text).to eql('
Noo bar
') + expect(Annotation.order('created_at').last.text).to eql('Noo bar
') # codespell:ignore expect(page).not_to have_errors end diff --git a/spec/features/registrations_spec.rb b/spec/features/registrations_spec.rb index 50ef4d60ab..119b315727 100644 --- a/spec/features/registrations_spec.rb +++ b/spec/features/registrations_spec.rb @@ -31,7 +31,7 @@ expect(page).to have_text(user_attributes[:surname]) end - scenario 'User attempts to create a new acccount with invalid atts', :js do + scenario 'User attempts to create a new account with invalid atts', :js do # Setup visit root_path diff --git a/spec/models/language_spec.rb b/spec/models/language_spec.rb index 7735f210b3..d00f151c9e 100644 --- a/spec/models/language_spec.rb +++ b/spec/models/language_spec.rb @@ -54,7 +54,7 @@ describe '.default' do subject { Language.default } - context 'when langauge is default_language' do + context 'when language is default_language' do let!(:language) { create(:language, abbreviation: 'foo', default_language: true) } it { is_expected.to eql(language) } diff --git a/spec/models/plan_spec.rb b/spec/models/plan_spec.rb index bbddb5b76e..17c550fabb 100644 --- a/spec/models/plan_spec.rb +++ b/spec/models/plan_spec.rb @@ -398,7 +398,7 @@ expect(subject.title).to include(plan.title) end - it "copies the new plan's id to its identifer" do + it "copies the new plan's id to its identifier" do expect(subject.identifier).to eql(subject.id.to_s) end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 63ffc73a06..e7f4d91f8c 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -6,7 +6,7 @@ context 'validations' do it { is_expected.to validate_presence_of(:email) } - it 'should validate that email addres is unqique' do + it 'should validate that email address is unqique' do subject.email = 'text-email@example.com' is_expected.to validate_uniqueness_of(:email) .case_insensitive @@ -464,7 +464,7 @@ end end - # Test creationg a User from an omniauth callback like Shibboleth + # Test creating a User from an omniauth callback like Shibboleth describe '.from_omniauth' do let!(:user) { create(:user) } let!(:auth) do @@ -502,7 +502,7 @@ subject { user.get_preferences(key) } - context "when the User doesn't have thier own Pref" do + context "when the User doesn't have their own Pref" do it 'returns the default value' do Pref.expects(:default_settings) .returns(email: { foo: { 'bar' => 'baz' } }) @@ -510,7 +510,7 @@ end end - context 'when the User has thier own Pref' do + context 'when the User has their own Pref' do before do create(:pref, user: user, settings: { email: { foo: { bar: 'bam' } } }) diff --git a/spec/presenters/identifier_presenter_spec.rb b/spec/presenters/identifier_presenter_spec.rb index ab7b5282e1..232c1014b5 100644 --- a/spec/presenters/identifier_presenter_spec.rb +++ b/spec/presenters/identifier_presenter_spec.rb @@ -11,7 +11,7 @@ end describe '#identifiers' do - it "returns the identiable object's identifiers" do + it "returns the identifiable object's identifiers" do id = build(:identifier) @user.identifiers << id @user.org.identifiers << build(:identifier) diff --git a/spec/presenters/org_selection_presenter_spec.rb b/spec/presenters/org_selection_presenter_spec.rb index 6487061ab2..90b71d9f67 100644 --- a/spec/presenters/org_selection_presenter_spec.rb +++ b/spec/presenters/org_selection_presenter_spec.rb @@ -41,7 +41,7 @@ it 'return an empty hash if the value does not have a match in crosswalk' do expect(@presenter.crosswalk_entry_from_org_id(value: '999')).to eql('{}') end - it 'return ther correct crosswalk entry' do + it 'return the correct crosswalk entry' do rslt = @presenter.crosswalk_entry_from_org_id(value: @org.id.to_s) expected = OrgSelection::OrgToHashService.to_hash(org: @org).to_json expect(rslt).to eql(expected) diff --git a/spec/services/api/v1/conversion_service_spec.rb b/spec/services/api/v1/conversion_service_spec.rb index e8845b84bd..0b21e6bd4b 100644 --- a/spec/services/api/v1/conversion_service_spec.rb +++ b/spec/services/api/v1/conversion_service_spec.rb @@ -50,7 +50,7 @@ value: Faker::Lorem.word) expect(expected.identifier_scheme.name).to eql(context) end - it "returns an Identifier asssociated with the 'grant' scheme" do + it "returns an Identifier associated with the 'grant' scheme" do value = Faker::Lorem.word expected = described_class.to_identifier(context: Faker::Lorem.word, value: value) diff --git a/spec/services/external_apis/base_service_spec.rb b/spec/services/external_apis/base_service_spec.rb index 3823cf0c23..3360dfddf2 100644 --- a/spec/services/external_apis/base_service_spec.rb +++ b/spec/services/external_apis/base_service_spec.rb @@ -104,7 +104,7 @@ result = described_class.send(:options) expect(result[:headers][:Accept]).to eql('*/*') end - it 'merges additonal headers into the :headers option' do + it 'merges additional headers into the :headers option' do result = described_class.send(:options, additional_headers: { foo: 'bar' }) expect(result[:headers][:Accept]).to eql('*/*') expect(result[:headers][:foo]).to eql('bar') diff --git a/spec/services/external_apis/spdx_service_spec.rb b/spec/services/external_apis/spdx_service_spec.rb index 7cb3fa4e5b..a7229566b7 100644 --- a/spec/services/external_apis/spdx_service_spec.rb +++ b/spec/services/external_apis/spdx_service_spec.rb @@ -48,7 +48,7 @@ described_class.expects(:log_error) expect(described_class.send(:query_spdx)).to eql([]) end - it 'returns an empty array if the response conatins no license' do + it 'returns an empty array if the response contains no license' do JSON.expects(:parse).returns({}) expect(described_class.send(:query_spdx)).to eql([]) end diff --git a/spec/services/org/create_created_plan_service_spec.rb b/spec/services/org/create_created_plan_service_spec.rb index a3bc78e653..26e05ed48d 100644 --- a/spec/services/org/create_created_plan_service_spec.rb +++ b/spec/services/org/create_created_plan_service_spec.rb @@ -151,7 +151,7 @@ def find_by_dates(dates:, org_id:) expect(counts).to eq([2, 1, 2, 0]) end - it 'generates montly counts by template for each org since their creation' do + it 'generates monthly counts by template for each org since their creation' do Org.stubs(:all).returns([org]) described_class.call diff --git a/spec/support/helpers/autocomplete_helper.rb b/spec/support/helpers/autocomplete_helper.rb index 61b26f1dbc..b8b5be793d 100644 --- a/spec/support/helpers/autocomplete_helper.rb +++ b/spec/support/helpers/autocomplete_helper.rb @@ -23,7 +23,7 @@ def choose_suggestion(typeahead_id, org) # Some unfortunate hacks to deal with naming inconsistencies on the create plan page # and the Super Admin merge orgs tab id = id.gsub('org_org_', 'org_').gsub('funder_org_', 'funder_') - # Excape any single quotes so it doesn't blow up our JS + # Escape any single quotes so it doesn't blow up our JS hash = { id: org.id, name: org.name.delete("'") } # Capybara/Selenium can't interact with a hidden field because the user can't, # so use some JS to set the value