Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Dec 19, 2024
1 parent 16fe1f1 commit 410da84
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/data_layer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,8 @@ defmodule AshPostgres.DataLayer do
end
|> case do
{:ok, through_query} ->
through_query = Ecto.Query.exclude(through_query, :select)
through_query = Ecto.Query.exclude(through_query, :select)

if query.__ash_bindings__[:__order__?] do
subquery =
subquery(
Expand Down Expand Up @@ -1201,7 +1202,6 @@ defmodule AshPostgres.DataLayer do
)
)


{:ok,
from(source in data_layer_query,
where: field(source, ^source_attribute) in ^source_values,
Expand Down
6 changes: 3 additions & 3 deletions lib/migration_generator/migration_generator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ defmodule AshPostgres.MigrationGenerator do
|> Path.join(repo_name)
|> Path.join("extensions.json")

unless opts.dry_run || opts.check do
if !(opts.dry_run || opts.check) do
File.rename(legacy_snapshot_file, snapshot_file)
end

Expand Down Expand Up @@ -1027,7 +1027,7 @@ defmodule AshPostgres.MigrationGenerator do
end

defp create_new_snapshot(snapshots, repo_name, opts, tenant?) do
unless opts.dry_run do
if !opts.dry_run do
Enum.each(snapshots, fn snapshot ->
snapshot_binary = snapshot_to_binary(snapshot)

Expand Down Expand Up @@ -2868,7 +2868,7 @@ defmodule AshPostgres.MigrationGenerator do
configured_reference =
configured_reference(resource, table, attribute.source || attribute.name, relationship)

unless Map.get(configured_reference, :ignore?) do
if !Map.get(configured_reference, :ignore?) do
destination_attribute =
Ash.Resource.Info.attribute(
relationship.destination,
Expand Down
2 changes: 1 addition & 1 deletion lib/multitenancy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ defmodule AshPostgres.MultiTenancy do
end

defp validate_tenant_name!(tenant_name) do
unless Regex.match?(@tenant_name_regex, tenant_name) do
if !Regex.match?(@tenant_name_regex, tenant_name) do
raise "Tenant name must match #{inspect(@tenant_name_regex)}, got: #{tenant_name}"
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/repo/before_compile.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule AshPostgres.Repo.BeforeCompile do

defmacro __before_compile__(_env) do
quote do
unless Module.defines?(__MODULE__, {:min_pg_version, 0}, :def) do
if !Module.defines?(__MODULE__, {:min_pg_version, 0}, :def) do
IO.warn("""
Please define `min_pg_version/0` in repo module: #{inspect(__MODULE__)}
Expand Down
2 changes: 1 addition & 1 deletion lib/verifiers/validate_references.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule AshPostgres.Verifiers.ValidateReferences do
dsl
|> AshPostgres.DataLayer.Info.references()
|> Enum.each(fn reference ->
unless Ash.Resource.Info.relationship(dsl, reference.relationship) do
if !Ash.Resource.Info.relationship(dsl, reference.relationship) do
raise Spark.Error.DslError,
path: [:postgres, :references, reference.relationship],
module: Verifier.get_persisted(dsl, :module),
Expand Down
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ defmodule AshPostgres.MixProject do
"spark.replace_doc_links",
"spark.cheat_sheets_in_search"
],
format: "format --migrate",
"spark.formatter": "spark.formatter --extensions AshPostgres.DataLayer",
"spark.cheat_sheets": "spark.cheat_sheets --extensions AshPostgres.DataLayer",
"spark.cheat_sheets_in_search":
Expand Down
2 changes: 1 addition & 1 deletion test/support/repo_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule AshPostgres.RepoCase do
setup tags do
:ok = Sandbox.checkout(AshPostgres.TestRepo)

unless tags[:async] do
if !tags[:async] do
Sandbox.mode(AshPostgres.TestRepo, {:shared, self()})
end

Expand Down

0 comments on commit 410da84

Please sign in to comment.