Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions lib/query_packwerk/file_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_file(file_name)
end
end

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

# We can find a constant, but by going up its parents we can find out the full call chain
# by checking if each parent is a receiver of the child, giving us method calls and
# We can find a constant, but by going up its parents we can find the full call chain.
# We check if each parent is a receiver of the child, giving us method calls and
# arguments on a constant as well as where it occurred.
sig { params(node: RuboCop::AST::Node).returns(RuboCop::AST::Node) }
def get_full_receiver_chain(node)
Expand Down
2 changes: 1 addition & 1 deletion lib/query_packwerk/query_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def where(**query_params, &_query_fn)
end
end
end
# Similar to the above `original_collection` we want to override this by defining
# Similar to the above `original_collection`, we want to override this by defining
# where the InheritingClass can find all of its raw data.
#
# Sorbet does not recognize `included(klass)`/`klass.extend(ClassMethods)` when
Expand Down
2 changes: 1 addition & 1 deletion lib/query_packwerk/violation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def sources_with_contexts(start_offset: 3, end_offset: 3)
end
end

# Like above frequency of sources, except by method "shape" rather than
# Like the above source frequency, except grouped by method "shape" rather than
# exact arguments
sig { returns(T::Hash[String, Integer]) }
def anonymous_source_counts
Expand Down
4 changes: 2 additions & 2 deletions lib/query_packwerk/violations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def sources_with_locations
deep_merge_groups(@original_collection) { |v| [v.class_name, v.sources_with_locations] }
end

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