diff options
author | Jason Dent <Jason3S@users.noreply.github.com> | 2023-02-28 21:42:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-28 15:42:22 -0500 |
commit | 4f0c31263a6919000f4f1e1a6bfbab231861bc57 (patch) | |
tree | ba34f2ea3b0dbaa28587b212ab9eaa8df9487f21 | |
parent | 35af355e89ac2c994c2135e6e916d48f32fd251f (diff) | |
download | chef-4f0c31263a6919000f4f1e1a6bfbab231861bc57.tar.gz |
chore: Use the `chef_dictionary` directly. (#13467)
`cspell` and `cspell-action` now support fetching remote dictionaries.
Note: the file format `version` is now "0.2".
Signed-off-by: Jason Dent <jason@steetsidesoftware.nl>
-rw-r--r-- | cspell.json | 13 | ||||
-rw-r--r-- | tasks/spellcheck.rb | 24 |
2 files changed, 6 insertions, 31 deletions
diff --git a/cspell.json b/cspell.json index b004ebe40a..7285e8d28a 100644 --- a/cspell.json +++ b/cspell.json @@ -1,14 +1,13 @@ // cSpell Settings { - // Version of the setting file. Always 0.1 - "version": "0.1", + "version": "0.2", // language - current active spelling language "language": "en", "dictionaryDefinitions": [ { - "name": "chef", - "file": "./chef_dictionary.txt", - "description": "Custom Chef Dictionary" + "name": "chef", + "path": "https://raw.githubusercontent.com/chef/chef_dictionary/main/chef.txt", + "description": "Custom Chef Dictionary" } ], "dictionaries": ["chef"], @@ -1556,9 +1555,7 @@ // flagWords - list of words to be always considered incorrect // This is useful for offensive words and common spelling errors. // For example "hte" should be "the" - "flagWords": [ - "hte" - ], + "flagWords": ["hte"], "ignorePaths": [ "CHEF_MVPS.md", "CHANGELOG.md", diff --git a/tasks/spellcheck.rb b/tasks/spellcheck.rb index fe41cdf1ac..53c7f623c6 100644 --- a/tasks/spellcheck.rb +++ b/tasks/spellcheck.rb @@ -20,33 +20,11 @@ namespace :spellcheck do sh 'cspell lint --no-progress "**/*"' end - task prereqs: %i{curl_check cspell_check config_check fetch_common} - - task :curl_check do - curl_version = begin - `curl --version` - rescue - nil - end - - curl_version.is_a?(String) || abort(<<~INSTALL_CURL) - curl is not available, cannot download chef_dictionary.txt - INSTALL_CURL - end - - task :fetch_common do - sh "curl -s https://raw.githubusercontent.com/chef/chef_dictionary/main/chef.txt -o chef_dictionary.txt" - end + task prereqs: %i{cspell_check config_check} task :config_check do require "json" - chef_dictionary = "chef_dictionary.txt" - - unless File.readable?(chef_dictionary) - abort "Dictionary file '#{chef_dictionary}' not found, skipping spellcheck" - end - config_file = "cspell.json" unless File.readable?(config_file) |