diff --git a/lib/query_packwerk/file_cache.rb b/lib/query_packwerk/file_cache.rb index 820362d..54446f2 100644 --- a/lib/query_packwerk/file_cache.rb +++ b/lib/query_packwerk/file_cache.rb @@ -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] @@ -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) diff --git a/lib/query_packwerk/query_interface.rb b/lib/query_packwerk/query_interface.rb index e9f7c3c..a50330e 100644 --- a/lib/query_packwerk/query_interface.rb +++ b/lib/query_packwerk/query_interface.rb @@ -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 diff --git a/lib/query_packwerk/violation.rb b/lib/query_packwerk/violation.rb index 483e18b..bf3a902 100644 --- a/lib/query_packwerk/violation.rb +++ b/lib/query_packwerk/violation.rb @@ -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 diff --git a/lib/query_packwerk/violations.rb b/lib/query_packwerk/violations.rb index 8ba426e..f12dda4 100644 --- a/lib/query_packwerk/violations.rb +++ b/lib/query_packwerk/violations.rb @@ -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!