From 1064c51609ae9a26d5803cba809bdc2bd7c53a1c Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Wed, 22 Apr 2020 14:21:53 -0700 Subject: [PATCH] Fix typos [ci skip] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I wrote this shell script to find words from the Rails repo, so I can paste them into https://www.horsepaste.com/ for the [codenames game](https://en.m.wikipedia.org/wiki/Codenames_(board_game)). ```bash git grep -Il '' | \ grep -v -E "CHANGELOG|Gemfile|gemspec|package\.json|yarn\.lock" | \ xargs cat | \ sed '/[^ ]\{10,\}/d' | \ sed 's/\([A-Z]\)/ \1/g' | \ tr 'A-Z' 'a-z' | \ tr -c -s 'a-z' '\n' | \ sed '/^.\{0,3\}$/d' | \ sort | \ uniq | \ tr '\n' ',' | \ pbcopy ``` You can see the result in https://www.horsepaste.com/rails-fixed. Click "Next game" to cycle the words. Found some typos in the codebase from this 😂 This is how I generated the list of possible typos: ```bash git grep -Il '' | \ grep -v -E "CHANGELOG|Gemfile|gemspec|package\.json|yarn\.lock" | \ xargs cat | \ sed '/[^ ]\{10,\}/d' | \ sed 's/\([A-Z]\)/ \1/g' | \ tr 'A-Z' 'a-z' | \ tr -c -s 'a-z' '\n' | \ sed '/^.\{0,3\}$/d' | \ sort | \ uniq | \ aspell --ignore-case list ``` I manually reviewed the list and made the corrections in this commit. The rest on the list are either: * Bugs in my script: it split things like "doesn't" into "doesn" and "t", if find things like `#ffffff` and extracts "ffffff" as a word, etc * British spelling: honour, optimised * Foreign words: bonjour, espanol * Names: nginx, hanekawa * Technical words: mutex, xhtml * Portmanteau words: autosave, nodelist * Invented words: camelize, coachee * Shortened words: attrs, repo * Deliberate typos: hllo, hillo (used in code examples, etc) * Lorem ipsum words: arcu, euismod This is the [output](https://gist.github.com/chancancode/eb0b573d667dc31906f33f1fb0b22313) of the script *after* fixing the typos included in this commit. In theory, someone can run that command again in the future and compare the output to catch new typos (i.e. using my list to filter out known typos). Limitations: the aspell dictionary could be wrong, I could have miss things, and my script ignores words that are less than 3 characters or longer than 10 characters. --- .../action_dispatch/middleware/templates/routes/_table.html.erb | 2 +- actionview/test/ujs/public/test/data-remote.js | 2 +- activerecord/lib/active_record/relation/query_methods.rb | 2 +- activestorage/lib/active_storage/analyzer.rb | 2 +- activesupport/test/core_ext/module_test.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb b/actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb index 2fb4650398..99427fe30c 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb @@ -96,7 +96,7 @@