From 614e2fd7d9c9bdbabed212f3c9b39571240ad88b Mon Sep 17 00:00:00 2001 From: beardedeagle Date: Sun, 7 May 2023 01:33:03 -0500 Subject: [PATCH] fix test output --- .doctor.exs | 15 +++++++++++++++ .formatter.exs | 2 +- .gitignore | 4 ++-- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 9 +++++++++ CONTRIBUTORS.md | 2 +- README.md | 2 +- mix.exs | 13 ++++++------- mix.lock | 3 ++- test/mnesiac_test.exs | 16 ++++++++-------- 10 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 .doctor.exs diff --git a/.doctor.exs b/.doctor.exs new file mode 100644 index 0000000..e61fb01 --- /dev/null +++ b/.doctor.exs @@ -0,0 +1,15 @@ +%Doctor.Config{ + exception_moduledoc_required: true, + failed: false, + ignore_modules: [], + ignore_paths: [], + min_module_doc_coverage: 40, + min_module_spec_coverage: 0, + min_overall_doc_coverage: 50, + min_overall_moduledoc_coverage: 100, + min_overall_spec_coverage: 0, + raise: false, + reporter: Doctor.Reporters.Full, + struct_type_spec_required: true, + umbrella: false +} diff --git a/.formatter.exs b/.formatter.exs index bb09258..a032d1d 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,4 +1,4 @@ [ - inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], + inputs: ["*.{ex,exs}", "{config,lib,test}/**/*.{ex,exs}"], line_length: 120 ] diff --git a/.gitignore b/.gitignore index b42a6f1..1fddbc8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,8 @@ cover deps doc erl_crash.dump -Mnesia.*@* +Mnesia* mnesiac-*.tar mnesiac.iml -MnesiaCore.* test0* +tmp diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 04887be..713b4b5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ minimum_pre_commit_version: 2.7.1 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.4.0 hooks: - id: check-added-large-files - id: check-case-conflict diff --git a/CHANGELOG.md b/CHANGELOG.md index 537ffa7..06a1512 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [[0.3.13]] - 2023-05-07 +### Changed +- Updated GitHub repo files. +- Removed inch in favor of doctor for doc coverage reporting. + +### Fixed +- Fixed test suite polluting output with warnings about unused variables. + ## [[0.3.12]] - 2023-05-06 ### Changed - Changed `get_table_cookies/1` and `get_table_cookies/2` to utilize `table_load_timeout/0` for `:rpc.call/5` calls. @@ -112,6 +120,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release. +[0.3.13]: https://github.com/beardedeagle/mnesiac/compare/v0.3.12...v0.3.13 [0.3.12]: https://github.com/beardedeagle/mnesiac/compare/v0.3.11...v0.3.12 [0.3.11]: https://github.com/beardedeagle/mnesiac/compare/v0.3.10...v0.3.11 [0.3.10]: https://github.com/beardedeagle/mnesiac/compare/v0.3.9...v0.3.10 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4372703..dd99c95 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,6 +1,6 @@ # Contributors +- aby2503 - astutecat - darrenclark - davidwebster48 -- aby2503 diff --git a/README.md b/README.md index 9f6bb9a..c9f43b6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Mnesia auto clustering made easy! Docs can be found at [https://hexdocs.pm/mnesiac](https://hexdocs.pm/mnesiac). -**_NOTICE:_** Mnesiac, while stable, is still considered pre `1.0`. This means the API can, and may, change at any time. Please ensure you review the docs and changelog prior to updating. +**_NOTICE:_** Mnesiac, while stable, is still considered pre `1.0`. This means the API can, and may, change at any time. Please ensure you review the docs and changelog prior to updating, or pin the version of mnesiac you are using in `mix.exs` if necessary. **_NOTICE:_** Mnesiac allows a significant amount of freedom with how it behaves. This allows you to customize Mnesiac to suit your needs. However, this also allows for a fair amount of foot gunning. Please ensure you've done your due diligence when using this library, or Mnesia itself for that matter. It isn't a silver bullet, and it shouldn't be treated as one. diff --git a/mix.exs b/mix.exs index 11e76c3..36b0522 100644 --- a/mix.exs +++ b/mix.exs @@ -1,12 +1,11 @@ defmodule Mnesiac.MixProject do @moduledoc false - require Logger use Mix.Project def project do [ app: :mnesiac, - version: "0.3.12", + version: "0.3.13", elixir: "~> 1.8", elixirc_paths: elixirc_paths(Mix.env()), test_coverage: [tool: ExCoveralls], @@ -46,8 +45,8 @@ defmodule Mnesiac.MixProject do check: [ "format --check-formatted --dry-run", "compile --warning-as-errors --force", - "credo --strict --all", - "inch" + "doctor", + "credo --strict --all" ], "purge.db": &purge_db/1 ], @@ -72,10 +71,10 @@ defmodule Mnesiac.MixProject do {:libcluster, "~> 3.3", optional: true}, {:credo, "~> 1.7", only: [:dev], runtime: false}, {:dialyxir, "~> 1.3", only: [:dev], runtime: false}, + {:doctor, "~> 0.21", only: [:dev], runtime: false}, {:ex_doc, "~> 0.29", only: [:dev], runtime: false}, {:ex_unit_clustered_case, "~> 0.5", only: [:test]}, - {:excoveralls, "~> 0.16", only: [:test], runtime: false}, - {:inch_ex, "~> 2.0", only: [:dev], runtime: false} + {:excoveralls, "~> 0.16", only: [:test], runtime: false} ] end @@ -83,7 +82,7 @@ defmodule Mnesiac.MixProject do if Mix.env() in [:dev, :test] do Mix.shell().cmd("rm -rf ./test0* ./Mnesia.nonode@nohost") else - Logger.info("[mnesiac:#{node()}] purge.db can only be used in dev and test env") + Mix.shell().info("[mnesiac:#{node()}] purge.db can only be used in dev and test env") end end end diff --git a/mix.lock b/mix.lock index 502efb4..7280310 100644 --- a/mix.lock +++ b/mix.lock @@ -2,7 +2,9 @@ "bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"}, "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"}, "credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"}, + "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, "dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"}, + "doctor": {:hex, :doctor, "0.21.0", "20ef89355c67778e206225fe74913e96141c4d001cb04efdeba1a2a9704f1ab5", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "a227831daa79784eb24cdeedfa403c46a4cb7d0eab0e31232ec654314447e4e0"}, "earmark_parser": {:hex, :earmark_parser, "1.4.32", "fa739a0ecfa34493de19426681b23f6814573faee95dfd4b4aafe15a7b5b32c6", [:mix], [], "hexpm", "b8b0dd77d60373e77a3d7e8afa598f325e49e8663a51bcc2b88ef41838cca755"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"}, @@ -11,7 +13,6 @@ "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~> 2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, - "inch_ex": {:hex, :inch_ex, "2.0.0", "24268a9284a1751f2ceda569cd978e1fa394c977c45c331bb52a405de544f4de", [:mix], [{:bunt, "~> 0.2", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "96d0ec5ecac8cf63142d02f16b7ab7152cf0f0f1a185a80161b758383c9399a8"}, "jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"}, "libcluster": {:hex, :libcluster, "3.3.2", "84c6ebfdc72a03805955abfb5ff573f71921a3e299279cc3445445d5af619ad1", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8b691ce8185670fc8f3fc0b7ed59eff66c6889df890d13411f8f1a0e6871d8a5"}, "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, diff --git a/test/mnesiac_test.exs b/test/mnesiac_test.exs index 958832c..72b06b3 100644 --- a/test/mnesiac_test.exs +++ b/test/mnesiac_test.exs @@ -87,13 +87,13 @@ defmodule MnesiacTest do test "cluster status", %{cluster: cluster} do [node_a] = Cluster.members(cluster) - assert [{:running_nodes, [node_a]}] = Cluster.call(node_a, Mnesiac, :cluster_status, []) + assert [{:running_nodes, [^node_a]}] = Cluster.call(node_a, Mnesiac, :cluster_status, []) end test "running nodes", %{cluster: cluster} do [node_a] = Cluster.members(cluster) - assert [node_a] = Cluster.call(node_a, Mnesiac, :running_nodes, []) + assert [^node_a] = Cluster.call(node_a, Mnesiac, :running_nodes, []) end test "node in cluster", %{cluster: cluster} do @@ -128,13 +128,13 @@ defmodule MnesiacTest do test "cluster status", %{cluster: cluster} do [node_a] = Cluster.members(cluster) - assert [{:running_nodes, [node_a]}] = Cluster.call(node_a, Mnesiac, :cluster_status, []) + assert [{:running_nodes, [^node_a]}] = Cluster.call(node_a, Mnesiac, :cluster_status, []) end test "running nodes", %{cluster: cluster} do [node_a] = Cluster.members(cluster) - assert [node_a] = Cluster.call(node_a, Mnesiac, :running_nodes, []) + assert [^node_a] = Cluster.call(node_a, Mnesiac, :running_nodes, []) end test "node in cluster", %{cluster: cluster} do @@ -178,15 +178,15 @@ defmodule MnesiacTest do test "cluster status", %{cluster: cluster} do [node_a, node_b] = Cluster.members(cluster) - assert [{:running_nodes, [node_a, node_b]}] = Cluster.call(node_a, Mnesiac, :cluster_status, []) - assert [{:running_nodes, [node_a, node_b]}] = Cluster.call(node_b, Mnesiac, :cluster_status, []) + assert [{:running_nodes, [^node_b, ^node_a]}] = Cluster.call(node_a, Mnesiac, :cluster_status, []) + assert [{:running_nodes, [^node_a, ^node_b]}] = Cluster.call(node_b, Mnesiac, :cluster_status, []) end test "running nodes", %{cluster: cluster} do [node_a, node_b] = Cluster.members(cluster) - assert [node_a, node_b] = Cluster.call(node_a, Mnesiac, :running_nodes, []) - assert [node_a, node_b] = Cluster.call(node_b, Mnesiac, :running_nodes, []) + assert [^node_b, ^node_a] = Cluster.call(node_a, Mnesiac, :running_nodes, []) + assert [^node_a, ^node_b] = Cluster.call(node_b, Mnesiac, :running_nodes, []) end test "node in cluster", %{cluster: cluster} do