From 21dfc90c9a7f81aa8ff4dfea079df46aa2bba08f Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 22:49:57 +0100 Subject: [PATCH 01/14] Use ameba from `master` branch (1.7.0-dev) --- shard.lock | 2 +- shard.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shard.lock b/shard.lock index 1a2d82e6b..b9908879e 100644 --- a/shard.lock +++ b/shard.lock @@ -6,7 +6,7 @@ shards: ameba: git: https://github.com/crystal-ameba/ameba.git - version: 1.6.4 + version: 1.7.0-dev+git.commit.37fe65d0d86477ecd6cf0bab2d519f2235fea6b5 ansi-escapes: git: https://github.com/gtramontina/ansi-escapes.cr.git diff --git a/shard.yml b/shard.yml index 2155c6cd5..831f8b63d 100644 --- a/shard.yml +++ b/shard.yml @@ -27,7 +27,7 @@ dependencies: development_dependencies: ameba: github: crystal-ameba/ameba - version: ~> 1.6.4 + branch: master targets: mint: From b54c198f71065443519a1b7d306e8bcf529cf959 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 22:50:24 +0100 Subject: [PATCH 02/14] Remove obsolete definition --- .ameba.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.ameba.yml b/.ameba.yml index 6d2bce0f5..a3401d7a9 100644 --- a/.ameba.yml +++ b/.ameba.yml @@ -1,6 +1,3 @@ -Documentation/DocumentationAdmonition: - Enabled: false - Metrics/CyclomaticComplexity: Enabled: false From 20b7c2a6d7b8bd8d8b852accc62d87bfb3b1f225 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 22:52:00 +0100 Subject: [PATCH 03/14] Fix `Lint/SpecEqWithBoolOrNilLiteral` type of Ameba issues --- spec/ast/node_spec.cr | 14 +++++++------- spec/type_unification_spec.cr | 6 +++--- spec_cli/build_spec.cr | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/ast/node_spec.cr b/spec/ast/node_spec.cr index 0ab0ee116..50349c7ba 100644 --- a/spec/ast/node_spec.cr +++ b/spec/ast/node_spec.cr @@ -26,17 +26,17 @@ describe Mint::Ast::Node do {node.to.line, node.to.column}.should eq({4, 3}) # First line - node.contains?(2, 1).should eq(false) # space before `f` - node.contains?(2, 3).should eq(true) # `f` of `fun` + node.contains?(2, 1).should be_false # space before `f` + node.contains?(2, 3).should be_true # `f` of `fun` # Middle line - node.contains?(3, 0).should eq(true) - node.contains?(3, 9).should eq(true) - node.contains?(3, 1000).should eq(true) + node.contains?(3, 0).should be_true + node.contains?(3, 9).should be_true + node.contains?(3, 1000).should be_true # End line - node.contains?(4, 2).should eq(true) # `}` - node.contains?(4, 3).should eq(false) # space after `}` + node.contains?(4, 2).should be_true # `}` + node.contains?(4, 3).should be_false # space after `}` end end end diff --git a/spec/type_unification_spec.cr b/spec/type_unification_spec.cr index 18cdab7d5..b2b86aa48 100644 --- a/spec/type_unification_spec.cr +++ b/spec/type_unification_spec.cr @@ -142,14 +142,14 @@ describe Mint::TypeChecker do recordb = Record.new("Blah", {"name" => Type.new("B")} of String => Checkable) Mint::TypeChecker::Comparer.compare(recorda, recorda).should be_a(Record) - Mint::TypeChecker::Comparer.compare(recordb, recorda).should eq(nil) + Mint::TypeChecker::Comparer.compare(recordb, recorda).should be_nil end end describe "Record vs Type" do it "returns null for different name" do - Mint::TypeChecker::Comparer.compare(Record.new("Blah"), Type.new("Blaha")).should eq(nil) - Mint::TypeChecker::Comparer.compare(Type.new("Blah"), Record.new("Blaha")).should eq(nil) + Mint::TypeChecker::Comparer.compare(Record.new("Blah"), Type.new("Blaha")).should be_nil + Mint::TypeChecker::Comparer.compare(Type.new("Blah"), Record.new("Blaha")).should be_nil end it "returns null record for same name" do diff --git a/spec_cli/build_spec.cr b/spec_cli/build_spec.cr index 0f7372a8d..fa85dff2b 100644 --- a/spec_cli/build_spec.cr +++ b/spec_cli/build_spec.cr @@ -87,7 +87,7 @@ context "build" do All done in ××××! TEXT - File.exists?("dist/manifest.webmanifest").should eq(true) + File.exists?("dist/manifest.webmanifest").should be_true end it "logs the files using the `--verbose` flag" do From a30ed427d53ebb547d688bd6ab8deec16552c0a7 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 22:52:41 +0100 Subject: [PATCH 04/14] Fix `Lint/WhitespaceAroundMacroExpression` type of Ameba issues --- spec/spec_helper.cr | 16 ++++++++-------- spec/type_unification_spec.cr | 32 ++++++++++++++++---------------- src/exhaustiveness_checker.cr | 12 ++++++------ src/utils/html_builder.cr | 8 ++++---- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index ad3d0cd0e..d9362b72b 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -48,28 +48,28 @@ end macro subject(method) subject = ->(sample : String) { - Mint::Parser.new(sample, "TestFile.mint").{{method}} + Mint::Parser.new(sample, "TestFile.mint").{{ method }} } end macro expect_ok(sample) - it "Parses: " + {{"#{sample}"}} do - result = subject.call({{sample}}) + it "Parses: " + {{ "#{sample}" }} do + result = subject.call({{ sample }}) result.should_not be_nil result.should be_a(Mint::Ast::Node) end end macro expect_ignore(sample) - it {{"#{sample}"}} do - subject.call({{sample}}).should be_nil + it {{ "#{sample}" }} do + subject.call({{ sample }}).should be_nil end end macro expect_error(sample, error) - it {{"#{sample}"}} do - expect_raises({{error}}) do - subject.call({{sample}}) + it {{ "#{sample}" }} do + expect_raises({{ error }}) do + subject.call({{ sample }}) end end end diff --git a/spec/type_unification_spec.cr b/spec/type_unification_spec.cr index b2b86aa48..04d468022 100644 --- a/spec/type_unification_spec.cr +++ b/spec/type_unification_spec.cr @@ -57,54 +57,54 @@ class Parser end macro expect_result(a, b, expected) - it "{{a.id}} vs {{b.id}}" do - node1 = Parser.parse({{a}}) - node2 = Parser.parse({{b}}) + it "{{ a.id }} vs {{ b.id }}" do + node1 = Parser.parse({{ a }}) + node2 = Parser.parse({{ b }}) if node1 && node2 result = Mint::TypeChecker::Comparer.compare(node1, node2) unless result - fail "Expected {{a.id}} to equal to {{b.id}} but it does not" + fail "Expected {{ a.id }} to equal to {{ b.id }} but it does not" end - result.to_s.should eq({{expected}}) + result.to_s.should eq({{ expected }}) else - fail "Could not parse {{a.id}} or {{b.id}}" + fail "Could not parse {{ a.id }} or {{ b.id }}" end end end macro expect_equal(a, b) - it "{{a.id}} vs {{b.id}}" do - node1 = Parser.parse({{a}}) - node2 = Parser.parse({{b}}) + it "{{ a.id }} vs {{ b.id }}" do + node1 = Parser.parse({{ a }}) + node2 = Parser.parse({{ b }}) if node1 && node2 result = Mint::TypeChecker::Comparer.compare(node1, node2) unless result - fail "Expected {{a.id}} to equal to {{b.id}} but it does not" + fail "Expected {{ a.id }} to equal to {{ b.id }} but it does not" end else - fail "Could not parse {{a.id}} or {{b.id}}" + fail "Could not parse {{ a.id }} or {{ b.id }}" end end end macro expect_not_equal(a, b) - it "{{a.id}} vs {{b.id}}" do - node1 = Parser.parse({{a}}) - node2 = Parser.parse({{b}}) + it "{{ a.id }} vs {{ b.id }}" do + node1 = Parser.parse({{ a }}) + node2 = Parser.parse({{ b }}) if node1 && node2 result = Mint::TypeChecker::Comparer.compare(node1, node2) if result - fail "Expected {{a.id}} not to equal to {{b.id}} but the result is #{result.to_s}" + fail "Expected {{ a.id }} not to equal to {{ b.id }} but the result is #{result.to_s}" end else - fail "Could not parse {{a.id}} or {{b.id}}" + fail "Could not parse {{ a.id }} or {{ b.id }}" end end end diff --git a/src/exhaustiveness_checker.cr b/src/exhaustiveness_checker.cr index ef953ad40..23e37c470 100644 --- a/src/exhaustiveness_checker.cr +++ b/src/exhaustiveness_checker.cr @@ -1,21 +1,21 @@ module ExhaustivenessChecker # Like the `record` macro but for classes. macro variant(name, *properties, **kwargs) - class {{name.id}} + class {{ name.id }} {% for property in properties %} {% if property.is_a?(Assign) %} - getter {{property.target.id}} + getter {{ property.target.id }} {% elsif property.is_a?(TypeDeclaration) %} - getter {{property}} + getter {{ property }} {% else %} - getter :{{property.id}} + getter :{{ property.id }} {% end %} {% end %} - def initialize({{properties.map { |field| "@#{field.id}".id }.splat}}) + def initialize({{ properties.map { |field| "@#{field.id}".id }.splat }}) end - {{yield}} + {{ yield }} end end diff --git a/src/utils/html_builder.cr b/src/utils/html_builder.cr index e320f4dfd..fff5334ec 100644 --- a/src/utils/html_builder.cr +++ b/src/utils/html_builder.cr @@ -54,12 +54,12 @@ module Mint {% for tag in %w(html head body meta link pre code noscript div span h1 h2 h3 title aside article nav strong) %} - def {{tag.id}}(**attributes) - @xml.element("{{tag.id}}", **attributes) + def {{ tag.id }}(**attributes) + @xml.element("{{ tag.id }}", **attributes) end - def {{tag.id}}(**attributes) - @xml.element("{{tag.id}}", **attributes) do + def {{ tag.id }}(**attributes) + @xml.element("{{ tag.id }}", **attributes) do with self yield end end From fd742368e88e6bacf23f1009c15132de6354ef38 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 22:53:11 +0100 Subject: [PATCH 05/14] Fix `Style/RedundantNilInControlExpression` type of Ameba issues --- src/ext/file.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext/file.cr b/src/ext/file.cr index ed85607ad..257a002b8 100644 --- a/src/ext/file.cr +++ b/src/ext/file.cr @@ -13,7 +13,7 @@ class File root = File.dirname(base) loop do - return nil if root == "." || root == "/" + return if root == "." || root == "/" if File.exists?(path = Path[root, name]) return path.to_s From a38303f60e32e5b26c738aa71f746a0a2712c7c8 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 22:54:34 +0100 Subject: [PATCH 06/14] Fix `Style/PercentLiteralDelimiters` type of Ameba issues --- src/ls/completion.cr | 4 ++-- src/ls/will_save_wait_until.cr | 2 +- src/type_checkers/builtin.cr | 4 ++-- src/type_checkers/variable.cr | 4 ++-- src/utils/html_builder.cr | 4 ++-- src/utils/markd_vdom_renderer.cr | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ls/completion.cr b/src/ls/completion.cr index 9e4f0026d..793bc8941 100644 --- a/src/ls/completion.cr +++ b/src/ls/completion.cr @@ -2,12 +2,12 @@ module Mint module LS class Completion KEYWORD_COMPLETIONS = - %w( + %w[ component module provider store state property connect exposing style or return let if else async get fun dbg encode decode case as use next of when global type @asset @svg @format @inline @highlight @highlight-file - ).map do |keyword| + ].map do |keyword| LSP::CompletionItem.new( kind: LSP::CompletionItemKind::Keyword, insert_text: keyword, diff --git a/src/ls/will_save_wait_until.cr b/src/ls/will_save_wait_until.cr index fc04e1ceb..eac872aa4 100644 --- a/src/ls/will_save_wait_until.cr +++ b/src/ls/will_save_wait_until.cr @@ -23,7 +23,7 @@ module Mint # because SublimeText LSP client freezes if there is no response. %w[] in Nil - %[] + %() end end end diff --git a/src/type_checkers/builtin.cr b/src/type_checkers/builtin.cr index 67396278b..d08af2ea2 100644 --- a/src/type_checkers/builtin.cr +++ b/src/type_checkers/builtin.cr @@ -1,9 +1,9 @@ module Mint class TypeChecker - EXPOSED_BUILTINS = %w( + EXPOSED_BUILTINS = %w[ decodeBoolean decodeNumber decodeString decodeArray decodeField decodeMaybe decodeTime locale normalizeEvent createPortal testContext testRender - setLocale navigate compare nothing just err ok inspect href) + setLocale navigate compare nothing just err ok inspect href] def check(node : Ast::Builtin) : Checkable error! :unkown_builtin do diff --git a/src/type_checkers/variable.cr b/src/type_checkers/variable.cr index 93b079040..fce67d924 100644 --- a/src/type_checkers/variable.cr +++ b/src/type_checkers/variable.cr @@ -1,9 +1,9 @@ module Mint class TypeChecker RESERVED = - %w(break case class const continue debugger default do else + %w[break case class const continue debugger default do else export extends for if import in instanceof new return super - switch throw typeof var while yield) + switch throw typeof var while yield] def check(node : Ast::Variable) : Checkable if node.value == "void" diff --git a/src/utils/html_builder.cr b/src/utils/html_builder.cr index fff5334ec..f48b58f48 100644 --- a/src/utils/html_builder.cr +++ b/src/utils/html_builder.cr @@ -52,8 +52,8 @@ module Mint @xml.raw(contents) end - {% for tag in %w(html head body meta link pre code noscript div span h1 h2 - h3 title aside article nav strong) %} + {% for tag in %w[html head body meta link pre code noscript div span h1 h2 + h3 title aside article nav strong] %} def {{ tag.id }}(**attributes) @xml.element("{{ tag.id }}", **attributes) end diff --git a/src/utils/markd_vdom_renderer.cr b/src/utils/markd_vdom_renderer.cr index 13d6fcea8..d8bf98a20 100644 --- a/src/utils/markd_vdom_renderer.cr +++ b/src/utils/markd_vdom_renderer.cr @@ -127,7 +127,7 @@ module Mint end end - HEADINGS = %w(h1 h2 h3 h4 h5 h6) + HEADINGS = %w[h1 h2 h3 h4 h5 h6] getter stack : Array(Node) = [] of Node From 7b6068ccb364dd3cf2b259d32b4f8b07b2fa2428 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 23:13:47 +0100 Subject: [PATCH 07/14] Fix `Style/RedundantSelf` type of Ameba issues --- src/ext/string.cr | 1 + src/formatter/processor.cr | 2 +- src/semantic_tokenizer.cr | 2 +- src/utils/markd_vdom_renderer.cr | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ext/string.cr b/src/ext/string.cr index 33da1c0f1..cc1dfa9eb 100644 --- a/src/ext/string.cr +++ b/src/ext/string.cr @@ -1,5 +1,6 @@ class String def uncolorize : String + # ameba:disable Style/RedundantSelf self .gsub(/[ \t]+$/m, "") .gsub(/\e\[(\d+;?)*m/, "") diff --git a/src/formatter/processor.cr b/src/formatter/processor.cr index 9957bc334..a0f198629 100644 --- a/src/formatter/processor.cr +++ b/src/formatter/processor.cr @@ -277,7 +277,7 @@ module Mint {self.depth, [node.ends[0], padding] of Node} head_size = - self.size(head) + size(head) result = process(head) diff --git a/src/semantic_tokenizer.cr b/src/semantic_tokenizer.cr index 2532f21af..411a84144 100644 --- a/src/semantic_tokenizer.cr +++ b/src/semantic_tokenizer.cr @@ -95,7 +95,7 @@ module Mint next parts if ast.nodes.empty? tokenizer = - self.new.tap(&.tokenize(ast)) + new.tap(&.tokenize(ast)) contents = ast.nodes.first.file.contents diff --git a/src/utils/markd_vdom_renderer.cr b/src/utils/markd_vdom_renderer.cr index d8bf98a20..0e758080d 100644 --- a/src/utils/markd_vdom_renderer.cr +++ b/src/utils/markd_vdom_renderer.cr @@ -24,7 +24,7 @@ module Mint js : Compiler::Js, ) : Compiler::Compiled render( - node: self.new.render(document, separator, highlight), + node: new.render(document, separator, highlight), replacements: replacements, separator: separator, js: js) @@ -38,7 +38,7 @@ module Mint separator : String, ) root = - self.new.render(document, separator, highlight) + new.render(document, separator, highlight) processor = uninitialized Node | String, HtmlBuilder -> Nil processor = ->(node : Node | String, builder : HtmlBuilder) do From 5a84f99661cfd4df010032ce88ac82836af4728e Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 23:25:53 +0100 Subject: [PATCH 08/14] Fix `Lint/UnneededDisableDirective` type of Ameba issues --- src/compiler/js.cr | 2 -- src/formatter/processor.cr | 2 +- src/utils/artifact_cleaner.cr | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/compiler/js.cr b/src/compiler/js.cr index bd7061098..4df5bd5c3 100644 --- a/src/compiler/js.cr +++ b/src/compiler/js.cr @@ -265,12 +265,10 @@ module Mint end def self.async?(items : Array(Compiled)) - # ameba:disable Performance/AnyInsteadOfEmpty items.any?(&->async?(Compiled)) end def self.async?(items : Compiled) - # ameba:disable Performance/AnyInsteadOfEmpty items.any?(&->async?(Item)) end diff --git a/src/formatter/processor.cr b/src/formatter/processor.cr index a0f198629..010030dce 100644 --- a/src/formatter/processor.cr +++ b/src/formatter/processor.cr @@ -321,7 +321,7 @@ module Mint # has new lines or not (used when rendering lists). def new_line?(nodes : Array(Processed)) - nodes.any?(&->new_line?(Processed)) # ameba:disable Performance/AnyInsteadOfEmpty + nodes.any?(&->new_line?(Processed)) end def new_line?(node : Processed) diff --git a/src/utils/artifact_cleaner.cr b/src/utils/artifact_cleaner.cr index 8d56961cf..da24d5305 100644 --- a/src/utils/artifact_cleaner.cr +++ b/src/utils/artifact_cleaner.cr @@ -8,7 +8,6 @@ module Mint %w[.mint dist] end - # ameba:disable Performance/AnyInsteadOfEmpty if artifacts.any?(&->Dir.exists?(String)) artifacts.each do |artifact| Dir.safe_delete artifact do From d302a29d51b5031d15bacf3211c24606a204b759 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 23:26:22 +0100 Subject: [PATCH 09/14] Fix `Style/MultilineCurlyBlock` type of Ameba issues --- src/parsers/css_definition.cr | 4 ++-- src/parsers/css_keyframes.cr | 25 +++++++++++++++---------- src/style_builder.cr | 8 ++++---- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/parsers/css_definition.cr b/src/parsers/css_definition.cr index bde9c620e..53e63014c 100644 --- a/src/parsers/css_definition.cr +++ b/src/parsers/css_definition.cr @@ -8,9 +8,9 @@ module Mint whitespace value = - many(parse_whitespace: false) { + many(parse_whitespace: false) do string_literal || interpolation || raw { char.in_set?("^;}{\0\"") } - }.map do |item| + end.map do |item| if item.is_a?(Ast::StringLiteral) && (raw = static_value(item)) %("#{raw}") else diff --git a/src/parsers/css_keyframes.cr b/src/parsers/css_keyframes.cr index 6e7264719..04c1e7199 100644 --- a/src/parsers/css_keyframes.cr +++ b/src/parsers/css_keyframes.cr @@ -14,22 +14,27 @@ module Mint end unless name selectors = brackets( - -> { error :css_keyframes_expected_opening_bracket do - expected "the opening bracket of a CSS keyframes rule", word - snippet self - end }, - -> { error :css_keyframes_expected_closing_bracket do - expected "the closing bracket of a CSS keyframes rule", word - snippet self - end }, + -> { + error :css_keyframes_expected_opening_bracket do + expected "the opening bracket of a CSS keyframes rule", word + snippet self + end + }, + -> { + error :css_keyframes_expected_closing_bracket do + expected "the closing bracket of a CSS keyframes rule", word + snippet self + end + }, ->(items : Array(Ast::Node)) { error :css_keyframes_expected_selectors do expected "the selectors of a CSS keyframes rule", word snippet self end if items.all?(Ast::Comment) - }) { + } + ) do many { comment || css_selector(only_definitions: true) } - } + end next unless selectors diff --git a/src/style_builder.cr b/src/style_builder.cr index 53f0343a7..e87789f5d 100644 --- a/src/style_builder.cr +++ b/src/style_builder.cr @@ -81,7 +81,7 @@ module Mint .sort_by!(&.from) .map do |item| proc = - (Proc(String, String).new { |name| + (Proc(String, String).new do |name| variable = variable_name name, selector @@ -89,7 +89,7 @@ module Mint selector[name].variable = variable variable - }).as(Proc(String, String)?) + end).as(Proc(String, String)?) case item when Ast::If, Ast::Case @@ -161,7 +161,7 @@ module Mint .sort_by!(&.from.offset) .map do |item| proc = - (Proc(String, String).new { |name| + (Proc(String, String).new do |name| variable = variable_name name, selector @@ -169,7 +169,7 @@ module Mint selector[name].variable = variable variable - }).as(Proc(String, String)?) + end).as(Proc(String, String)?) case item when Ast::If, Ast::Case From 2f7b19b00f17072892a876f1ce7dff9bc5f8181e Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 23:26:36 +0100 Subject: [PATCH 10/14] Fix `Lint/UnusedExpression` type of Ameba issues --- src/utils/terminal_snippet.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/terminal_snippet.cr b/src/utils/terminal_snippet.cr index 71e64972f..9894d3b3e 100644 --- a/src/utils/terminal_snippet.cr +++ b/src/utils/terminal_snippet.cr @@ -128,7 +128,7 @@ module Mint item.contents.each_char do |char| break unless char.ascii_whitespace? count += 1 - end || 0 + end count end @@ -149,7 +149,7 @@ module Mint item.contents.each_char do |char| break unless char.ascii_whitespace? count += 1 - end || 0 + end count end From 9bed48ab2dc377129e97970e4368baa5ae9b2f01 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 23:27:05 +0100 Subject: [PATCH 11/14] Fix `Lint/ShadowingOuterLocalVar` type of Ameba issues --- src/exhaustiveness_checker.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exhaustiveness_checker.cr b/src/exhaustiveness_checker.cr index 23e37c470..d524868a5 100644 --- a/src/exhaustiveness_checker.cr +++ b/src/exhaustiveness_checker.cr @@ -799,7 +799,7 @@ module ExhaustivenessChecker .first .columns .map(&.variable) - .max_by { |variable| counts[variable.id]? || 0 } + .max_by { |var| counts[var.id]? || 0 } # We branch on the type name. case type = variable.type From 4a94d091115c6216b4563e1416818d7190a978cf Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 23:33:57 +0100 Subject: [PATCH 12/14] Fix `Style/HeredocIndent` type of Ameba issues --- spec/ast/node_spec.cr | 3 +- spec/installer/repository_spec.cr | 62 +++++++++--------- spec/mint_json_spec.cr | 16 ++--- spec/style_builder_spec.cr | 68 ++++++++++--------- spec/utils/markd_vdom_renderer_spec.cr | 91 +++++++++++++------------- spec_cli/format_spec.cr | 6 +- src/ls/completion_item/component.cr | 26 ++++---- src/ls/completions/type_definition.cr | 4 +- src/scaffold.cr | 3 +- src/type_checker.cr | 3 +- 10 files changed, 137 insertions(+), 145 deletions(-) diff --git a/spec/ast/node_spec.cr b/spec/ast/node_spec.cr index 50349c7ba..ab53e3334 100644 --- a/spec/ast/node_spec.cr +++ b/spec/ast/node_spec.cr @@ -3,8 +3,7 @@ require "../spec_helper" describe Mint::Ast::Node do context "#contains?" do it "checks if the location is contained within the node" do - example = - <<-MINT + example = <<-MINT component Test { fun render : Html {
diff --git a/spec/installer/repository_spec.cr b/spec/installer/repository_spec.cr index e35ff147d..ba5d6d467 100644 --- a/spec/installer/repository_spec.cr +++ b/spec/installer/repository_spec.cr @@ -29,11 +29,11 @@ describe "Repository" do repository = Mint::Installer::Repository.new("name", "success") message = <<-MESSAGE - ░ ERROR (REPOSITORY_NO_MINT_JSON) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░ ERROR (REPOSITORY_NO_MINT_JSON) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - I could not find the mint.json for the package: name (success) for the version - or tag: master - MESSAGE + I could not find the mint.json for the package: name (success) for the version + or tag: master + MESSAGE begin repository.json("master") @@ -48,18 +48,18 @@ describe "Repository" do repository = Mint::Installer::Repository.new("name", "error") message = <<-MESSAGE - ░ ERROR (REPOSITORY_COULD_NOT_GET_VERSIONS) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░ ERROR (REPOSITORY_COULD_NOT_GET_VERSIONS) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - I could not get the tags of the repository: error + I could not get the tags of the repository: error - The error I got from the git command is this: + The error I got from the git command is this: - 0.1.0 - 0.2.0 + 0.1.0 + 0.2.0 - Hint: Run mint tool clean; mint tool clean --package-cache to reset local - state, and then try again. - MESSAGE + Hint: Run mint tool clean; mint tool clean --package-cache to reset local + state, and then try again. + MESSAGE begin repository.versions @@ -73,14 +73,14 @@ describe "Repository" do repository = Mint::Installer::Repository.new("name", "error") message = <<-MESSAGE - ░ ERROR (REPOSITORY_COULD_NOT_CHECKOUT) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░ ERROR (REPOSITORY_COULD_NOT_CHECKOUT) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - I could not checkout the version or tag: master of the repository: error + I could not checkout the version or tag: master of the repository: error - The error I got from the git command is this: + The error I got from the git command is this: - checked out - MESSAGE + checked out + MESSAGE begin repository.checkout("master") @@ -94,17 +94,17 @@ describe "Repository" do FileUtils.rm_rf("#{tmp_dir}/cb5e100e5a9a3e7f6d1fd97512215282") message = <<-MESSAGE - ░ ERROR (REPOSITORY_COULD_NOT_CLONE) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░ ERROR (REPOSITORY_COULD_NOT_CLONE) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - I could not clone the repository: error + I could not clone the repository: error - The error I got from the git command is this: + The error I got from the git command is this: - cloned + cloned - Hint: Run mint tool clean; mint tool clean --package-cache to reset local - state, and then try again. - MESSAGE + Hint: Run mint tool clean; mint tool clean --package-cache to reset local + state, and then try again. + MESSAGE begin Mint::Installer::Repository.open("name", "error") @@ -118,17 +118,17 @@ describe "Repository" do FileUtils.mkdir_p("#{tmp_dir}/cb5e100e5a9a3e7f6d1fd97512215282") message = <<-MESSAGE - ░ ERROR (REPOSITORY_COULD_NOT_UPDATE) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░ ERROR (REPOSITORY_COULD_NOT_UPDATE) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - I could not update the repository: error + I could not update the repository: error - The error I got from the git command is this: + The error I got from the git command is this: - fetched + fetched - Hint: Run mint tool clean; mint tool clean --package-cache to reset local - state, and then try again. - MESSAGE + Hint: Run mint tool clean; mint tool clean --package-cache to reset local + state, and then try again. + MESSAGE begin Mint::Installer::Repository.open("name", "error") diff --git a/spec/mint_json_spec.cr b/spec/mint_json_spec.cr index 0c6dd7171..bdb95476a 100644 --- a/spec/mint_json_spec.cr +++ b/spec/mint_json_spec.cr @@ -25,12 +25,12 @@ it "non existent file" do Mint::MintJson.parse("test.json") rescue error : Mint::Error error.to_terminal.to_s.uncolorize.should eq(<<-TEXT) - ░ ERROR (MINT_JSON_INVALID) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░ ERROR (MINT_JSON_INVALID) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - There was a problem trying to open a mint.json file: test.json + There was a problem trying to open a mint.json file: test.json - Error opening file with mode 'r': 'test.json': No such file or directory - TEXT + Error opening file with mode 'r': 'test.json': No such file or directory + TEXT end end @@ -39,11 +39,11 @@ it "no mint.json in directory or parents" do Mint::MintJson.parse("test.json", search: true) rescue error : Mint::Error error.to_terminal.to_s.uncolorize.should eq(<<-TEXT) - ░ ERROR (MINT_JSON_NOT_FOUND) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░ ERROR (MINT_JSON_NOT_FOUND) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - I could not find a mint.json file in the path or any of its parent directories: + I could not find a mint.json file in the path or any of its parent directories: - test.json - TEXT + test.json + TEXT end end diff --git a/spec/style_builder_spec.cr b/spec/style_builder_spec.cr index 5c02b0b99..7fc01c1a8 100644 --- a/spec/style_builder_spec.cr +++ b/spec/style_builder_spec.cr @@ -2,56 +2,55 @@ require "./spec_helper" describe Mint::StyleBuilder do it "builds simple styles with css prefix" do - example = - <<-MINT - style test { - div, p { - background: red; - - span, strong { - pre { - color: \#{"red"}; - } + example = <<-MINT + style test { + div, p { + background: red; + + span, strong { + pre { + color: \#{"red"}; } + } - span, strong { - pre { - background: white; + span, strong { + pre { + background: white; - @media (screen) { - color: blue; + @media (screen) { + color: blue; - a { - border: 1px solid red; - } + a { + border: 1px solid red; } } } } + } - @media (screen) { - div, p { - font-size: 30px; + @media (screen) { + div, p { + font-size: 30px; - if (true) { - color: red; - } + if (true) { + color: red; } } + } - @media (screen) { - div, p { - color: blue; - } + @media (screen) { + div, p { + color: blue; + } - @media (print) { - div, p { - color: black; - border-radius: \#{10}px; - } + @media (print) { + div, p { + color: black; + border-radius: \#{10}px; } } } + } MINT parser = @@ -68,8 +67,7 @@ describe Mint::StyleBuilder do end it "optimizes class names if optimize is set" do - example = - <<-MINT + example = <<-MINT style test { div { background: red; diff --git a/spec/utils/markd_vdom_renderer_spec.cr b/spec/utils/markd_vdom_renderer_spec.cr index 805d6dae5..8e2fb609b 100644 --- a/spec/utils/markd_vdom_renderer_spec.cr +++ b/spec/utils/markd_vdom_renderer_spec.cr @@ -3,16 +3,15 @@ require "../spec_helper" module Mint class Compiler describe VDOMRenderer do - html_block = - <<-HTML - - - - -
- hi -
- HTML + html_block = <<-HTML + + + + +
+ hi +
+ HTML [ {"**strong**", "A('p', {}, [A('strong', {}, [`strong`])])"}, @@ -32,66 +31,66 @@ module Mint { "foo\nbaz", <<-TEXT - A('p', {}, [ - `foo`, - `\n`, - `baz` - ]) - TEXT + A('p', {}, [ + `foo`, + `\n`, + `baz` + ]) + TEXT }, { "foo\\\nbar", <<-TEXT - A('p', {}, [ - `foo`, - A('br', {}, []), - `bar` - ]) - TEXT + A('p', {}, [ + `foo`, + A('br', {}, []), + `bar` + ]) + TEXT }, { "```html\ncode\n```", <<-TEXT - A('pre', {}, [A('code', { - class: "language-html" - }, [`code`])]) - TEXT + A('pre', {}, [A('code', { + class: "language-html" + }, [`code`])]) + TEXT }, { "* item 1\n* item 2", <<-TEXT - A('ul', {}, [ - A('li', {}, [`item 1`]), - A('li', {}, [`item 2`]) - ]) - TEXT + A('ul', {}, [ + A('li', {}, [`item 1`]), + A('li', {}, [`item 2`]) + ]) + TEXT }, { "[link](url)", <<-TEXT - A('p', {}, [A('a', { - href: "url" - }, [`link`])]) - TEXT + A('p', {}, [A('a', { + href: "url" + }, [`link`])]) + TEXT }, { "![alt](url)", <<-TEXT - A('p', {}, [A('img', { - src: "url", - alt: "alt" - }, [])]) - TEXT + A('p', {}, [A('img', { + src: "url", + alt: "alt" + }, [])]) + TEXT }, { "*foo*", <<-TEXT - A('p', {}, [ - ``, - A('em', {}, [`foo`]), - `` - ]) - TEXT + A('p', {}, [ + ``, + A('em', {}, [`foo`]), + `` + ]) + TEXT }, ].each do |(markdown, expected)| context markdown do diff --git a/spec_cli/format_spec.cr b/spec_cli/format_spec.cr index 5cc13f15f..dfcec274b 100644 --- a/spec_cli/format_spec.cr +++ b/spec_cli/format_spec.cr @@ -9,15 +9,13 @@ context "format" do FileUtils.rm_rf "source.mint" end - formatted_code = - <<-MINT + formatted_code = <<-MINT type Test { file : String } MINT - unformatted_code = - <<-MINT + unformatted_code = <<-MINT typeTest{file:String} MINT diff --git a/src/ls/completion_item/component.cr b/src/ls/completion_item/component.cr index a760d37cd..fe40416bc 100644 --- a/src/ls/completion_item/component.cr +++ b/src/ls/completion_item/component.cr @@ -44,23 +44,23 @@ module Mint case attributes.size when .> 3 <<-MINT - <#{node.name.value} - #{attributes.join("\n ")}> - $0 - - MINT + <#{node.name.value} + #{attributes.join("\n ")}> + $0 + + MINT when .> 0 <<-MINT - <#{node.name.value} #{attributes.join(" ")}> - $0 - - MINT + <#{node.name.value} #{attributes.join(" ")}> + $0 + + MINT else <<-MINT - <#{node.name.value}> - $0 - - MINT + <#{node.name.value}> + $0 + + MINT end LSP::CompletionItem.new( diff --git a/src/ls/completions/type_definition.cr b/src/ls/completions/type_definition.cr index e5048facd..83806bba2 100644 --- a/src/ls/completions/type_definition.cr +++ b/src/ls/completions/type_definition.cr @@ -25,8 +25,8 @@ module Mint end <<-MINT - #{name}(#{parameters.join(", ")}) - MINT + #{name}(#{parameters.join(", ")}) + MINT end LSP::CompletionItem.new( diff --git a/src/scaffold.cr b/src/scaffold.cr index e39529716..092d26e37 100644 --- a/src/scaffold.cr +++ b/src/scaffold.cr @@ -27,8 +27,7 @@ module Mint # Writes the files of the project. private def write_files if bare? - main = - <<-MAIN + main = <<-MAIN component Main { fun render : Html { <> diff --git a/src/type_checker.cr b/src/type_checker.cr index 8309d1b62..5e957deba 100644 --- a/src/type_checker.cr +++ b/src/type_checker.cr @@ -136,8 +136,7 @@ module Mint "#{key} : #{value.to_mint}" end.indent - contents = - <<-MINT + contents = <<-MINT type #{name} { #{compiled_fields} } From 94b14e701565d114860a5fed8cfe32c2515606e5 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 18 Nov 2025 23:36:05 +0100 Subject: [PATCH 13/14] Fix `Style/HeredocEscape` type of Ameba issues --- spec/style_builder_spec.cr | 6 +++--- spec_cli/tool/highlight_spec.cr | 36 ++++++++++++++++----------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/spec/style_builder_spec.cr b/spec/style_builder_spec.cr index 7fc01c1a8..405f9d841 100644 --- a/spec/style_builder_spec.cr +++ b/spec/style_builder_spec.cr @@ -2,14 +2,14 @@ require "./spec_helper" describe Mint::StyleBuilder do it "builds simple styles with css prefix" do - example = <<-MINT + example = <<-'MINT' style test { div, p { background: red; span, strong { pre { - color: \#{"red"}; + color: #{"red"}; } } @@ -46,7 +46,7 @@ describe Mint::StyleBuilder do @media (print) { div, p { color: black; - border-radius: \#{10}px; + border-radius: #{10}px; } } } diff --git a/spec_cli/tool/highlight_spec.cr b/spec_cli/tool/highlight_spec.cr index 00b345460..d4d3f842e 100644 --- a/spec_cli/tool/highlight_spec.cr +++ b/spec_cli/tool/highlight_spec.cr @@ -29,17 +29,17 @@ context "highlight" do end it "highlights file" do - expect_output ["tool", "highlight", "source/Main.mint"], <<-TEXT + expect_output ["tool", "highlight", "source/Main.mint"], <<-'MINT' // This is the component which gets rendered on the screen component Main { // Styles for the root element. style root { - background-image: url(\#{@asset(../assets/bottom-left.png)}), - url(\#{@asset(../assets/bottom-center.png)}), - url(\#{@asset(../assets/bottom-right.png)}), - url(\#{@asset(../assets/top-left.png)}), - url(\#{@asset(../assets/top-center.png)}), - url(\#{@asset(../assets/top-right.png)}); + background-image: url(#{@asset(../assets/bottom-left.png)}), + url(#{@asset(../assets/bottom-center.png)}), + url(#{@asset(../assets/bottom-right.png)}), + url(#{@asset(../assets/top-left.png)}), + url(#{@asset(../assets/top-center.png)}), + url(#{@asset(../assets/top-right.png)}); background-position: calc(100% + 15px) 100%, 50% 100%, -20px 100%, -20px 0, 50% 0, calc(100% + 15px) 0; @@ -105,27 +105,27 @@ context "highlight" do @svg(../assets/logo.svg) - "2018 - \#{Time.year(Time.now())}" + "2018 - #{Time.year(Time.now())}" } } - TEXT + MINT end it "highlights file (html)" do - expect_output ["tool", "highlight", "source/Main.mint", "--html"], <<-TEXT + expect_output ["tool", "highlight", "source/Main.mint", "--html"], <<-'MINT' // This is the component which gets rendered on the screen component Main { // Styles for the root element. style root { - background-image: url(\#{@asset(../assets/bottom-left.png)}), - url(\#{@asset(../assets/bottom-center.png)}), - url(\#{@asset(../assets/bottom-right.png)}), - url(\#{@asset(../assets/top-left.png)}), - url(\#{@asset(../assets/top-center.png)}), - url(\#{@asset(../assets/top-right.png)}); + background-image: url(#{@asset(../assets/bottom-left.png)}), + url(#{@asset(../assets/bottom-center.png)}), + url(#{@asset(../assets/bottom-right.png)}), + url(#{@asset(../assets/top-left.png)}), + url(#{@asset(../assets/top-center.png)}), + url(#{@asset(../assets/top-right.png)}); background-position: calc(100% + 15px) 100%, 50% 100%, -20px 100%, -20px 0, 50% 0, calc(100% + 15px) 0; @@ -191,13 +191,13 @@ context "highlight" do <div::footer> @svg(../assets/logo.svg) - <small>"2018 - \#{Time.year(Time.now())}"</small> + <small>"2018 - #{Time.year(Time.now())}"</small> </div> </div> </div> } } - TEXT + MINT end it "missing file" do From 70d3cd8c74f7d119fd4fc6a72a89e9b14bcf6d09 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Wed, 19 Nov 2025 05:40:29 +0100 Subject: [PATCH 14/14] Fix `Lint/Typos` type of Ameba issues --- README.md | 2 +- core/source/File.mint | 2 +- core/source/Http.mint | 2 +- core/source/MutationObserver.mint | 2 +- core/source/Provider/Shortcuts.mint | 2 +- core/source/ResizeObserver.mint | 2 +- core/source/Storage/Common.mint | 2 +- runtime/src/decoders.js | 4 ++-- runtime/tests/debug.test.js | 2 +- runtime/tests/variant.test.js | 2 +- .../compilers/{css_with_ands => css_with_and} | 0 spec/errors/call_with_mixed_arguments | 2 +- spec/errors/component_multiple_providers | 2 +- ...ied => property_children_default_required} | 2 +- spec/errors/property_with_type_variables | 2 +- ...xpeceted_colon => provider_expected_colon} | 6 ++--- spec/errors/recursion | 4 ++-- .../{unkown_builtin => unknown_builtin} | 6 ++--- spec/examples/builtin | 2 +- spec/examples/provider | 2 +- spec/examples/type_definition | 4 ++-- spec/examples_spec.cr | 6 ++--- ...rpolation => js_with_double_interpolation} | 0 spec/formatters/record_destructuring | 4 ++-- .../string_literal_split_with_interpolation | 4 ++-- spec/mint_json/dependency_constraint_invalid | 2 +- spec/mint_json/dependency_repository_invalid | 2 +- spec_cli/init_spec.cr | 2 +- src/ast/html_style.cr | 2 +- src/bundler.cr | 4 ++-- src/commands/init.cr | 2 +- src/compiler.cr | 6 ++--- src/compiler/decoder.cr | 2 +- src/compiler/js.cr | 2 +- src/compiler/renderer.cr | 4 ++-- src/compilers/decode.cr | 2 +- src/debugger.cr | 4 ++-- src/documentation_generator.cr | 4 ++-- src/exhaustiveness_checker.cr | 4 ++-- src/ext/libxml.cr | 2 +- src/formatter.cr | 22 +++++++++---------- src/helpers.cr | 2 +- src/ls/websocket_server.cr | 2 +- src/mint_json/dependencies.cr | 4 ++-- src/parser.cr | 2 +- src/parsers/base_expression.cr | 2 +- src/parsers/provider.cr | 2 +- src/scope.cr | 4 ++-- src/type_checker.cr | 2 +- src/type_checkers/builtin.cr | 2 +- src/type_checkers/call.cr | 2 +- src/type_checkers/component.cr | 2 +- src/type_checkers/if.cr | 2 +- src/type_checkers/property.cr | 2 +- src/type_checkers/type_definition.cr | 2 +- src/utils/markd_vdom_renderer.cr | 2 +- src/utils/watcher.cr | 2 +- src/workspace.cr | 2 +- 58 files changed, 86 insertions(+), 86 deletions(-) rename spec/compilers/{css_with_ands => css_with_and} (100%) rename spec/errors/{property_children_default_requried => property_children_default_required} (94%) rename spec/errors/{provider_expeceted_colon => provider_expected_colon} (51%) rename spec/errors/{unkown_builtin => unknown_builtin} (62%) rename spec/formatters/{js_with_duble_interpolation => js_with_double_interpolation} (100%) diff --git a/README.md b/README.md index 20dcaddf3..d50ac7334 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Here are some bigger projects built and maintained by us that showcases the lang - [Mint Realworld](https://github.com/mint-lang/mint-realworld) - The frontend implementation of the Realworld app. - [Mint UI](https://github.com/mint-lang/mint-ui) - A UI library written in Mint. - [Mint UI Website](https://github.com/mint-lang/mint-ui-website) - The website for Mint UI. -- _Your Project_ - let us know if you writter something amazing with Mint and would like to showcase here! +- _Your Project_ - let us know if you've written something amazing with Mint and would like to showcase here! ## 👥  Community diff --git a/core/source/File.mint b/core/source/File.mint index faa0525cb..2dffe49f0 100644 --- a/core/source/File.mint +++ b/core/source/File.mint @@ -217,7 +217,7 @@ module File { */ fun fromUrl (url : String) : Promise(Maybe(File)) { let filename = - Array.last(String.split(Url.parse(url).path, "/")) or "unkown" + Array.last(String.split(Url.parse(url).path, "/")) or "unknown" ` (async () => { diff --git a/core/source/Http.mint b/core/source/Http.mint index 095552efc..b1d85a946 100644 --- a/core/source/Http.mint +++ b/core/source/Http.mint @@ -164,7 +164,7 @@ store Http { } /* - Checks the prescence of a header with the key. + Checks the presence of a header with the key. Http.empty() |> Http.header("Content-Type", "application/json") diff --git a/core/source/MutationObserver.mint b/core/source/MutationObserver.mint index 40d8faabd..515ccd5b9 100644 --- a/core/source/MutationObserver.mint +++ b/core/source/MutationObserver.mint @@ -1,4 +1,4 @@ -/* A data structure for the mutation obeservers entry. */ +/* A data structure for the mutation observers entry. */ type MutationObserver.Entry { target : Dom.Element, type : String diff --git a/core/source/Provider/Shortcuts.mint b/core/source/Provider/Shortcuts.mint index deb910ad6..33aa4051a 100644 --- a/core/source/Provider/Shortcuts.mint +++ b/core/source/Provider/Shortcuts.mint @@ -27,7 +27,7 @@ component Main { shortcuts: [ { - action: () { Window.alert("Shotcut pressed!") }, + action: () { Window.alert("Shortcut pressed!") }, shortcut: [Html.Event.CTRL, Html.Event.G], condition: () { true }, bypassFocused: false diff --git a/core/source/ResizeObserver.mint b/core/source/ResizeObserver.mint index 750179487..cab85970a 100644 --- a/core/source/ResizeObserver.mint +++ b/core/source/ResizeObserver.mint @@ -1,4 +1,4 @@ -/* A data structure for the resize obeservers entry. */ +/* A data structure for the resize observers entry. */ type ResizeObserver.Entry { dimensions : Dom.Dimensions, target : Dom.Element diff --git a/core/source/Storage/Common.mint b/core/source/Storage/Common.mint index db0207f81..18f5882f8 100644 --- a/core/source/Storage/Common.mint +++ b/core/source/Storage/Common.mint @@ -83,7 +83,7 @@ module Storage.Common { ` } - /* Returns alll the keys in the storage. */ + /* Returns all the keys in the storage. */ fun keys (storage : Storage) : Result(Storage.Error, Array(String)) { ` (() => { diff --git a/runtime/src/decoders.js b/runtime/src/decoders.js index f5ca4771c..1a45e03f2 100644 --- a/runtime/src/decoders.js +++ b/runtime/src/decoders.js @@ -13,7 +13,7 @@ const format = (value) => { }; // A class to keep the errors when decoding. It keeps track of the path -// to the nested objects for reporting purpuses. +// to the nested objects for reporting purposes. export class Error { constructor(message, path = []) { this.message = message; @@ -150,7 +150,7 @@ export const decodeString = (ok, err) => (input) => { }; // Decodes `Time` either a UNIX timestamp or any values that the -// environment can parse with the `Date` construtor. +// environment can parse with the `Date` constructor. export const decodeTime = (ok, err) => (input) => { let parsed = NaN; diff --git a/runtime/tests/debug.test.js b/runtime/tests/debug.test.js index 2d8970b82..e22537897 100644 --- a/runtime/tests/debug.test.js +++ b/runtime/tests/debug.test.js @@ -67,7 +67,7 @@ test("inspecting array", () => { expect(inspect(["Hello", "World!"])).toBe(`["Hello", "World!"]`); }); -test("inspecting unkown", () => { +test("inspecting unknown", () => { expect(inspect(Symbol("WTF"))).toBe(`{ Symbol(WTF) }`); }); diff --git a/runtime/tests/variant.test.js b/runtime/tests/variant.test.js index b85f5c23d..2710e609f 100644 --- a/runtime/tests/variant.test.js +++ b/runtime/tests/variant.test.js @@ -6,7 +6,7 @@ const TestEnum2 = variant(2); const TestEnum = variant(0); describe("equality", () => { - test("same intance equals true", () => { + test("same instance equals true", () => { expect(compare(new TestEnum(), new TestEnum())).toEqual(true); }); diff --git a/spec/compilers/css_with_ands b/spec/compilers/css_with_and similarity index 100% rename from spec/compilers/css_with_ands rename to spec/compilers/css_with_and diff --git a/spec/errors/call_with_mixed_arguments b/spec/errors/call_with_mixed_arguments index dc1822cd4..aafa9eb9f 100644 --- a/spec/errors/call_with_mixed_arguments +++ b/spec/errors/call_with_mixed_arguments @@ -10,7 +10,7 @@ component Main { -------------------------------------------------------------------------------- ░ ERROR (CALL_WITH_MIXED_ARGUMENTS) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ -A call cannot have named and unamed arguments at the same time because in +A call cannot have named and unnamed arguments at the same time because in specific cases I cannot pair the arguments with the values. The call in question is here: diff --git a/spec/errors/component_multiple_providers b/spec/errors/component_multiple_providers index 35765a203..863da730b 100644 --- a/spec/errors/component_multiple_providers +++ b/spec/errors/component_multiple_providers @@ -9,7 +9,7 @@ component Main { -------------------------------------------------------------------------------- ░ ERROR (COMPONENT_MULTIPLE_PROVIDERS) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ -You are subcribing to the provider "Provider" in a component multiple times. +You are subscribing to the provider "Provider" in a component multiple times. A subscription is here: diff --git a/spec/errors/property_children_default_requried b/spec/errors/property_children_default_required similarity index 94% rename from spec/errors/property_children_default_requried rename to spec/errors/property_children_default_required index c506da5de..3a57af65d 100644 --- a/spec/errors/property_children_default_requried +++ b/spec/errors/property_children_default_required @@ -20,7 +20,7 @@ There should be a default value for the children property: The property in question is here: - ┌ errors/property_children_default_requried:2:3 + ┌ errors/property_children_default_required:2:3 ├────────────────────────────────────────────── 1│ component Test { 2│ property children : Array(Html) diff --git a/spec/errors/property_with_type_variables b/spec/errors/property_with_type_variables index 748f047ae..40ca73e1b 100644 --- a/spec/errors/property_with_type_variables +++ b/spec/errors/property_with_type_variables @@ -20,7 +20,7 @@ component Main { ░ ERROR (PROPERTY_WITH_TYPE_VARIABLES) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ The type of a property contains type variables. Type variables in properties are -not allow at this time since that would make the compoennt generic and it is not +not allow at this time since that would make the component generic and it is not supported this time. The type is: diff --git a/spec/errors/provider_expeceted_colon b/spec/errors/provider_expected_colon similarity index 51% rename from spec/errors/provider_expeceted_colon rename to spec/errors/provider_expected_colon index de2abb5c8..213a9ebdd 100644 --- a/spec/errors/provider_expeceted_colon +++ b/spec/errors/provider_expected_colon @@ -1,10 +1,10 @@ provider Test -------------------------------------------------------------------------------- -░ ERROR (PROVIDER_EXPECETED_COLON) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +░ ERROR (PROVIDER_EXPECTED_COLON) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ I was expecting the colon of a provider but I found "a space" instead: - ┌ errors/provider_expeceted_colon:1:13 - ├───────────────────────────────────── + ┌ errors/provider_expected_colon:1:13 + ├──────────────────────────────────── 1│ provider Test │ ⌃⌃⌃⌃ diff --git a/spec/errors/recursion b/spec/errors/recursion index 70c98a50f..efb5fab24 100644 --- a/spec/errors/recursion +++ b/spec/errors/recursion @@ -14,8 +14,8 @@ component Main { -------------------------------------------------------------------------------- ░ ERROR (RECURSION) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ -Recursion is only supported in specific cases at this time. Unfortunatly here is -not supported: +Recursion is only supported in specific cases at this time. Unfortunately here +is not supported: ┌ errors/recursion:2:3 ├──────────────────────────────────────── diff --git a/spec/errors/unkown_builtin b/spec/errors/unknown_builtin similarity index 62% rename from spec/errors/unkown_builtin rename to spec/errors/unknown_builtin index 914c982ee..44245b19a 100644 --- a/spec/errors/unkown_builtin +++ b/spec/errors/unknown_builtin @@ -6,12 +6,12 @@ component Main { } } -------------------------------------------------------------------------------- -░ ERROR (UNKOWN_BUILTIN) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +░ ERROR (UNKNOWN_BUILTIN) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ There is no builtin with the name: wtf - ┌ errors/unkown_builtin:3:8 - ├────────────────────────── + ┌ errors/unknown_builtin:3:8 + ├─────────────────────────── 1│ component Main { 2│ fun render : Html { 3│ `#{%wtf%}` diff --git a/spec/examples/builtin b/spec/examples/builtin index 81ea9a5cc..7afb6d9bc 100644 --- a/spec/examples/builtin +++ b/spec/examples/builtin @@ -5,7 +5,7 @@ component Main {
} } -------------------------------------------------------------------unkown_builtin +----------------------------------------------------------------unknown_builtin component Main { fun render : Html { `#{%wtf%}` diff --git a/spec/examples/provider b/spec/examples/provider index 454c2c8e3..b8f98f49a 100644 --- a/spec/examples/provider +++ b/spec/examples/provider @@ -1,6 +1,6 @@ ---------------------------------------------------------provider_expected_name provider --------------------------------------------------------provider_expeceted_colon +--------------------------------------------------------provider_expected_colon provider Test -------------------------------------------------provider_expected_subscription provider Test : diff --git a/spec/examples/type_definition b/spec/examples/type_definition index 0a0603223..35f7722d3 100644 --- a/spec/examples/type_definition +++ b/spec/examples/type_definition @@ -50,14 +50,14 @@ type User { LoggedIn Guest } context User.Guest -------------------------------------------------type_defintion_context_mismatch +-----------------------------------------------type_definition_context_mismatch type User { name: String using "name", id: String } context { x: "Y" } -------------------------------------------------type_defintion_context_mismatch +-----------------------------------------------type_definition_context_mismatch type User { A } context { diff --git a/spec/examples_spec.cr b/spec/examples_spec.cr index 0a024dd97..c164cf0d1 100644 --- a/spec/examples_spec.cr +++ b/spec/examples_spec.cr @@ -4,9 +4,9 @@ path = "./spec/examples/**/*" example = nil ENV["EXAMPLE"]?.try do |item| - splitted = item.split(':', 2) - path = splitted[0] - example = splitted[1]? + split = item.split(':', 2) + path = split[0] + example = split[1]? end Dir diff --git a/spec/formatters/js_with_duble_interpolation b/spec/formatters/js_with_double_interpolation similarity index 100% rename from spec/formatters/js_with_duble_interpolation rename to spec/formatters/js_with_double_interpolation diff --git a/spec/formatters/record_destructuring b/spec/formatters/record_destructuring index e4bb86f10..a488c105f 100644 --- a/spec/formatters/record_destructuring +++ b/spec/formatters/record_destructuring @@ -10,7 +10,7 @@ module Test { case item { { name: name, age: 42 } => name - => "Unkown" + => "Unknown" } } } @@ -27,7 +27,7 @@ module Test { case item { { name: name, age: 42 } => name - => "Unkown" + => "Unknown" } } } diff --git a/spec/formatters/string_literal_split_with_interpolation b/spec/formatters/string_literal_split_with_interpolation index 79d4d1bc9..09aaefd0d 100644 --- a/spec/formatters/string_literal_split_with_interpolation +++ b/spec/formatters/string_literal_split_with_interpolation @@ -1,12 +1,12 @@ module A { fun test : String { - "Lorem ipsum dolor sit amet, consectetur adipiscing #{"WHAAT"} elit." \ " Donec pulvinar bibendum convallis. Sed malesuada commodo felis quis accumsan. Pellentesque lacinia sagittis vestibulum. Mauris aliquam a ante vel fermentum. Quisque sed consectetur elit. Donec sagittis, leo id tempus feugiat, leo ligula sollicitudin nisl, quis facilisis lorem tellus sit amet mi. Nullam vel nulla eu felis iaculis tincidunt. Nulla volutpat lorem sollicitudin finibus auctor." + "Lorem ipsum dolor sit amet, consectetur adipiscing #{"WHAT"} elit." \ " Donec pulvinar bibendum convallis. Sed malesuada commodo felis quis accumsan. Pellentesque lacinia sagittis vestibulum. Mauris aliquam a ante vel fermentum. Quisque sed consectetur elit. Donec sagittis, leo id tempus feugiat, leo ligula sollicitudin nisl, quis facilisis lorem tellus sit amet mi. Nullam vel nulla eu felis iaculis tincidunt. Nulla volutpat lorem sollicitudin finibus auctor." } } -------------------------------------------------------------------------------- module A { fun test : String { - "Lorem ipsum dolor sit amet, consectetur adipiscing #{"WHAAT"} elit. " \ + "Lorem ipsum dolor sit amet, consectetur adipiscing #{"WHAT"} elit. " \ "Donec pulvinar bibendum convallis. Sed malesuada commodo felis quis " \ "accumsan. Pellentesque lacinia sagittis vestibulum. Mauris aliquam a " \ "ante vel fermentum. Quisque sed consectetur elit. Donec sagittis, leo " \ diff --git a/spec/mint_json/dependency_constraint_invalid b/spec/mint_json/dependency_constraint_invalid index 32d2cee9a..5e38d2522 100644 --- a/spec/mint_json/dependency_constraint_invalid +++ b/spec/mint_json/dependency_constraint_invalid @@ -9,7 +9,7 @@ -------------------------------------------------------------------------------- ░ ERROR (DEPENDENCY_CONSTRAINT_INVALID) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ -The constraint field of a depencency must be an string, but it's not: +The constraint field of a dependency must be an string, but it's not: ┌ spec/fixtures/mint.json:5:21 ├───────────────────────────── diff --git a/spec/mint_json/dependency_repository_invalid b/spec/mint_json/dependency_repository_invalid index 8b3347c30..95dbc88e3 100644 --- a/spec/mint_json/dependency_repository_invalid +++ b/spec/mint_json/dependency_repository_invalid @@ -8,7 +8,7 @@ -------------------------------------------------------------------------------- ░ ERROR (DEPENDENCY_REPOSITORY_INVALID) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ -The repository field of a depencency must be an string, but it's not: +The repository field of a dependency must be an string, but it's not: ┌ spec/fixtures/mint.json:4:21 ├───────────────────────────── diff --git a/spec_cli/init_spec.cr b/spec_cli/init_spec.cr index 7f1d40c1c..327808b6b 100644 --- a/spec_cli/init_spec.cr +++ b/spec_cli/init_spec.cr @@ -17,7 +17,7 @@ context "init" do Initializes a new project. Flags: - --bare # If speficied, an empty project will be generated. + --bare # If specified, an empty project will be generated. --help # Displays help for the current command. Arguments: diff --git a/src/ast/html_style.cr b/src/ast/html_style.cr index eee62f36d..8fb849018 100644 --- a/src/ast/html_style.cr +++ b/src/ast/html_style.cr @@ -12,7 +12,7 @@ module Mint @name : Variable) end - # NOTE: This is here to provide compatiblity for calls (functions)... + # NOTE: This is here to provide compatibility for calls (functions)... def await nil end diff --git a/src/bundler.cr b/src/bundler.cr index b99fe9999..9978ddd39 100644 --- a/src/bundler.cr +++ b/src/bundler.cr @@ -70,7 +70,7 @@ module Mint tests = if test_information = config.test - # Compile tests if there is configration for it. + # Compile tests if there is configuration for it. Logger.log "Compiling tests" do [ compiler.test(**test_information), @@ -200,7 +200,7 @@ module Mint if contents.empty? [] of Compiler::Compiled else - # Here we sort the compiled node by the order they are resovled, which + # Here we sort the compiled node by the order they are resolved, which # will prevent issues of one entity depending on others (like a const # depending on a function from a module). contents.sort_by! do |(node, id, _)| diff --git a/src/commands/init.cr b/src/commands/init.cr index 0078b15a5..6f9afa0da 100644 --- a/src/commands/init.cr +++ b/src/commands/init.cr @@ -6,7 +6,7 @@ module Mint define_help description: "Initializes a new project." define_flag bare : Bool, - description: "If speficied, an empty project will be generated.", + description: "If specified, an empty project will be generated.", default: false define_argument name, diff --git a/src/compiler.cr b/src/compiler.cr index 4c7010309..0ba0b8a2e 100644 --- a/src/compiler.cr +++ b/src/compiler.cr @@ -9,20 +9,20 @@ module Mint Variable | Encoder | Decoder | Asset | Deferred | ContextProvider - # Represents an generated idetifier from the parts of the union type. + # Represents an generated identifier from the parts of the union type. alias Id = Ast::Node | Variable | Encoder | Decoder | Record | Context | Size # Represents compiled code. alias Compiled = Array(Item) - # Represents entites which are used in a program. + # Represents entities which are used in a program. alias Used = Set(Ast::Node | Encoder | Decoder | Record | Builtin | Context) # Represents an reference to a deferred file record Deferred, value : Ast::Node # Represents a Preact signal (https://preactjs.com/guide/v10/signals/). Signals are treated - # differently from vaiables because we will need to access them using the `.value` accessor. + # differently from variables because we will need to access them using the `.value` accessor. record Signal, value : Ast::Node | Size # Represents an reference to a file diff --git a/src/compiler/decoder.cr b/src/compiler/decoder.cr index 6e00ab1f2..5706da99c 100644 --- a/src/compiler/decoder.cr +++ b/src/compiler/decoder.cr @@ -138,7 +138,7 @@ module Mint if found = substitutions[type.name]? found else - unreachable! "Cannot find substition for variable: #{type.name}" + unreachable! "Cannot find substitution for variable: #{type.name}" end end end diff --git a/src/compiler/js.cr b/src/compiler/js.cr index 4df5bd5c3..117ec0c6a 100644 --- a/src/compiler/js.cr +++ b/src/compiler/js.cr @@ -1,6 +1,6 @@ module Mint class Compiler - # This class is resposible for creating a tree of JS code. + # This class is responsible for creating a tree of JS code. class Js # Whether or not to optimize the output. getter? optimize : Bool = false diff --git a/src/compiler/renderer.cr b/src/compiler/renderer.cr index 6f06a085a..32e81dee5 100644 --- a/src/compiler/renderer.cr +++ b/src/compiler/renderer.cr @@ -11,7 +11,7 @@ module Mint # The bundles which we use to get their filename. getter bundles : Hash(Set(Ast::Node) | Bundle, Set(Ast::Node)) - # A method to get the deffered path of a bundle. + # A method to get the deferred path of a bundle. getter deferred_path : Proc(Set(Ast::Node) | Bundle, String) # A method to get the path of an asset. @@ -125,7 +125,7 @@ module Mint in Function render(item.value, io) in Signal - # Signals are special becuse we need to use the `.value` accessor. + # Signals are special because we need to use the `.value` accessor. append(io, "#{pool.of(item.value, base)}.value") in Size append(io, pool.of(item, base)) diff --git a/src/compilers/decode.cr b/src/compilers/decode.cr index 1073a8e3b..3642961a5 100644 --- a/src/compilers/decode.cr +++ b/src/compilers/decode.cr @@ -12,7 +12,7 @@ module Mint when "Result" type.parameters.last else - unreachable! "Unkown decoder for type: #{type.name}!" + unreachable! "Unknown decoder for type: #{type.name}!" end code = diff --git a/src/debugger.cr b/src/debugger.cr index 6c2c316e2..e920f331f 100644 --- a/src/debugger.cr +++ b/src/debugger.cr @@ -44,7 +44,7 @@ module Mint when Ast::Variable "#{name}(#{x.value})" when Ast::Function, Ast::Constant, Ast::Get, Ast::State, Ast::Property - pn = + on = case y = x.parent when Ast::Component, Ast::Module, Ast::Store, Ast::Provider y.name.value @@ -52,7 +52,7 @@ module Mint "" end - "#{pn}.#{x.name.value}" + "#{on}.#{x.name.value}" else name end diff --git a/src/documentation_generator.cr b/src/documentation_generator.cr index bc3972e75..83b8396ad 100644 --- a/src/documentation_generator.cr +++ b/src/documentation_generator.cr @@ -1,6 +1,6 @@ module Mint - # This module contains funcions for generating JSON compatible - # API documentation of souce code. It uses a unfified sutructure for + # This module contains functions for generating JSON compatible + # API documentation of source code. It uses a unfified sutructure for # entities and top-level entities. # # It is used in two places currently: diff --git a/src/exhaustiveness_checker.cr b/src/exhaustiveness_checker.cr index d524868a5..9c22b2e41 100644 --- a/src/exhaustiveness_checker.cr +++ b/src/exhaustiveness_checker.cr @@ -71,7 +71,7 @@ module ExhaustivenessChecker # DECISION ------------------------------------------------------------------- # - # These are the possible values of leafs and the final match: + # These are the possible values of leaves and the final match: # # DSuccess - The pattern matched successfully, no missing or unused patterns. # DFailure - The pattern cannot be matched. @@ -156,7 +156,7 @@ module ExhaustivenessChecker # that variable. A row may contain multiple columns, though this wouldn't be # exposed to the source language (it's an implementation detail) # - # `x` is the varaible, `Just(a)` is the pattern: + # `x` is the variable, `Just(a)` is the pattern: # # case x { # Just(a) => ... diff --git a/src/ext/libxml.cr b/src/ext/libxml.cr index 3cab8159f..2a9bcdbf6 100644 --- a/src/ext/libxml.cr +++ b/src/ext/libxml.cr @@ -1,4 +1,4 @@ -# These add support for writing raw text when builing XML. +# These add support for writing raw text when building XML. lib LibXML fun xmlTextWriterWriteRaw(TextWriter, content : UInt8*) : Int end diff --git a/src/formatter.cr b/src/formatter.cr index 197750681..ff0b6e753 100644 --- a/src/formatter.cr +++ b/src/formatter.cr @@ -35,9 +35,9 @@ module Mint record NestedString, items : Array(String | Nodes), indentation : Int32 # Describes a broken string ("Hello" \ "There") and contains logic to - # break the string just so that it fits with the maxmimum column length. - # It tries to break by words but will break words that doens't fit in the - # remaning column width. + # break the string just so that it fits with the maximum column length. + # It tries to break by words but will break words that doesn't fit in the + # remaining column width. record BrokenString, items : Array(String | Nodes) # Describes a list that is formatted like so: @@ -56,22 +56,22 @@ module Mint # # `BreakAll`: # - # - If the whole group fits in the remaning space in the line (current + # - If the whole group fits in the remaining space in the line (current # cursor position plus the size of the group) it will use a space as a - # delimeter. + # delimiter. # - # - Otherwise the delimeter will include a line-break and the nodes will be - # layed out in separate lines indented by an extra level. The start + # - Otherwise the delimiter will include a line-break and the nodes will be + # laid out in separate lines indented by an extra level. The start # character is on the original line and the end character in it's own # extra line. # # `BreakNotFits`: # - # - If the whole group fits in the remaning space in the line (current + # - If the whole group fits in the remaining space in the line (current # cursor position plus the size of the group) it will use a space as a - # delimeter. + # delimiter. # - # - Otherwise the elements that would not extend beyong the current line + # - Otherwise the elements that would not extend beyond the current line # are broken down into a new indented line and so forth... # # `Block`: @@ -136,7 +136,7 @@ module Mint [Group.new(**params)] of Node end - # Actuall formatting things as strings... + # Actually formatting things as strings... def format!(*args, **named) : String Renderer.render(format(*args, **named), config) diff --git a/src/helpers.cr b/src/helpers.cr index b1ce6ae56..d9b16e4c0 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -1,6 +1,6 @@ module Mint # This module contains helper functions which are used in many parts of the - # process (parser, compiler, type checker, ect...). + # process (parser, compiler, type checker, etc...). module Helpers def owns?(node : Ast::Node, parent : Ast::Node) : Bool case parent diff --git a/src/ls/websocket_server.cr b/src/ls/websocket_server.cr index bc29d7c5d..767bd6954 100644 --- a/src/ls/websocket_server.cr +++ b/src/ls/websocket_server.cr @@ -3,7 +3,7 @@ module Mint # A server to use the LSP over websockets. class WebSocketServer < Server def initialize(@socket : HTTP::WebSocket, sandbox : Bool = false) - # We need these for compability with the server, they are not used. + # We need these for compatibility with the server, they are not used. @out = IO::Memory.new @in = IO::Memory.new diff --git a/src/mint_json/dependencies.cr b/src/mint_json/dependencies.cr index d549c0c9f..d21afdca0 100644 --- a/src/mint_json/dependencies.cr +++ b/src/mint_json/dependencies.cr @@ -94,7 +94,7 @@ module Mint block do text "The" bold "repository" - text "field of a depencency must be an string, but it's not:" + text "field of a dependency must be an string, but it's not:" end snippet snippet_data @@ -151,7 +151,7 @@ module Mint block do text "The" bold "constraint" - text "field of a depencency must be an string, but it's not:" + text "field of a dependency must be an string, but it's not:" end snippet snippet_data diff --git a/src/parser.cr b/src/parser.cr index b02ebdb87..ce5d3c9bc 100644 --- a/src/parser.cr +++ b/src/parser.cr @@ -280,7 +280,7 @@ module Mint loop do # Using parse here will not consume the whitespace if - # the parsing is not successfull. + # the parsing is not successful. item = parse(track: false) do # Consume whitespace whitespace if parse_whitespace diff --git a/src/parsers/base_expression.cr b/src/parsers/base_expression.cr index 22e0ea4ba..ef51dd8a6 100644 --- a/src/parsers/base_expression.cr +++ b/src/parsers/base_expression.cr @@ -6,7 +6,7 @@ module Mint # # We are doing two big cases as an optimization: each parser can be used # standalone and will return nil if it can't parse, but limiting what can - # pe parsed avoids a lot of unneccesary cycles. + # pe parsed avoids a lot of unnecessary cycles. left = case char when '(' diff --git a/src/parsers/provider.cr b/src/parsers/provider.cr index 3d3de4acb..ae0c4c623 100644 --- a/src/parsers/provider.cr +++ b/src/parsers/provider.cr @@ -14,7 +14,7 @@ module Mint end unless name = id whitespace - next error :provider_expeceted_colon do + next error :provider_expected_colon do expected "the colon of a provider", word snippet self end unless char! ':' diff --git a/src/scope.cr b/src/scope.cr index 67f4eab18..e43d64453 100644 --- a/src/scope.cr +++ b/src/scope.cr @@ -2,10 +2,10 @@ module Mint # The class is responsible for keeping track of which variable is pointing to # which node. # - # The data strucutre is a tree where leafs are the levels of the child nodes + # The data structure is a tree where leaves are the levels of the child nodes # of an AST node and a level is a container for the possible targets. # - # When resolving a variable we travese it's tree upwards to find the target + # When resolving a variable we traverse it's tree upwards to find the target # which matches the value of the variable. class Scope # Represents a level for a node. diff --git a/src/type_checker.cr b/src/type_checker.cr index 5e957deba..c85d1f6bb 100644 --- a/src/type_checker.cr +++ b/src/type_checker.cr @@ -258,7 +258,7 @@ module Mint end || error! :recursion do snippet "Recursion is only supported in specific cases " \ - "at this time. Unfortunatly here is not supported:", node + "at this time. Unfortunately here is not supported:", node snippet "The previous step in the recursion was here:", @stack.last end else diff --git a/src/type_checkers/builtin.cr b/src/type_checkers/builtin.cr index d08af2ea2..7c3b009fd 100644 --- a/src/type_checkers/builtin.cr +++ b/src/type_checkers/builtin.cr @@ -6,7 +6,7 @@ module Mint setLocale navigate compare nothing just err ok inspect href] def check(node : Ast::Builtin) : Checkable - error! :unkown_builtin do + error! :unknown_builtin do block do text "There is no builtin with the name:" bold node.value diff --git a/src/type_checkers/call.cr b/src/type_checkers/call.cr index 5b3e10efe..3f2bb96f7 100644 --- a/src/type_checkers/call.cr +++ b/src/type_checkers/call.cr @@ -60,7 +60,7 @@ module Mint end else error! :call_with_mixed_arguments do - block "A call cannot have named and unamed arguments at the same " \ + block "A call cannot have named and unnamed arguments at the same " \ "time because in specific cases I cannot pair the arguments " \ "with the values." diff --git a/src/type_checkers/component.cr b/src/type_checkers/component.cr index 34a7b659f..ddb2f0ecc 100644 --- a/src/type_checkers/component.cr +++ b/src/type_checkers/component.cr @@ -134,7 +134,7 @@ module Mint error! :component_multiple_providers do block do - text "You are subcribing to the provider" + text "You are subscribing to the provider" bold %("#{other.provider.value}") text "in a component multiple times." end diff --git a/src/type_checkers/if.cr b/src/type_checkers/if.cr index 4711c18a0..222fb981b 100644 --- a/src/type_checkers/if.cr +++ b/src/type_checkers/if.cr @@ -88,7 +88,7 @@ module Mint bold "else branch." end - block "The elese branch can only be omitted if the truthy branch returns one of:" + block "The else branch can only be omitted if the truthy branch returns one of:" snippet VALID_IF_TYPES.map(&.to_pretty).join("\n") block "but it returns" snippet truthy diff --git a/src/type_checkers/property.cr b/src/type_checkers/property.cr index efc5d0d08..96c9ae3df 100644 --- a/src/type_checkers/property.cr +++ b/src/type_checkers/property.cr @@ -49,7 +49,7 @@ module Mint error! :property_with_type_variables do block "The type of a property contains type variables. Type " \ "variables in properties are not allow at this time since " \ - "that would make the compoennt generic and it is not " \ + "that would make the component generic and it is not " \ "supported this time." snippet "The type is:", final diff --git a/src/type_checkers/type_definition.cr b/src/type_checkers/type_definition.cr index 02ffcde22..8aa70808c 100644 --- a/src/type_checkers/type_definition.cr +++ b/src/type_checkers/type_definition.cr @@ -62,7 +62,7 @@ module Mint resolve(item) end - error! :type_defintion_context_mismatch do + error! :type_definition_context_mismatch do snippet "The context value of a type definition doesn't match the type!" expected definition_type, type snippet "The type definition is here:", node diff --git a/src/utils/markd_vdom_renderer.cr b/src/utils/markd_vdom_renderer.cr index 0e758080d..644f1d8a3 100644 --- a/src/utils/markd_vdom_renderer.cr +++ b/src/utils/markd_vdom_renderer.cr @@ -143,7 +143,7 @@ module Mint node, entering = event # If we are in a list we don't add a

tag if all the list - # items have only one paragraph (that what "thight" is). + # items have only one paragraph (that's what "tight" is). next if (grand_parent = node.parent?.try &.parent?) && node.type == Markd::Node::Type::Paragraph && grand_parent.type.list? && diff --git a/src/utils/watcher.cr b/src/utils/watcher.cr index 49077ae39..383b32feb 100644 --- a/src/utils/watcher.cr +++ b/src/utils/watcher.cr @@ -1,5 +1,5 @@ module Mint - # A class for detecting changes to a set of sepcific files (sepcifically + # A class for detecting changes to a set of specific files (specifically # `*.mint`, `.env` and `mint.json`). class Watcher @patterns : Array(String) = [] of String diff --git a/src/workspace.cr b/src/workspace.cr index 0352347f0..4d0e6c884 100644 --- a/src/workspace.cr +++ b/src/workspace.cr @@ -8,7 +8,7 @@ module Mint # class Workspace # The current artifacts of the program or the current error. - getter result : TypeChecker | Error = Error.new(:unitialized_workspace) + getter result : TypeChecker | Error = Error.new(:uninitialized_workspace) # Stores the AST (or error) of the file at the given path. @cache : Hash(String, Ast | Error) = {} of String => Ast | Error