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
3 changes: 0 additions & 3 deletions .ameba.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Documentation/DocumentationAdmonition:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion core/source/File.mint
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion core/source/Http.mint
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion core/source/MutationObserver.mint
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/source/Provider/Shortcuts.mint
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/source/ResizeObserver.mint
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/source/Storage/Common.mint
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
`
(() => {
Expand Down
4 changes: 2 additions & 2 deletions runtime/src/decoders.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion runtime/tests/debug.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) }`);
});

Expand Down
2 changes: 1 addition & 1 deletion runtime/tests/variant.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
development_dependencies:
ameba:
github: crystal-ameba/ameba
version: ~> 1.6.4
branch: master

targets:
mint:
Expand Down
17 changes: 8 additions & 9 deletions spec/ast/node_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<div></div>
Expand All @@ -26,17 +25,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
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/errors/call_with_mixed_arguments
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/component_multiple_providers
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/property_with_type_variables
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
│ ⌃⌃⌃⌃
4 changes: 2 additions & 2 deletions spec/errors/recursion
Original file line number Diff line number Diff line change
Expand Up @@ -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
├────────────────────────────────────────
Expand Down
6 changes: 3 additions & 3 deletions spec/errors/unkown_builtin → spec/errors/unknown_builtin
Original file line number Diff line number Diff line change
Expand Up @@ -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%}`
Expand Down
2 changes: 1 addition & 1 deletion spec/examples/builtin
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ component Main {
<div></div>
}
}
------------------------------------------------------------------unkown_builtin
----------------------------------------------------------------unknown_builtin
component Main {
fun render : Html {
`#{%wtf%}`
Expand Down
2 changes: 1 addition & 1 deletion spec/examples/provider
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---------------------------------------------------------provider_expected_name
provider
-------------------------------------------------------provider_expeceted_colon
--------------------------------------------------------provider_expected_colon
provider Test
-------------------------------------------------provider_expected_subscription
provider Test :
Expand Down
4 changes: 2 additions & 2 deletions spec/examples/type_definition
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions spec/examples_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/formatters/record_destructuring
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Test {

case item {
{ name: name, age: 42 } => name
=> "Unkown"
=> "Unknown"
}
}
}
Expand All @@ -27,7 +27,7 @@ module Test {

case item {
{ name: name, age: 42 } => name
=> "Unkown"
=> "Unknown"
}
}
}
4 changes: 2 additions & 2 deletions spec/formatters/string_literal_split_with_interpolation
Original file line number Diff line number Diff line change
@@ -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 " \
Expand Down
Loading
Loading