Skip to content

Commit a83fed4

Browse files
authored
Merge pull request #87 from beardedeagle/0.3.10
fix table detection
2 parents 381c8e3 + d00a07e commit a83fed4

File tree

9 files changed

+162
-125
lines changed

9 files changed

+162
-125
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
66
community a harassment-free experience for everyone, regardless of age, body
77
size, visible or invisible disability, ethnicity, sex characteristics, gender
88
identity and expression, level of experience, education, socio-economic status,
9-
nationality, personal appearance, race, caste, color, religion, or sexual identity
10-
and orientation.
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
1111

1212
We pledge to act and interact in ways that contribute to an open, welcoming,
1313
diverse, inclusive, and healthy community.
@@ -22,17 +22,17 @@ community include:
2222
* Giving and gracefully accepting constructive feedback
2323
* Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
26-
overall community
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
31-
advances of any kind
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
3232
* Trolling, insulting or derogatory comments, and personal or political attacks
3333
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
35-
address, without their explicit permission
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
3636
* Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

@@ -82,15 +82,15 @@ behavior was inappropriate. A public apology may be requested.
8282

8383
### 2. Warning
8484

85-
**Community Impact**: A violation through a single incident or series
86-
of actions.
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
8787

8888
**Consequence**: A warning with consequences for continued behavior. No
8989
interaction with the people involved, including unsolicited interaction with
9090
those enforcing the Code of Conduct, for a specified period of time. This
9191
includes avoiding interactions in community spaces as well as external channels
92-
like social media. Violating these terms may lead to a temporary or
93-
permanent ban.
92+
like social media. Violating these terms may lead to a temporary or permanent
93+
ban.
9494

9595
### 3. Temporary Ban
9696

@@ -106,27 +106,27 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112-
**Consequence**: A permanent ban from any sort of public interaction within
113-
the community.
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
114114

115115
## Attribution
116116

117117
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118-
version 2.0, available at
119-
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
118+
version 2.1, available at
119+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120120

121121
Community Impact Guidelines were inspired by
122122
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123123

124124
For answers to common questions about this code of conduct, see the FAQ at
125-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
126-
at [https://www.contributor-covenant.org/translations][translations].
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126+
[https://www.contributor-covenant.org/translations][translations].
127127

128128
[homepage]: https://www.contributor-covenant.org
129-
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
129+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130130
[Mozilla CoC]: https://github.com/mozilla/diversity
131131
[FAQ]: https://www.contributor-covenant.org/faq
132132
[translations]: https://www.contributor-covenant.org/translations

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [[0.3.10]] - 2023-05-04
8+
### Changed
9+
- Changed `get_table_cookies/1` to use `:local_tables` instead of `:tables` to properly identify table copies that don't exist locally to a given node.
10+
- Assert that `Mnesiac.init_mnesia/1` is called successfully.
11+
- Updated dependencies.
12+
- Updated GitHub repo files.
13+
714
## [[0.3.9]] - 2021-02-21
815
### Changed
916
- Bumped OTP version.
@@ -92,6 +99,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9299
### Added
93100
- Initial release.
94101

102+
[0.3.10]: https://github.com/beardedeagle/mnesiac/compare/v0.3.9...v0.3.10
95103
[0.3.9]: https://github.com/beardedeagle/mnesiac/compare/v0.3.8...v0.3.9
96104
[0.3.8]: https://github.com/beardedeagle/mnesiac/compare/v0.3.7...v0.3.8
97105
[0.3.7]: https://github.com/beardedeagle/mnesiac/compare/v0.3.6...v0.3.7

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
- astutecat
44
- darrenclark
5+
- davidwebster48
56
- aby2503

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Randy Thompson (@beardedeagle)
3+
Copyright (c) 2023 Randy Thompson (@beardedeagle)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

config/.credo.exs

Lines changed: 107 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -20,86 +20,113 @@
2020
strict: true,
2121
parse_timeout: 5000,
2222
color: true,
23-
checks: [
24-
{Credo.Check.Consistency.ExceptionNames, []},
25-
{Credo.Check.Consistency.LineEndings, []},
26-
{Credo.Check.Consistency.ParameterPatternMatching, []},
27-
{Credo.Check.Consistency.SpaceAroundOperators, []},
28-
{Credo.Check.Consistency.SpaceInParentheses, []},
29-
{Credo.Check.Consistency.TabsOrSpaces, []},
30-
{Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]},
31-
{Credo.Check.Design.TagTODO, [exit_status: 2]},
32-
{Credo.Check.Design.TagFIXME, []},
33-
{Credo.Check.Readability.AliasOrder, []},
34-
{Credo.Check.Readability.FunctionNames, []},
35-
{Credo.Check.Readability.LargeNumbers, []},
36-
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]},
37-
{Credo.Check.Readability.ModuleAttributeNames, []},
38-
{Credo.Check.Readability.ModuleDoc, []},
39-
{Credo.Check.Readability.ModuleNames, []},
40-
{Credo.Check.Readability.ParenthesesInCondition, []},
41-
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
42-
{Credo.Check.Readability.PredicateFunctionNames, []},
43-
{Credo.Check.Readability.PreferImplicitTry, []},
44-
{Credo.Check.Readability.RedundantBlankLines, []},
45-
{Credo.Check.Readability.Semicolons, []},
46-
{Credo.Check.Readability.SpaceAfterCommas, []},
47-
{Credo.Check.Readability.StringSigils, []},
48-
{Credo.Check.Readability.TrailingBlankLine, []},
49-
{Credo.Check.Readability.TrailingWhiteSpace, []},
50-
{Credo.Check.Readability.UnnecessaryAliasExpansion, []},
51-
{Credo.Check.Readability.VariableNames, []},
52-
{Credo.Check.Refactor.CondStatements, []},
53-
{Credo.Check.Refactor.CyclomaticComplexity, []},
54-
{Credo.Check.Refactor.FunctionArity, []},
55-
{Credo.Check.Refactor.LongQuoteBlocks, []},
56-
{Credo.Check.Refactor.MatchInCondition, []},
57-
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
58-
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
59-
{Credo.Check.Refactor.Nesting, []},
60-
{Credo.Check.Refactor.UnlessWithElse, []},
61-
{Credo.Check.Refactor.WithClauses, []},
62-
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, []},
63-
{Credo.Check.Warning.BoolOperationOnSameValues, []},
64-
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
65-
{Credo.Check.Warning.IExPry, []},
66-
{Credo.Check.Warning.IoInspect, []},
67-
{Credo.Check.Warning.MixEnv, false},
68-
{Credo.Check.Warning.OperationOnSameValues, []},
69-
{Credo.Check.Warning.OperationWithConstantResult, []},
70-
{Credo.Check.Warning.RaiseInsideRescue, []},
71-
{Credo.Check.Warning.UnusedEnumOperation, []},
72-
{Credo.Check.Warning.UnusedFileOperation, []},
73-
{Credo.Check.Warning.UnusedKeywordOperation, []},
74-
{Credo.Check.Warning.UnusedListOperation, []},
75-
{Credo.Check.Warning.UnusedPathOperation, []},
76-
{Credo.Check.Warning.UnusedRegexOperation, []},
77-
{Credo.Check.Warning.UnusedStringOperation, []},
78-
{Credo.Check.Warning.UnusedTupleOperation, []},
79-
{Credo.Check.Warning.UnsafeExec, []},
80-
{Credo.Check.Consistency.MultiAliasImportRequireUse, false},
81-
{Credo.Check.Consistency.UnusedVariableNames, false},
82-
{Credo.Check.Design.DuplicatedCode, false},
83-
{Credo.Check.Readability.AliasAs, false},
84-
{Credo.Check.Readability.BlockPipe, false},
85-
{Credo.Check.Readability.ImplTrue, false},
86-
{Credo.Check.Readability.MultiAlias, false},
87-
{Credo.Check.Readability.SeparateAliasRequire, false},
88-
{Credo.Check.Readability.SinglePipe, false},
89-
{Credo.Check.Readability.Specs, false},
90-
{Credo.Check.Readability.StrictModuleLayout, false},
91-
{Credo.Check.Readability.WithCustomTaggedTuple, false},
92-
{Credo.Check.Refactor.ABCSize, false},
93-
{Credo.Check.Refactor.AppendSingleItem, false},
94-
{Credo.Check.Refactor.DoubleBooleanNegation, false},
95-
{Credo.Check.Refactor.ModuleDependencies, false},
96-
{Credo.Check.Refactor.NegatedIsNil, false},
97-
{Credo.Check.Refactor.PipeChainStart, false},
98-
{Credo.Check.Refactor.VariableRebinding, false},
99-
{Credo.Check.Warning.LeakyEnvironment, false},
100-
{Credo.Check.Warning.MapGetUnsafePass, false},
101-
{Credo.Check.Warning.UnsafeToAtom, false}
102-
]
23+
checks: %{
24+
enabled: [
25+
{Credo.Check.Consistency.ExceptionNames, []},
26+
{Credo.Check.Consistency.LineEndings, []},
27+
{Credo.Check.Consistency.ParameterPatternMatching, []},
28+
{Credo.Check.Consistency.SpaceAroundOperators, []},
29+
{Credo.Check.Consistency.SpaceInParentheses, []},
30+
{Credo.Check.Consistency.TabsOrSpaces, []},
31+
{Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]},
32+
{Credo.Check.Design.TagTODO, [exit_status: 2]},
33+
{Credo.Check.Design.TagFIXME, []},
34+
{Credo.Check.Readability.AliasOrder, []},
35+
{Credo.Check.Readability.FunctionNames, []},
36+
{Credo.Check.Readability.LargeNumbers, []},
37+
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]},
38+
{Credo.Check.Readability.ModuleAttributeNames, []},
39+
{Credo.Check.Readability.ModuleDoc, []},
40+
{Credo.Check.Readability.ModuleNames, []},
41+
{Credo.Check.Readability.ParenthesesInCondition, []},
42+
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
43+
{Credo.Check.Readability.PipeIntoAnonymousFunctions, []},
44+
{Credo.Check.Readability.PredicateFunctionNames, []},
45+
{Credo.Check.Readability.PreferImplicitTry, []},
46+
{Credo.Check.Readability.RedundantBlankLines, []},
47+
{Credo.Check.Readability.Semicolons, []},
48+
{Credo.Check.Readability.SpaceAfterCommas, []},
49+
{Credo.Check.Readability.StringSigils, []},
50+
{Credo.Check.Readability.TrailingBlankLine, []},
51+
{Credo.Check.Readability.TrailingWhiteSpace, []},
52+
{Credo.Check.Readability.UnnecessaryAliasExpansion, []},
53+
{Credo.Check.Readability.VariableNames, []},
54+
{Credo.Check.Readability.WithSingleClause, []},
55+
{Credo.Check.Refactor.Apply, []},
56+
{Credo.Check.Refactor.CondStatements, []},
57+
{Credo.Check.Refactor.CyclomaticComplexity, []},
58+
{Credo.Check.Refactor.FunctionArity, []},
59+
{Credo.Check.Refactor.LongQuoteBlocks, []},
60+
{Credo.Check.Refactor.MatchInCondition, []},
61+
{Credo.Check.Refactor.MapJoin, []},
62+
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
63+
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
64+
{Credo.Check.Refactor.Nesting, []},
65+
{Credo.Check.Refactor.UnlessWithElse, []},
66+
{Credo.Check.Refactor.WithClauses, []},
67+
{Credo.Check.Refactor.FilterCount, []},
68+
{Credo.Check.Refactor.FilterFilter, []},
69+
{Credo.Check.Refactor.RejectReject, []},
70+
{Credo.Check.Refactor.RedundantWithClauseResult, []},
71+
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, []},
72+
{Credo.Check.Warning.BoolOperationOnSameValues, []},
73+
{Credo.Check.Warning.Dbg, []},
74+
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
75+
{Credo.Check.Warning.IExPry, []},
76+
{Credo.Check.Warning.IoInspect, []},
77+
{Credo.Check.Warning.MissedMetadataKeyInLoggerConfig, []},
78+
{Credo.Check.Warning.OperationOnSameValues, []},
79+
{Credo.Check.Warning.OperationWithConstantResult, []},
80+
{Credo.Check.Warning.RaiseInsideRescue, []},
81+
{Credo.Check.Warning.SpecWithStruct, []},
82+
{Credo.Check.Warning.WrongTestFileExtension, []},
83+
{Credo.Check.Warning.UnusedEnumOperation, []},
84+
{Credo.Check.Warning.UnusedFileOperation, []},
85+
{Credo.Check.Warning.UnusedKeywordOperation, []},
86+
{Credo.Check.Warning.UnusedListOperation, []},
87+
{Credo.Check.Warning.UnusedPathOperation, []},
88+
{Credo.Check.Warning.UnusedRegexOperation, []},
89+
{Credo.Check.Warning.UnusedStringOperation, []},
90+
{Credo.Check.Warning.UnusedTupleOperation, []},
91+
{Credo.Check.Warning.UnsafeExec, []}
92+
],
93+
disabled: [
94+
{Credo.Check.Consistency.MultiAliasImportRequireUse, []},
95+
{Credo.Check.Consistency.UnusedVariableNames, []},
96+
{Credo.Check.Design.DuplicatedCode, []},
97+
{Credo.Check.Design.SkipTestWithoutComment, []},
98+
{Credo.Check.Readability.AliasAs, []},
99+
{Credo.Check.Readability.BlockPipe, []},
100+
{Credo.Check.Readability.ImplTrue, []},
101+
{Credo.Check.Readability.MultiAlias, []},
102+
{Credo.Check.Readability.NestedFunctionCalls, []},
103+
{Credo.Check.Readability.OneArityFunctionInPipe, []},
104+
{Credo.Check.Readability.SeparateAliasRequire, []},
105+
{Credo.Check.Readability.SingleFunctionToBlockPipe, []},
106+
{Credo.Check.Readability.SinglePipe, []},
107+
{Credo.Check.Readability.Specs, []},
108+
{Credo.Check.Readability.StrictModuleLayout, []},
109+
{Credo.Check.Readability.WithCustomTaggedTuple, []},
110+
{Credo.Check.Readability.OnePipePerLine, []},
111+
{Credo.Check.Refactor.ABCSize, []},
112+
{Credo.Check.Refactor.AppendSingleItem, []},
113+
{Credo.Check.Refactor.DoubleBooleanNegation, []},
114+
{Credo.Check.Refactor.FilterReject, []},
115+
{Credo.Check.Refactor.IoPuts, []},
116+
{Credo.Check.Refactor.MapMap, []},
117+
{Credo.Check.Refactor.ModuleDependencies, []},
118+
{Credo.Check.Refactor.NegatedIsNil, []},
119+
{Credo.Check.Refactor.PassAsyncInTestCases, []},
120+
{Credo.Check.Refactor.PipeChainStart, []},
121+
{Credo.Check.Refactor.RejectFilter, []},
122+
{Credo.Check.Refactor.VariableRebinding, []},
123+
{Credo.Check.Warning.LazyLogging, []},
124+
{Credo.Check.Warning.LeakyEnvironment, []},
125+
{Credo.Check.Warning.MapGetUnsafePass, []},
126+
{Credo.Check.Warning.MixEnv, []},
127+
{Credo.Check.Warning.UnsafeToAtom, []}
128+
]
129+
}
103130
}
104131
]
105132
}

lib/mnesiac/store_manager.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ defmodule Mnesiac.StoreManager do
125125
This function returns a map of tables and their cookies.
126126
"""
127127
def get_table_cookies(node \\ node()) do
128-
tables = :rpc.call(node, :mnesia, :system_info, [:tables])
128+
tables = :rpc.call(node, :mnesia, :system_info, [:local_tables])
129129

130130
Enum.reduce(tables, %{}, fn t, acc ->
131131
Map.put(acc, t, :rpc.call(node, :mnesia, :table_info, [t, :cookie]))

lib/mnesiac/supervisor.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Mnesiac.Supervisor do
1414
@impl true
1515
def init([config, opts]) do
1616
Logger.info("[mnesiac:#{node()}] mnesiac starting...")
17-
Mnesiac.init_mnesia(config)
17+
:ok = Mnesiac.init_mnesia(config)
1818
Logger.info("[mnesiac:#{node()}] mnesiac started")
1919

2020
opts = Keyword.put(opts, :strategy, :one_for_one)

mix.exs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule Mnesiac.MixProject do
66
def project do
77
[
88
app: :mnesiac,
9-
version: "0.3.9",
9+
version: "0.3.10",
1010
elixir: "~> 1.8",
1111
elixirc_paths: elixirc_paths(Mix.env()),
1212
test_coverage: [tool: ExCoveralls],
@@ -69,12 +69,12 @@ defmodule Mnesiac.MixProject do
6969

7070
defp deps do
7171
[
72-
{:libcluster, "~> 3.2", optional: true},
73-
{:credo, "~> 1.5", only: [:dev], runtime: false},
74-
{:dialyxir, "~> 1.1", only: [:dev], runtime: false},
75-
{:ex_doc, "~> 0.23", only: [:dev], runtime: false},
76-
{:ex_unit_clustered_case, "~> 0.4", only: [:test]},
77-
{:excoveralls, "~> 0.14", only: [:test], runtime: false},
72+
{:libcluster, "~> 3.3", optional: true},
73+
{:credo, "~> 1.7", only: [:dev], runtime: false},
74+
{:dialyxir, "~> 1.3", only: [:dev], runtime: false},
75+
{:ex_doc, "~> 0.29", only: [:dev], runtime: false},
76+
{:ex_unit_clustered_case, "~> 0.5", only: [:test]},
77+
{:excoveralls, "~> 0.16", only: [:test], runtime: false},
7878
{:inch_ex, "~> 2.0", only: [:dev], runtime: false}
7979
]
8080
end

0 commit comments

Comments
 (0)