Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
NickNeck committed Nov 2, 2024
1 parent dd1e009 commit ef3f26f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
13 changes: 6 additions & 7 deletions examples/my_code/.recode.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
version: "0.7.2",
version: "0.8.0",
# Can also be set/reset with `--autocorrect`/`--no-autocorrect`.
autocorrect: true,
# With "--dry" no changes will be written to the files.
Expand All @@ -11,29 +11,28 @@
# Can also be set/reset with `--verbose`/`--no-verbose`.
verbose: false,
# Can be overwritten by calling `mix recode "lib/**/*.ex"`.
inputs: ["{mix,.formatter}.exs", "{apps,config,lib,test}/**/*.{ex,exs}"],
inputs: ["{mix,.formatter}.exs", "{apps,config,lib,test,priv}/**/*.{ex,exs}"],
formatters: [Recode.CLIFormatter],
tasks: [
# Tasks could be added by a tuple of the tasks module name and an options
# keyword list. A task can be deactivated by `active: false`. The execution of
# a deactivated task can be forced by calling `mix recode --task ModuleName`.
# {Recode.Task.Format, []},
# {Recode.Task.Format, config: [formatter: :sourceror]},
# {Recode.Task.Format, config: [formatter: :elixir]},
# {Recode.Task.Format, active: false},
{Recode.Task.AliasExpansion, []},
{Recode.Task.AliasOrder, []},
{Recode.Task.Dbg, [autocorrect: false]},
{Recode.Task.EnforceLineLength, [active: false]},
{Recode.Task.FilterCount, []},
{Recode.Task.IOInspect, [autocorrect: false]},
{Recode.Task.LocalsWithoutParens, []},
{Recode.Task.Moduledoc, []},
{Recode.Task.Nesting, []},
{Recode.Task.PipeFunOne, []},
{Recode.Task.SinglePipe, []},
{Recode.Task.Specs, [exclude: ["test/**/*.{ex,exs}", "mix.exs"], config: [only: :visible]]},
{Recode.Task.TagFIXME, [exit_code: 2]},
{Recode.Task.TagTODO, [exit_code: 4]},
{Recode.Task.TestFileExt, []},
{Recode.Task.TestFile, []},
{Recode.Task.UnnecessaryIfUnless, []},
{Recode.Task.UnusedVariable, [active: false]}
]
]
4 changes: 2 additions & 2 deletions examples/my_code/mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"glob_ex": {:hex, :glob_ex, "0.1.10", "d819a368637495a5c1962ef34f48fe4e9a09032410b96ade5758f2cd1cc5fcde", [:mix], [], "hexpm", "c75357e57d71c85ef8ef7269b6e787dce3f0ff71e585f79a90e4d5477c532b90"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"json_formatter": {:hex, :json_formatter, "0.2.0", "e36ec571f2420c5afa4f744169eb5b2e7ed2ae0cadaf3cd39ef43e1d11fef29a", [:mix], [{:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "c8b8c354420b88a3edd0f5a23d4ca8a6ca6090091df6965894631eb20fc7df31"},
"rewrite": {:hex, :rewrite, "0.10.0", "5d756b6dc67679e7156ff6055f9654be02dbaeb177aaf1ff6af7ee8da8718248", [:mix], [{:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.13", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "68d7808cf549e7bf51b0119a8edc14d50970bad479115249030baa580c1d7b50"},
"sourceror": {:hex, :sourceror, "1.6.0", "9907884e1449a4bd7dbaabe95088ed4d9a09c3c791fb0103964e6316bc9448a7", [:mix], [], "hexpm", "e90aef8c82dacf32c89c8ef83d1416fc343cd3e5556773eeffd2c1e3f991f699"},
"rewrite": {:hex, :rewrite, "1.0.0", "fddda21eb62c2b9dbd6cf35b39984d02761a63c25de2947ceab7ffe2729fa2e5", [:mix], [{:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.0", [hex: :sourceror, repo: "hexpm", optional: false]}, {:text_diff, "~> 0.1", [hex: :text_diff, repo: "hexpm", optional: false]}], "hexpm", "701975d9d0c21b1f40a82881e489aca6b53893f095f318978c6d2899299a514b"},
"sourceror": {:hex, :sourceror, "1.7.1", "599d78f4cc2be7d55c9c4fd0a8d772fd0478e3a50e726697c20d13d02aa056d4", [:mix], [], "hexpm", "cd6f268fe29fa00afbc535e215158680a0662b357dc784646d7dff28ac65a0fc"},
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
"text_diff": {:hex, :text_diff, "0.1.0", "1caf3175e11a53a9a139bc9339bd607c47b9e376b073d4571c031913317fecaa", [:mix], [], "hexpm", "d1ffaaecab338e49357b6daa82e435f877e0649041ace7755583a0ea3362dbd7"},
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ defmodule MyRepo.Migrations.CreateUsers do
def up do
create table("users") do
add :first_name, :string, size: 40
add :last_name, :string, size: 40
add(:last_name, :string, size: 40)

timestamps()
end
end

def down do
drop table("weather")
drop table("users")
end
end
Binary file modified examples/my_code/scripts/backup.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/my_code/scripts/backup.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule Backup do
def run(["restore"]) do
IO.puts("restoring form backup #{@backup}")

Enum.each(["lib", "test", "config"], fn dir -> File.rm_rf!(dir) end)
Enum.each(["lib", "test", "config", "priv"], fn dir -> File.rm_rf!(dir) end)

files = @backup |> File.read!() |> :erlang.binary_to_term()

Expand Down

0 comments on commit ef3f26f

Please sign in to comment.