Skip to content

Commit f9cbf93

Browse files
authored
Fix typos and grammatical issues (#24)
* Fix typos: occurrencs -> occurrences, occuring -> occurring * Fix grammatical issues in comments and documentation
1 parent fbaed9e commit f9cbf93

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lib/query_packwerk/file_cache.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def get_file(file_name)
7474
end
7575
end
7676

77-
# Get all occurrencs of the violation's constant in a file
77+
# Get all occurrences of the violation's constant in a file
7878
sig { params(file_name: String, class_name: String).returns(T::Array[RuboCop::AST::Node]) }
7979
def get_all_const_occurrences(file_name:, class_name:)
8080
const_key = [file_name, class_name]
@@ -139,8 +139,8 @@ def ast_from(string)
139139
RuboCop::ProcessedSource.new(string, RUBY_VERSION.to_f).ast
140140
end
141141

142-
# We can find a constant, but by going up its parents we can find out the full call chain
143-
# by checking if each parent is a receiver of the child, giving us method calls and
142+
# We can find a constant, but by going up its parents we can find the full call chain.
143+
# We check if each parent is a receiver of the child, giving us method calls and
144144
# arguments on a constant as well as where it occurred.
145145
sig { params(node: RuboCop::AST::Node).returns(RuboCop::AST::Node) }
146146
def get_full_receiver_chain(node)

lib/query_packwerk/query_interface.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def where(**query_params, &_query_fn)
125125
end
126126
end
127127
end
128-
# Similar to the above `original_collection` we want to override this by defining
128+
# Similar to the above `original_collection`, we want to override this by defining
129129
# where the InheritingClass can find all of its raw data.
130130
#
131131
# Sorbet does not recognize `included(klass)`/`klass.extend(ClassMethods)` when

lib/query_packwerk/violation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def sources_with_contexts(start_offset: 3, end_offset: 3)
188188
end
189189
end
190190

191-
# Like above frequency of sources, except by method "shape" rather than
191+
# Like the above source frequency, except grouped by method "shape" rather than
192192
# exact arguments
193193
sig { returns(T::Hash[String, Integer]) }
194194
def anonymous_source_counts

lib/query_packwerk/violations.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ def sources_with_locations
158158
deep_merge_groups(@original_collection) { |v| [v.class_name, v.sources_with_locations] }
159159
end
160160

161-
# Instead of getting all instances of the source, count how often each occurs, with the option to
162-
# provide a threshold to remove lower-occuring items.
161+
# Instead of returning all instances of the source, count how often each occurs, with the option to
162+
# provide a threshold to remove lower-occurring items.
163163
sig { params(threshold: Integer).returns(T::Hash[String, T::Hash[String, Integer]]) }
164164
def source_counts(threshold: 0)
165165
load_sources!

0 commit comments

Comments
 (0)