Skip to content

Commit e1f61e8

Browse files
Prepare for Release 2.1.4 // Updates readme, add formatter (#189)
* updated the readme * included formatting file; ran formatter * updated mix.exs * changed to 2.1.4 * reverted back to [{:ecto_soft_delete, "~> 2.0"}]
1 parent d2814c1 commit e1f61e8

File tree

8 files changed

+28
-14
lines changed

8 files changed

+28
-14
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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
[![Build Status](https://travis-ci.org/revelrylabs/ecto_soft_delete.svg?branch=master)](https://travis-ci.org/revelrylabs/ecto_soft_delete)
1+
![Build Status](https://github.com/revelrylabs/ecto_soft_delete/actions/workflows/test.yml/badge.svg)
2+
![Publish Status](https://github.com/revelrylabs/ecto_soft_delete/actions/workflows/publish.yml/badge.svg)
23
[![Hex.pm](https://img.shields.io/hexpm/dt/ecto_soft_delete.svg)](https://hex.pm/packages/ecto_soft_delete)
34
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4-
[![Coverage Status](https://opencov.prod.revelry.net/projects/21/badge.svg)](https://opencov.prod.revelry.net/projects/21)
55

66
# EctoSoftDelete
77

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

mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule EctoSoftDelete.Mixfile do
44
def project do
55
[
66
app: :ecto_soft_delete,
7-
version: "2.0.4",
7+
version: "2.1.4",
88
elixir: "~> 1.11",
99
elixirc_paths: elixirc_paths(Mix.env()),
1010
build_embedded: Mix.env() == :prod,
@@ -48,7 +48,7 @@ defmodule EctoSoftDelete.Mixfile do
4848
defp package do
4949
[
5050
files: ["lib", "mix.exs", "README.md", "LICENSE", "CHANGELOG.md"],
51-
maintainers: ["Bryan Joseph", "Luke Ledet"],
51+
maintainers: ["Bryan Joseph", "Luke Ledet", "Revelry Labs"],
5252
licenses: ["MIT"],
5353
links: %{
5454
"GitHub" => "https://github.com/revelrylabs/ecto_soft_delete"

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)