Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more complex yaml structure and fix readme #10

Merged
merged 5 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You'll need to install Aspell:

## Configuration

In order to change configuration, you need to create `.pronto_spell.yaml` file in your project root directory. Awailable options are:
In order to change configuration, you need to create `.pronto_spell.yml` file in your project root directory. Awailable options are:

```YAML
suggestion_mode: 'fast' # default
Expand Down
4 changes: 2 additions & 2 deletions lib/pronto/spell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ class Spell < Runner

def ignored_words
@ignored_words ||= begin
Set.new(spelling_config['ignored_words'].to_a.map(&:downcase))
Set.new(spelling_config['ignored_words'].to_a.flatten.map(&:downcase))
end
end

def keywords
@keywords ||= begin
Set.new(spelling_config['only_lines_matching'].to_a.map(&:downcase))
Set.new(spelling_config['only_lines_matching'].to_a.flatten.map(&:downcase))
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/pronto/spell/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Pronto
module SpellVersion
VERSION = '0.11.0'
VERSION = '0.11.1'
end
end
14 changes: 7 additions & 7 deletions spec/pronto/spell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ module Pronto
end

context 'with misspelled words' do
it 'returns list of misspeled words' do
fit 'returns list of misspeled words' do
expect(lint_messages).to eq [
'"helllo" might not be spelled correctly. ' \
'Spelling suggestions: hell lo, hell-lo, hello',
"Spelling suggestions: hello, hell, he'll",

'"woorld" might not be spelled correctly. ' \
'Spelling suggestions: world, wold, whorled'
Expand All @@ -67,7 +67,7 @@ module Pronto
it 'validates each word separately' do
expect(lint_messages).to eq [
'"Withh" might not be spelled correctly. ' \
'Spelling suggestions: With, Withe, Wither',
'Spelling suggestions: With, Withe, Witch',

'"Wrrrong" might not be spelled correctly. ' \
'Spelling suggestions: Wrong, Wrung, Wring'
Expand All @@ -81,10 +81,10 @@ module Pronto
it 'validates each word separately' do
expect(lint_messages).to eq [
'"LOOOK" might not be spelled correctly. ' \
'Spelling suggestions: LOO OK, LOO-OK, LOOK',
'Spelling suggestions: LOOK, LOGO, LOCK',

'"SHOWTING" might not be spelled correctly. ' \
'Spelling suggestions: SHOW TING, SHOW-TING, SHOOTING'
'Spelling suggestions: SHOWING, SHOOTING, SHORTING'
]
end
end
Expand All @@ -98,7 +98,7 @@ module Pronto
'Spelling suggestions: cool, Colo, coil',

'"skool" might not be spelled correctly. '\
'Spelling suggestions: skoal, school, skill'
'Spelling suggestions: skoal, spool, stool'
]
end
end
Expand Down Expand Up @@ -126,7 +126,7 @@ module Pronto
it 'returns the list of misspeled words' do
expect(lint_messages).to eq [
'"helllo" might not be spelled correctly. ' \
'Spelling suggestions: hell lo, hell-lo, hello',
"Spelling suggestions: hello, hell, he'll",

'"tsetir" might not be spelled correctly. ' \
'Spelling suggestions: testier, tester, taster'
Expand Down