Skip to content

Commit

Permalink
Fix typos (#507)
Browse files Browse the repository at this point in the history
```
codespell **/*.rb -L filetest,compliancy,reenable -w
```

Plus a manual fix of

```
lib/haml_lint/tree/root_node.rb:8: fo ==> of, for, to, do, go
```
  • Loading branch information
tagliala authored Apr 29, 2024
1 parent 27f9df7 commit 5e2ed73
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.unescape_interpolation_to_original_cache
Thread.current[:haml_lint_unescape_interpolation_to_original_cache] ||= {}
end

# As soon as a HamlLint::Document has finished processing a HAML souce, this gets called to
# As soon as a HamlLint::Document has finished processing a HAML source, this gets called to
# get a copy of this cache and clear up for the next HAML processing
def self.unescape_interpolation_to_original_cache_take_and_wipe
value = unescape_interpolation_to_original_cache.dup
Expand Down
2 changes: 1 addition & 1 deletion lib/haml_lint/linter/rubocop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def transfer_corrections(coordinator, new_ruby_code)
# so the lints will be recorded then.
@lints = []

msg = "Corrections couldn't be transfered: #{e.message} - Consider linting the file " \
msg = "Corrections couldn't be transferred: #{e.message} - Consider linting the file " \
'without auto-correct and doing the changes manually.'
if ENV['HAML_LINT_DEBUG'] == 'true'
msg = "#{msg} DEBUG: Rubocop corrected Ruby code follows:\n#{new_ruby_code}\n------"
Expand Down
4 changes: 2 additions & 2 deletions lib/haml_lint/reporter/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def print_summary_files(report)
# Prints a summary of the number of lints found in a report.
#
# @param report [HamlLint::Report] the report to print
# @param is_append [Boolean] if this is appending to a line. Will preffix with ", ".
# @param is_append [Boolean] if this is appending to a line. Will prefix with ", ".
# @return [void]
def print_summary_lints(report, is_append:)
log.log ', ', false if is_append
Expand All @@ -114,7 +114,7 @@ def print_summary_lints(report, is_append:)
# Prints a summary of the number of lints corrected in a report.
#
# @param report [HamlLint::Report] the report to print
# @param is_append [Boolean] if this is appending to a line. Will preffix with ", ".
# @param is_append [Boolean] if this is appending to a line. Will prefix with ", ".
# @return [void]
def print_summary_corrected_lints(report, is_append:)
lint_count = report.lints.count(&:corrected)
Expand Down
2 changes: 1 addition & 1 deletion lib/haml_lint/ruby_extraction/base_chunk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def transfer_correction(coordinator, _all_corrected_ruby_lines, haml_lines)
transfer_correction_logic(coordinator, to_ruby_lines, haml_lines)
end

# To be overriden by subclasses.
# To be overridden by subclasses.
#
# Logic to transfer the corrections that turned from_ruby_lines into to_ruby_lines.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/haml_lint/ruby_extraction/chunk_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def self.start_nesting_after?(code)

def self.anonymous_block?(code)
# Don't start with a comment and end with a `do`
# Definetly not perfect for the comment handling, but otherwise a more advanced parsing system is needed.
# Definitely not perfect for the comment handling, but otherwise a more advanced parsing system is needed.
# Move the comment to its own line if it's annoying.
code !~ /\A\s*#/ &&
code =~ /\bdo\s*(\|[^|]*\|\s*)?(#.*)?\z/
Expand Down
2 changes: 1 addition & 1 deletion lib/haml_lint/tree/root_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module HamlLint::Tree
# Represents the root node of a HAML document that contains all other nodes.
class RootNode < Node
# The name fo the file parsed to build this tree.
# The name of the file parsed to build this tree.
#
# @return [String] a file name
def file
Expand Down