Skip to content

Commit

Permalink
Smoek test data for Elixir 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska committed Feb 25, 2024
1 parent 30cde34 commit 9d014d2
Show file tree
Hide file tree
Showing 18 changed files with 112 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
include:
- elixir: '1.13.0'
- elixir: '1.13.2'
otp: '24.1'
current_version: false
- elixir: '1.14.0'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Then, extend your `.formatter.exs` config file by adding the plugin.
]
```

Elixir 1.13 or up is required because lower versions do not support formatter plugins.
Elixir 1.13.2 or up is required. Versions lower than 1.13 do not support formatter plugins, and versions 1.13.0 and 1.13.1 do not support formatter plugins for `.iex` files.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion smoke_test_data/elixir-1-13/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.13.0-otp-24
elixir 1.13.2-otp-24
erlang 24.1.7
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used by "mix format"
[
plugins: [DoctestFormatter],
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}", "{docs}/**/*.md", "*.md"]
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ erl_crash.dump
*.ez

# Ignore package tarball (built via "mix hex.build").
project_with_unformatted_code-*.tar
project_with_formatted_code-*.tar

# Temporary files, for example, from tests.
/tmp/
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# ProjectWithUnformattedCode
# ProjectWithFormattedCode

**TODO: Add description**

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `project_with_unformatted_code` to your list of dependencies in `mix.exs`:
by adding `project_with_formatted_code` to your list of dependencies in `mix.exs`:

```elixir
def deps do
[
{:project_with_unformatted_code, "~> 0.1.0"}
{:project_with_formatted_code, "~> 0.1.0"}
]
end
```

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at <https://hexdocs.pm/project_with_unformatted_code>.
be found at <https://hexdocs.pm/project_with_formatted_code>.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
defmodule ProjectWithFormattedCode do
@moduledoc """
Documentation for `ProjectWithFormattedCode`.
"""

@doc """
Hello world.
## Examples
iex> ProjectWithFormattedCode.add(1, 2)
3
iex> 1
...> |> ProjectWithFormattedCode.add(2)
3
"""
def add(a, b) do
a + b
end

@doc """
iex> ProjectWithFormattedCode.subtract(5, 4)
1
iex> [
...> 100_000_000_000,
...> 200_000_000_000,
...> 300_000_000_000,
...> 400_000_000_000,
...> 500_000_000_000,
...> 600_000_000_000,
...> 700_000_000_000
...> ]
...> |> Enum.map(&ProjectWithFormattedCode.subtract(&1, 100_000_000_000))
[0, 100_000_000_000, 200_000_000_000, 300_000_000_000, 400_000_000_000, 500_000_000_000, 600_000_000_000]
"""
def subtract(a, b) do
a - b
end
end

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
defmodule ProjectWithUnformattedCode.MixProject do
defmodule ProjectWithFormattedCode.MixProject do
use Mix.Project

def project do
[
app: :project_with_unformatted_code,
app: :project_with_formatted_code,
version: "0.1.0",
start_permanent: Mix.env() == :prod,
deps: deps()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defmodule ProjectWithFormattedCodeTest do
use ExUnit.Case
doctest ProjectWithFormattedCode
end

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used by "mix format"
[
plugins: [DoctestFormatter],
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}", "{docs}/**/*.md", "*.md"]
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,45 +1,42 @@
defmodule ExpectedDiff do
def diff do
"""
diff --git a/smoke_test_data/elixir-1-13/project_with_unformatted_code/README.md b/smoke_test_data/elixir-1-13/project_with_unformatted_code/README.md
index d066e9b..0ccfa0b 100644
--- a/smoke_test_data/elixir-1-13/project_with_unformatted_code/README.md
+++ b/smoke_test_data/elixir-1-13/project_with_unformatted_code/README.md
@@ -9,9 +9,9 @@ by adding `project_with_unformatted_code` to your list of dependencies in `mix.e
diff --git a/smoke_test_data/elixir-1-13/project_with_unformatted_code/lib/project_with_unformatted_code.ex b/smoke_test_data/elixir-1-13/project_with_unformatted_code/lib/project_with_unformatted_code.ex
index 4014a07..e1c0611 100644
--- a/smoke_test_data/elixir-1-13/project_with_unformatted_code/lib/project_with_unformatted_code.ex
+++ b/smoke_test_data/elixir-1-13/project_with_unformatted_code/lib/project_with_unformatted_code.ex
@@ -12,8 +12,8 @@ defmodule ProjectWithUnformattedCode do
3
#{" "}
```elixir
def deps do
-[
-{ :project_with_unformatted_code, "~> 0.1.0" }
-]
+ [
+ {:project_with_unformatted_code, "~> 0.1.0"}
+ ]
end
```
iex> 1
- ...> |> ProjectWithUnformattedCode.add(2)
- 3
+ ...> |> ProjectWithUnformattedCode.add(2)
+ 3
#{" "}
diff --git a/smoke_test_data/elixir-1-13/project_with_unformatted_code/docs/hello.md b/smoke_test_data/elixir-1-13/project_with_unformatted_code/docs/hello.md
index 114bb32..8d4ffe5 100644
--- a/smoke_test_data/elixir-1-13/project_with_unformatted_code/docs/hello.md
+++ b/smoke_test_data/elixir-1-13/project_with_unformatted_code/docs/hello.md
@@ -1,7 +1,7 @@
# Hello!
\"""
def add(a, b) do
@@ -21,10 +21,18 @@ defmodule ProjectWithUnformattedCode do
end
#{" "}
~~~~elixir
-%{ x: 7, y: 8}
+%{x: 7, y: 8}
~~~~
@doc \"""
- iex> ProjectWithUnformattedCode.subtract( 5, 4 )
+ iex> ProjectWithUnformattedCode.subtract(5, 4)
1
#{" "}
[//]: # (elixir-formatter-disable-next-block)
@@ -11,7 +11,7 @@
~~~~
#{" "}
```elixir
-%{ x: 7, y: 8}
+%{x: 7, y: 8}
```
#{" "}
```markdown
- iex> [100_000_000_000, 200_000_000_000, 300_000_000_000, 400_000_000_000, 500_000_000_000, 600_000_000_000, 700_000_000_000]
+ iex> [
+ ...> 100_000_000_000,
+ ...> 200_000_000_000,
+ ...> 300_000_000_000,
+ ...> 400_000_000_000,
+ ...> 500_000_000_000,
+ ...> 600_000_000_000,
+ ...> 700_000_000_000
+ ...> ]
...> |> Enum.map(&ProjectWithUnformattedCode.subtract(&1, 100_000_000_000))
[0, 100_000_000_000, 200_000_000_000, 300_000_000_000, 400_000_000_000, 500_000_000_000, 600_000_000_000]
\"""
"""
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,27 @@ defmodule ProjectWithUnformattedCode do
## Examples
iex> ProjectWithUnformattedCode.hello()
:world
iex> ProjectWithUnformattedCode.add(1, 2)
3
iex> 1
...> |> ProjectWithUnformattedCode.add(2)
3
"""
def add(a, b) do
a + b
end

@doc """
iex> ProjectWithUnformattedCode.subtract( 5, 4 )
1
iex> [100_000_000_000, 200_000_000_000, 300_000_000_000, 400_000_000_000, 500_000_000_000, 600_000_000_000, 700_000_000_000]
...> |> Enum.map(&ProjectWithUnformattedCode.subtract(&1, 100_000_000_000))
[0, 100_000_000_000, 200_000_000_000, 300_000_000_000, 400_000_000_000, 500_000_000_000, 600_000_000_000]
"""
def hello do
:world
def subtract(a, b) do
a - b
end
end
2 changes: 1 addition & 1 deletion smoke_test_data/project_with_formatted_code/.formatter.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used by "mix format"
[
plugins: [DoctestFormatter],
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}", "{docs}/**/*.md", "*.md"]
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used by "mix format"
[
plugins: [DoctestFormatter],
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}", "{docs}/**/*.md", "*.md"]
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]

0 comments on commit 9d014d2

Please sign in to comment.