Skip to content

Commit 69073cc

Browse files
included formatting file; ran formatter
1 parent 1553384 commit 69073cc

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

.formatter.exs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
import_deps: [:ecto, :ecto_sql],
3+
inputs: [
4+
"*.{ex,exs}",
5+
"{config,lib,test}/**/*.{ex,exs}"
6+
]
7+
]

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ jobs:
4848
cp config/test.exs.GH_actions config/test.exs
4949
mix ecto.create
5050
mix test
51+
mix format --check-formatted

config/config.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ import Config
2727
# Configuration from the imported file will override the ones defined
2828
# here (which is why it is important to import them last).
2929
#
30-
import_config "#{Mix.env}.exs"
30+
import_config "#{Mix.env()}.exs"

lib/ecto/soft_delete_query.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Ecto.SoftDelete.Query do
1414
results = Repo.all(query)
1515
1616
"""
17-
@spec with_undeleted(Ecto.Queryable.t) :: Ecto.Queryable.t
17+
@spec with_undeleted(Ecto.Queryable.t()) :: Ecto.Queryable.t()
1818
def with_undeleted(query) do
1919
if soft_deletable?(query) do
2020
query
@@ -31,22 +31,22 @@ defmodule Ecto.SoftDelete.Query do
3131
|> soft_deletable?
3232
3333
"""
34-
@spec soft_deletable?(Ecto.Queryable.t) :: boolean()
34+
@spec soft_deletable?(Ecto.Queryable.t()) :: boolean()
3535
def soft_deletable?(query) do
3636
schema_module = get_schema_module(query)
3737
fields = if schema_module, do: schema_module.__schema__(:fields), else: []
3838

3939
Enum.member?(fields, :deleted_at)
4040
end
4141

42-
@doc"""
42+
@doc """
4343
Returns `true` if the schema is not flagged to skip auto-filtering
4444
"""
45-
@spec auto_include_deleted_at_clause?(Ecto.Queriable.t) :: boolean()
45+
@spec auto_include_deleted_at_clause?(Ecto.Queriable.t()) :: boolean()
4646
def auto_include_deleted_at_clause?(query) do
4747
schema_module = get_schema_module(query)
4848

49-
!Kernel.function_exported?(schema_module, :skip_soft_delete_prepare_query?, 0) ||
49+
!Kernel.function_exported?(schema_module, :skip_soft_delete_prepare_query?, 0) ||
5050
!schema_module.skip_soft_delete_prepare_query?()
5151
end
5252

test/soft_delete_migration_test.exs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ defmodule Ecto.SoftDelete.Migration.Test do
77

88
setup meta do
99
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Repo)
10-
{:ok, runner} = Runner.start_link({self(), Repo, Repo.config(), __MODULE__, meta[:direction] || :forward, :up, %{level: false, sql: false}})
10+
11+
{:ok, runner} =
12+
Runner.start_link(
13+
{self(), Repo, Repo.config(), __MODULE__, meta[:direction] || :forward, :up,
14+
%{level: false, sql: false}}
15+
)
16+
1117
Runner.metadata(runner, meta)
1218
{:ok, runner: runner}
1319
end
@@ -21,7 +27,6 @@ defmodule Ecto.SoftDelete.Migration.Test do
2127

2228
flush()
2329

24-
assert {:create, _,
25-
[{:add, :deleted_at, :utc_datetime_usec, []}]} = create_command
30+
assert {:create, _, [{:add, :deleted_at, :utc_datetime_usec, []}]} = create_command
2631
end
2732
end

test/test_helper.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{:ok, _} = Application.ensure_all_started(:postgrex)
2-
{:ok, _pid} = Ecto.SoftDelete.Test.Repo.start_link
2+
{:ok, _pid} = Ecto.SoftDelete.Test.Repo.start_link()
33

44
defmodule Ecto.SoftDelete.Test.Migrations do
55
use Ecto.Migration
66
import Ecto.SoftDelete.Migration
77

88
def change do
99
drop_if_exists table(:users)
10+
1011
create table(:users) do
1112
add :email, :string
1213
soft_delete_columns()

0 commit comments

Comments
 (0)