Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 74d9acf

Browse files
authoredSep 23, 2022
Elixir 1.14
* Elixir 1.14 and OTP 24/25 * Elixir minimum of 1.10 * Fix "Failed to load NIF library" in CI * Credo 1.6 * Use Config
1 parent 8a3274c commit 74d9acf

File tree

6 files changed

+236
-18
lines changed

6 files changed

+236
-18
lines changed
 

‎.credo.exs

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# This file contains the configuration for Credo and you are probably reading
2+
# this after creating it with `mix credo.gen.config`.
3+
#
4+
# If you find anything wrong or unclear in this file, please report an
5+
# issue on GitHub: https://github.com/rrrene/credo/issues
6+
#
7+
%{
8+
#
9+
# You can have as many configs as you like in the `configs:` field.
10+
configs: [
11+
%{
12+
#
13+
# Run any config using `mix credo -C <name>`. If no config name is given
14+
# "default" is used.
15+
#
16+
name: "default",
17+
#
18+
# These are the files included in the analysis:
19+
files: %{
20+
#
21+
# You can give explicit globs or simply directories.
22+
# In the latter case `**/*.{ex,exs}` will be used.
23+
#
24+
included: [
25+
"lib/",
26+
"src/",
27+
"test/",
28+
"web/",
29+
"apps/*/lib/",
30+
"apps/*/src/",
31+
"apps/*/test/",
32+
"apps/*/web/"
33+
],
34+
excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"]
35+
},
36+
#
37+
# Load and configure plugins here:
38+
#
39+
plugins: [],
40+
#
41+
# If you create your own checks, you must specify the source files for
42+
# them here, so they can be loaded by Credo before running the analysis.
43+
#
44+
requires: [],
45+
#
46+
# If you want to enforce a style guide and need a more traditional linting
47+
# experience, you can change `strict` to `true` below:
48+
#
49+
strict: false,
50+
#
51+
# To modify the timeout for parsing files, change this value:
52+
#
53+
parse_timeout: 5000,
54+
#
55+
# If you want to use uncolored output by default, you can change `color`
56+
# to `false` below:
57+
#
58+
color: true,
59+
#
60+
# You can customize the parameters of any check by adding a second element
61+
# to the tuple.
62+
#
63+
# To disable a check put `false` as second element:
64+
#
65+
# {Credo.Check.Design.DuplicatedCode, false}
66+
#
67+
checks: %{
68+
enabled: [
69+
#
70+
## Consistency Checks
71+
#
72+
{Credo.Check.Consistency.ExceptionNames, []},
73+
{Credo.Check.Consistency.LineEndings, []},
74+
{Credo.Check.Consistency.ParameterPatternMatching, []},
75+
{Credo.Check.Consistency.SpaceAroundOperators, []},
76+
{Credo.Check.Consistency.SpaceInParentheses, []},
77+
{Credo.Check.Consistency.TabsOrSpaces, []},
78+
79+
#
80+
## Design Checks
81+
#
82+
# You can customize the priority of any check
83+
# Priority values are: `low, normal, high, higher`
84+
#
85+
{Credo.Check.Design.AliasUsage,
86+
[priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]},
87+
# You can also customize the exit_status of each check.
88+
# If you don't want TODO comments to cause `mix credo` to fail, just
89+
# set this value to 0 (zero).
90+
#
91+
{Credo.Check.Design.TagTODO, [exit_status: 2]},
92+
{Credo.Check.Design.TagFIXME, []},
93+
94+
#
95+
## Readability Checks
96+
#
97+
{Credo.Check.Readability.AliasOrder, []},
98+
{Credo.Check.Readability.FunctionNames, []},
99+
{Credo.Check.Readability.LargeNumbers, []},
100+
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]},
101+
{Credo.Check.Readability.ModuleAttributeNames, []},
102+
{Credo.Check.Readability.ModuleDoc, []},
103+
{Credo.Check.Readability.ModuleNames, []},
104+
{Credo.Check.Readability.ParenthesesInCondition, []},
105+
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
106+
{Credo.Check.Readability.PipeIntoAnonymousFunctions, []},
107+
{Credo.Check.Readability.PredicateFunctionNames, []},
108+
{Credo.Check.Readability.PreferImplicitTry, []},
109+
{Credo.Check.Readability.RedundantBlankLines, []},
110+
{Credo.Check.Readability.Semicolons, []},
111+
{Credo.Check.Readability.SpaceAfterCommas, []},
112+
{Credo.Check.Readability.StringSigils, []},
113+
{Credo.Check.Readability.TrailingBlankLine, []},
114+
{Credo.Check.Readability.TrailingWhiteSpace, []},
115+
{Credo.Check.Readability.UnnecessaryAliasExpansion, []},
116+
{Credo.Check.Readability.VariableNames, []},
117+
{Credo.Check.Readability.WithSingleClause, []},
118+
119+
#
120+
## Refactoring Opportunities
121+
#
122+
{Credo.Check.Refactor.Apply, []},
123+
{Credo.Check.Refactor.CondStatements, []},
124+
{Credo.Check.Refactor.CyclomaticComplexity, []},
125+
{Credo.Check.Refactor.FunctionArity, []},
126+
{Credo.Check.Refactor.LongQuoteBlocks, []},
127+
{Credo.Check.Refactor.MatchInCondition, []},
128+
{Credo.Check.Refactor.MapJoin, [exit_status: 0]},
129+
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
130+
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
131+
{Credo.Check.Refactor.Nesting, []},
132+
{Credo.Check.Refactor.UnlessWithElse, []},
133+
{Credo.Check.Refactor.WithClauses, []},
134+
{Credo.Check.Refactor.FilterFilter, []},
135+
{Credo.Check.Refactor.RejectReject, []},
136+
{Credo.Check.Refactor.RedundantWithClauseResult, []},
137+
138+
#
139+
## Warnings
140+
#
141+
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, []},
142+
{Credo.Check.Warning.BoolOperationOnSameValues, []},
143+
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
144+
{Credo.Check.Warning.IExPry, []},
145+
{Credo.Check.Warning.IoInspect, []},
146+
{Credo.Check.Warning.OperationOnSameValues, []},
147+
{Credo.Check.Warning.OperationWithConstantResult, []},
148+
{Credo.Check.Warning.RaiseInsideRescue, []},
149+
{Credo.Check.Warning.SpecWithStruct, []},
150+
{Credo.Check.Warning.WrongTestFileExtension, []},
151+
{Credo.Check.Warning.UnusedEnumOperation, []},
152+
{Credo.Check.Warning.UnusedFileOperation, []},
153+
{Credo.Check.Warning.UnusedKeywordOperation, []},
154+
{Credo.Check.Warning.UnusedListOperation, []},
155+
{Credo.Check.Warning.UnusedPathOperation, []},
156+
{Credo.Check.Warning.UnusedRegexOperation, []},
157+
{Credo.Check.Warning.UnusedStringOperation, []},
158+
{Credo.Check.Warning.UnusedTupleOperation, []},
159+
{Credo.Check.Warning.UnsafeExec, []}
160+
],
161+
disabled: [
162+
#
163+
# Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`)
164+
165+
#
166+
# Controversial and experimental checks (opt-in, just move the check to `:enabled`
167+
# and be sure to use `mix credo --strict` to see low priority checks)
168+
#
169+
{Credo.Check.Consistency.MultiAliasImportRequireUse, []},
170+
{Credo.Check.Consistency.UnusedVariableNames, []},
171+
{Credo.Check.Design.DuplicatedCode, []},
172+
{Credo.Check.Design.SkipTestWithoutComment, []},
173+
{Credo.Check.Readability.AliasAs, []},
174+
{Credo.Check.Readability.BlockPipe, []},
175+
{Credo.Check.Readability.ImplTrue, []},
176+
{Credo.Check.Readability.MultiAlias, []},
177+
{Credo.Check.Readability.NestedFunctionCalls, []},
178+
{Credo.Check.Readability.SeparateAliasRequire, []},
179+
{Credo.Check.Readability.SingleFunctionToBlockPipe, []},
180+
{Credo.Check.Readability.SinglePipe, []},
181+
{Credo.Check.Readability.Specs, []},
182+
{Credo.Check.Readability.StrictModuleLayout, []},
183+
{Credo.Check.Readability.WithCustomTaggedTuple, []},
184+
{Credo.Check.Refactor.ABCSize, []},
185+
{Credo.Check.Refactor.AppendSingleItem, []},
186+
{Credo.Check.Refactor.DoubleBooleanNegation, []},
187+
{Credo.Check.Refactor.FilterReject, []},
188+
{Credo.Check.Refactor.IoPuts, []},
189+
{Credo.Check.Refactor.MapMap, []},
190+
{Credo.Check.Refactor.ModuleDependencies, []},
191+
{Credo.Check.Refactor.NegatedIsNil, []},
192+
{Credo.Check.Refactor.PipeChainStart, []},
193+
{Credo.Check.Refactor.RejectFilter, []},
194+
{Credo.Check.Refactor.VariableRebinding, []},
195+
{Credo.Check.Warning.LazyLogging, []},
196+
{Credo.Check.Warning.LeakyEnvironment, []},
197+
{Credo.Check.Warning.MapGetUnsafePass, []},
198+
{Credo.Check.Warning.MixEnv, []},
199+
{Credo.Check.Warning.UnsafeToAtom, []}
200+
201+
# {Credo.Check.Refactor.MapInto, []},
202+
203+
#
204+
# Custom checks can be created using `mix credo.gen.check`.
205+
#
206+
]
207+
}
208+
}
209+
]
210+
}

‎.github/workflows/ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,25 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
otp: ['22.3.4']
12-
elixir: ['1.11', '1.10.4', '1.9.4', '1.8.2', '1.7.4']
11+
otp: ["23.3.4", "24.3.4"]
12+
elixir: ["1.14", "1.13", "1.12", "1.11.4", "1.10.4"]
13+
exclude:
14+
- elixir: "1.10.4"
15+
otp: "24.3.4"
16+
include:
17+
- elixir: "1.14"
18+
otp: "25.1"
1319
steps:
1420
- uses: actions/checkout@v2
1521
- uses: actions/setup-elixir@v1
1622
with:
1723
otp-version: ${{matrix.otp}}
1824
elixir-version: ${{matrix.elixir}}
25+
experimental-otp: true
1926
- run: mix deps.get
2027
- run: mix compile --warnings-as-errors
2128
- run: mix credo --strict
2229
- name: "Check formatted?"
2330
run: mix format mix.exs "examples/*.exs" "lib/**/*.{ex,exs}" "test/**/*.exs" --check-formatted
24-
if: ${{ startsWith(matrix.elixir, '1.11') }}
31+
if: ${{ startsWith(matrix.elixir, '1.14') }}
2532
- run: mix test --exclude gnuplot:true

‎README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ This library is [available in Hex](https://hex.pm/packages/gnuplot) with [docume
116116
```elixir
117117
def deps do
118118
[
119-
{:gnuplot, "~> 1.20"}
119+
{:gnuplot, "~> 1.22"}
120120
]
121121
end
122122
```
@@ -182,7 +182,7 @@ Gnuplot.plot([
182182

183183
Original design ©2015 [Kyle Kingsbury][2].
184184

185-
Elixir code ©2020 [DEVSTOPFIX LTD][3]. Contributions from [piisgaaf](https://github.com/piisgaaf)
185+
Elixir code ©2022 [DEVSTOPFIX LTD][3]. Contributions from [piisgaaf](https://github.com/piisgaaf)
186186

187187
Distributed under the [Eclipse Public License v2][6].
188188

‎config/config.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
use Mix.Config
1+
import Config
22

33
config :gnuplot, timeout: {10_000, :ms}

‎mix.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ defmodule Gnuplot.MixProject do
44
def project do
55
[
66
app: :gnuplot,
7-
version: "1.20.320",
8-
elixir: "~> 1.7",
7+
version: "1.22.266",
8+
elixir: "~> 1.10",
99
start_permanent: Mix.env() == :prod,
1010
description: "Interface between Elixir and Gnuplot graphing library",
1111
deps: deps(),
@@ -27,9 +27,9 @@ defmodule Gnuplot.MixProject do
2727

2828
defp deps do
2929
[
30-
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
30+
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
3131
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
32-
{:ex_doc, "~> 0.23.0"}
32+
{:ex_doc, "~> 0.28"}
3333
]
3434
end
3535

‎mix.lock

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
%{
2-
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
3-
"credo": {:hex, :credo, "1.5.4", "9914180105b438e378e94a844ec3a5088ae5875626fc945b7c1462b41afc3198", [:mix], [{:bunt, "~> 0.2.0", [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", "cf51af45eadc0a3f39ba13b56fdac415c91b34f7b7533a13dc13550277141bc4"},
2+
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
3+
"credo": {:hex, :credo, "1.6.7", "323f5734350fd23a456f2688b9430e7d517afb313fbd38671b8a4449798a7854", [: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", "41e110bfb007f7eda7f897c10bf019ceab9a0b269ce79f015d54b0dcf4fc7dd3"},
44
"dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"},
55
"earmark": {:hex, :earmark, "1.4.3", "364ca2e9710f6bff494117dbbd53880d84bebb692dafc3a78eb50aa3183f2bfd", [:mix], [], "hexpm", "8cf8a291ebf1c7b9539e3cddb19e9cef066c2441b1640f13c34c1d3cfc825fec"},
6-
"earmark_parser": {:hex, :earmark_parser, "1.4.10", "6603d7a603b9c18d3d20db69921527f82ef09990885ed7525003c7fe7dc86c56", [:mix], [], "hexpm", "8e2d5370b732385db2c9b22215c3f59c84ac7dda7ed7e544d7c459496ae519c0"},
6+
"earmark_parser": {:hex, :earmark_parser, "1.4.26", "f4291134583f373c7d8755566122908eb9662df4c4b63caa66a0eabe06569b0a", [:mix], [], "hexpm", "48d460899f8a0c52c5470676611c01f64f3337bad0b26ddab43648428d94aabc"},
77
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
8-
"ex_doc": {:hex, :ex_doc, "0.23.0", "a069bc9b0bf8efe323ecde8c0d62afc13d308b1fa3d228b65bca5cf8703a529d", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f5e2c4702468b2fd11b10d39416ddadd2fcdd173ba2a0285ebd92c39827a5a16"},
8+
"ex_doc": {:hex, :ex_doc, "0.28.5", "3e52a6d2130ce74d096859e477b97080c156d0926701c13870a4e1f752363279", [:mix], [{:earmark_parser, "~> 1.4.19", [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", "d2c4b07133113e9aa3e9ba27efb9088ba900e9e51caa383919676afdf09ab181"},
99
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
10-
"jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
11-
"makeup": {:hex, :makeup, "1.0.1", "82f332e461dc6c79dbd82fbe2a9c10d48ed07146f0a478286e590c83c52010b5", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "49736fe5b66a08d8575bf5321d716bac5da20c8e6b97714fec2bcd6febcfa1f8"},
12-
"makeup_elixir": {:hex, :makeup_elixir, "0.14.0", "cf8b7c66ad1cff4c14679698d532f0b5d45a3968ffbcbfd590339cb57742f1ae", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "d4b316c7222a85bbaa2fd7c6e90e37e953257ad196dc229505137c5e505e9eff"},
10+
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
11+
"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"},
12+
"makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"},
13+
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
1314
"mix_test_watch": {:hex, :mix_test_watch, "1.0.2", "34900184cbbbc6b6ed616ed3a8ea9b791f9fd2088419352a6d3200525637f785", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "47ac558d8b06f684773972c6d04fcc15590abdb97aeb7666da19fcbfdc441a07"},
14-
"nimble_parsec": {:hex, :nimble_parsec, "0.5.3", "def21c10a9ed70ce22754fdeea0810dafd53c2db3219a0cd54cf5526377af1c6", [:mix], [], "hexpm", "589b5af56f4afca65217a1f3eb3fee7e79b09c40c742fddc1c312b3ac0b3399f"},
15+
"nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"},
1516
}

0 commit comments

Comments
 (0)
Please sign in to comment.