spellr 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +186 -0
  5. data/.ruby-version +1 -0
  6. data/.spellr.yml +23 -0
  7. data/.spellr_wordlists/dictionary.txt +120 -0
  8. data/.spellr_wordlists/english.txt +3 -0
  9. data/.spellr_wordlists/lorem.txt +4 -0
  10. data/.spellr_wordlists/ruby.txt +2 -0
  11. data/.travis.yml +7 -0
  12. data/Gemfile +8 -0
  13. data/Gemfile.lock +67 -0
  14. data/LICENSE.txt +21 -0
  15. data/README.md +64 -0
  16. data/Rakefile +8 -0
  17. data/bin/console +8 -0
  18. data/bin/fetch_wordlist/english +65 -0
  19. data/bin/fetch_wordlist/ruby +150 -0
  20. data/bin/setup +3 -0
  21. data/exe/spellr +5 -0
  22. data/lib/.spellr.yml +93 -0
  23. data/lib/spellr.rb +26 -0
  24. data/lib/spellr/check.rb +56 -0
  25. data/lib/spellr/cli.rb +205 -0
  26. data/lib/spellr/column_location.rb +49 -0
  27. data/lib/spellr/config.rb +105 -0
  28. data/lib/spellr/file.rb +27 -0
  29. data/lib/spellr/file_list.rb +45 -0
  30. data/lib/spellr/interactive.rb +191 -0
  31. data/lib/spellr/language.rb +104 -0
  32. data/lib/spellr/line_location.rb +29 -0
  33. data/lib/spellr/line_tokenizer.rb +181 -0
  34. data/lib/spellr/reporter.rb +27 -0
  35. data/lib/spellr/string_format.rb +43 -0
  36. data/lib/spellr/token.rb +83 -0
  37. data/lib/spellr/tokenizer.rb +72 -0
  38. data/lib/spellr/version.rb +5 -0
  39. data/lib/spellr/wordlist.rb +100 -0
  40. data/lib/spellr/wordlist_reporter.rb +21 -0
  41. data/spellr.gemspec +35 -0
  42. data/wordlist +2 -0
  43. data/wordlists/dockerfile.txt +21 -0
  44. data/wordlists/html.txt +340 -0
  45. data/wordlists/javascript.txt +64 -0
  46. data/wordlists/ruby.txt +2344 -0
  47. data/wordlists/shell.txt +2 -0
  48. metadata +217 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9b7c231dabb4a0b49998f877ebd00ecf07ea6f25a80f22e353e39fcd4b0c9ad1
4
+ data.tar.gz: 99e8eb2b64932a8e60abe5650044e7a2372c2d7b31109468e876462b83c02fe6
5
+ SHA512:
6
+ metadata.gz: fb2a823596e83c160e693b09885238809fb119ccb4b73819b27d2adc3cda19b183bc4b667d2530f3e13a898e10bcf6ca4fa10f298c01b600856fd2c314038a9b
7
+ data.tar.gz: 399db2df47f14233869752713bb5f5a93a2c9bb6f08f5d0edbf7344f190a464d9d57a1d24ae49ed1b057e5e601babf0f7a5894a0305c686971c75a9cd03dd3b3
@@ -0,0 +1,2 @@
1
+ /.spellr_wordlists/generated/*
2
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,186 @@
1
+ require: rubocop-rspec
2
+
3
+ # Reference:
4
+ # https://rubocop.readthedocs.io/en/latest/
5
+
6
+ # Keep this in alphabetical order.
7
+ # Each override should have a comment (even if it's just "default is bad")
8
+
9
+ AllCops:
10
+ Exclude:
11
+ - db/schema*
12
+ - .bundle/**/*
13
+ - tmp/**/*
14
+ DisplayCopNames: true
15
+ DisplayStyleGuide: true
16
+ TargetRubyVersion: 2.5
17
+
18
+ # all of our layout customisations are because we prefer indentation to be
19
+ # always consistently 2 spaces, for blocks, scopes, multiline expressions, etc
20
+ # e.g.
21
+ # class Klass
22
+ # def method(arg1,
23
+ # arg2)
24
+ # value = if arg1 == 'value' && arg2 == 'value'
25
+ # method2
26
+ # .method(arg_a, arg_b,
27
+ # arg_c, arg_d, keyword1: true,
28
+ # keyword2: true) do
29
+ # @last = [
30
+ # arg_a, arg_b,
31
+ # arg_c, arg_d
32
+ # ]
33
+ # end
34
+ # end
35
+ # value
36
+ # end
37
+ # end
38
+
39
+ # to match our preference for consistent indentation
40
+ Layout/AlignHash:
41
+ EnforcedLastArgumentHashStyle: always_ignore
42
+
43
+ # to match our preference for consistent indentation
44
+ Layout/AlignParameters:
45
+ EnforcedStyle: with_fixed_indentation
46
+
47
+ # to match our preference for consistent indentation
48
+ Layout/BlockAlignment:
49
+ EnforcedStyleAlignWith: start_of_block
50
+
51
+ # to match our preference for consistent indentation
52
+ Layout/CaseIndentation:
53
+ EnforcedStyle: end
54
+
55
+ # to match our preference for consistent indentation
56
+ Layout/EndAlignment:
57
+ EnforcedStyleAlignWith: start_of_line
58
+
59
+ # Aligning Assignments, etc makes diffs noisy
60
+ Layout/ExtraSpacing:
61
+ AllowForAlignment: false
62
+
63
+ # to match our preference for consistent indentation
64
+ Layout/FirstArrayElementLineBreak:
65
+ Enabled: true
66
+
67
+ # to match our preference for consistent indentation
68
+ Layout/FirstHashElementLineBreak:
69
+ Enabled: true
70
+
71
+ # to match our preference for consistent indentation
72
+ Layout/FirstParameterIndentation:
73
+ EnforcedStyle: consistent
74
+
75
+ # to match our preference for consistent indentation
76
+ Layout/IndentArray:
77
+ EnforcedStyle: consistent
78
+
79
+ # to match our preference for consistent indentation
80
+ Layout/IndentHash:
81
+ EnforcedStyle: consistent
82
+
83
+ # to match our preference for consistent indentation
84
+ # and hanging assignment looks lost
85
+ Layout/MultilineAssignmentLayout:
86
+ EnforcedStyle: same_line
87
+
88
+ # this changes our preferred:
89
+ # value = if thing1 &&
90
+ # thing2
91
+ # to:
92
+ # value = if thing1 &&
93
+ # thing2
94
+ # even though the IndentationWidth is 2
95
+ # but it's right most of the time so I put up with it
96
+ Layout/MultilineOperationIndentation:
97
+ EnforcedStyle: indented
98
+
99
+ Layout/MultilineMethodCallIndentation:
100
+ EnforcedStyle: indented
101
+
102
+ # Temporarily disable this spec as a recent change has broken it for us:
103
+ # https://github.com/rubocop-hq/rubocop/issues/6254
104
+ Layout/RescueEnsureAlignment:
105
+ Enabled: false
106
+
107
+ Metrics:
108
+ CountComments: false
109
+
110
+ Metrics/BlockLength:
111
+ ExcludedMethods:
112
+ - configure
113
+ - describe
114
+ - context
115
+ - it
116
+
117
+ Metrics/LineLength:
118
+ Max: 120
119
+
120
+ Naming/UncommunicativeMethodParamName:
121
+ AllowedNames: [_, io, id, to, by, 'on', in, at, ip, db]
122
+
123
+ RSpec:
124
+ Enabled: true
125
+ Include:
126
+ - 'spec/**/*.rb'
127
+
128
+ RSpec/DescribeClass:
129
+ Enabled: false
130
+
131
+ # I misuse matchers often
132
+ RSpec/ExpectActual:
133
+ Enabled: false
134
+
135
+ RSpec/FilePath:
136
+ Enabled: false
137
+
138
+ # Multiple expectations are useful
139
+ # checking you've partially achieved something on the way to completely achieving it is useful for debugging failures
140
+ RSpec/MultipleExpectations:
141
+ Enabled: false
142
+
143
+ # It should be obvious from context. Chill out rubocop
144
+ RSpec/NamedSubject:
145
+ Enabled: false
146
+
147
+
148
+ # This matches the style we've been using all along (ever so slightly more frequently)
149
+ Style/Alias:
150
+ EnforcedStyle: prefer_alias_method
151
+
152
+ Style/CollectionMethods:
153
+ Enabled: true
154
+
155
+ # we don't rdoc
156
+ Style/Documentation:
157
+ Enabled: false
158
+
159
+ # [a, b].include?(x) is more unclear than a == x || b == x
160
+ Style/MultipleComparison:
161
+ Enabled: false
162
+
163
+ Style/NumericPredicate:
164
+ Enabled: false
165
+
166
+ # we use %w{} pretty frequently
167
+ Style/PercentLiteralDelimiters:
168
+ PreferredDelimiters:
169
+ default: '{}'
170
+ '%w': '{}'
171
+ '%W': '{}'
172
+ '%i': '{}'
173
+ '%I': '{}'
174
+ '%r': '{}'
175
+
176
+ # We want this to warn to force consistency within the codebase.
177
+ Style/SafeNavigation:
178
+ Enabled: true
179
+
180
+ # different methods calls that do exactly the same thing are a smell, regardless of semantics
181
+ Style/SignalException:
182
+ EnforcedStyle: only_raise
183
+
184
+ # this wants less descriptive names
185
+ Style/SingleLineBlockParams:
186
+ Enabled: false
@@ -0,0 +1 @@
1
+ ruby-2.5.1
@@ -0,0 +1,23 @@
1
+ ---
2
+ ignore:
3
+ - '*.spellr_wordlists'
4
+ - wordlists/*
5
+ only:
6
+ - '*.rb'
7
+ - '*.yml'
8
+ - '*.txt'
9
+ - Rakefile
10
+ - '*.md'
11
+ - '*.gemspec'
12
+ - Gemfile
13
+ languages:
14
+ english:
15
+ wordlists:
16
+ - dictionary.txt
17
+ ruby:
18
+ only:
19
+ - README.md
20
+ lorem:
21
+ only:
22
+ - spec/*
23
+ - .spellr.yml
@@ -0,0 +1,120 @@
1
+ abc
2
+ addable
3
+ arg
4
+ args
5
+ baz
6
+ bundler
7
+ changelog
8
+ charpos
9
+ cli
10
+ cmd
11
+ codebase
12
+ colours
13
+ config
14
+ configs
15
+ css
16
+ customisations
17
+ cyclomatic
18
+ def
19
+ dict
20
+ diffable
21
+ diffs
22
+ dockerfile
23
+ downloader
24
+ env
25
+ eos
26
+ eot
27
+ erb
28
+ exclusions
29
+ exe
30
+ executables
31
+ exitstatus
32
+ ext
33
+ filename
34
+ filenames
35
+ foo
36
+ gemfile
37
+ gemspec
38
+ getch
39
+ git
40
+ github
41
+ gitignore
42
+ gitignored
43
+ gitkeep
44
+ haml
45
+ hashbang
46
+ hashbangs
47
+ hashbangs
48
+ heuristically
49
+ hml
50
+ hostnames
51
+ href
52
+ htt
53
+ ico
54
+ inclusions
55
+ jbuilder
56
+ jpg
57
+ jsx
58
+ klass
59
+ localhost
60
+ lstripped
61
+ mailto
62
+ marketplacer
63
+ matcher
64
+ matchers
65
+ maths
66
+ merchantability
67
+ multiline
68
+ newlines
69
+ noninfringement
70
+ nonwords
71
+ optparse
72
+ org
73
+ param
74
+ params
75
+ png
76
+ pwd
77
+ rakefile
78
+ rdoc
79
+ readme
80
+ redisplay
81
+ repo
82
+ rspec
83
+ rubocop
84
+ rvm
85
+ scss
86
+ shelljoin
87
+ shellsplit
88
+ shellwords
89
+ sherson
90
+ spellr
91
+ stderr
92
+ stdlib
93
+ stdout
94
+ str
95
+ stringscanner
96
+ strscan
97
+ sublicense
98
+ subwords
99
+ sudo
100
+ svg
101
+ thu
102
+ tlds
103
+ tmp
104
+ todo
105
+ tokenize
106
+ tokenizes
107
+ tsx
108
+ ttf
109
+ txt
110
+ uploader
111
+ uri
112
+ usr
113
+ utf
114
+ wordlist
115
+ wordlists
116
+ wordn't
117
+ xdescribe
118
+ xit
119
+ yardoc
120
+ yml
@@ -0,0 +1,3 @@
1
+ json
2
+ woff
3
+ xlsx
@@ -0,0 +1,4 @@
1
+ amet
2
+ dolor
3
+ ipsum
4
+ lorem
@@ -0,0 +1,2 @@
1
+ matchdata
2
+ pty
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.1
7
+ before_install: gem install bundler -v 1.17.1
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in spellr.gemspec
8
+ gemspec
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ spellr (0.1.0)
5
+ fast_ignore
6
+ parallel
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.0)
12
+ coderay (1.1.2)
13
+ diff-lcs (1.3)
14
+ fast_ignore (0.1.0)
15
+ jaro_winkler (1.5.2)
16
+ method_source (0.9.2)
17
+ parallel (1.14.0)
18
+ parser (2.6.2.0)
19
+ ast (~> 2.4.0)
20
+ pry (0.12.2)
21
+ coderay (~> 1.1.0)
22
+ method_source (~> 0.9.0)
23
+ psych (3.1.0)
24
+ rainbow (3.0.0)
25
+ rake (10.5.0)
26
+ rspec (3.8.0)
27
+ rspec-core (~> 3.8.0)
28
+ rspec-expectations (~> 3.8.0)
29
+ rspec-mocks (~> 3.8.0)
30
+ rspec-core (3.8.0)
31
+ rspec-support (~> 3.8.0)
32
+ rspec-eventually (0.2.2)
33
+ rspec-expectations (3.8.2)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.8.0)
36
+ rspec-mocks (3.8.0)
37
+ diff-lcs (>= 1.2.0, < 2.0)
38
+ rspec-support (~> 3.8.0)
39
+ rspec-support (3.8.0)
40
+ rubocop (0.66.0)
41
+ jaro_winkler (~> 1.5.1)
42
+ parallel (~> 1.10)
43
+ parser (>= 2.5, != 2.5.1.1)
44
+ psych (>= 3.1.0)
45
+ rainbow (>= 2.2.2, < 4.0)
46
+ ruby-progressbar (~> 1.7)
47
+ unicode-display_width (>= 1.4.0, < 1.6)
48
+ rubocop-rspec (1.32.0)
49
+ rubocop (>= 0.60.0)
50
+ ruby-progressbar (1.10.0)
51
+ unicode-display_width (1.5.0)
52
+
53
+ PLATFORMS
54
+ ruby
55
+
56
+ DEPENDENCIES
57
+ bundler (~> 1.17)
58
+ pry
59
+ rake (~> 10.0)
60
+ rspec (~> 3.0)
61
+ rspec-eventually
62
+ rubocop
63
+ rubocop-rspec
64
+ spellr!
65
+
66
+ BUNDLED WITH
67
+ 1.17.3