Skip to content

Commit df182bb

Browse files
authored
Make repo up to date with membrane_template_plugin (#12)
* Update mix.exs * Change deps to core * Fix credo issues * Update deps
1 parent b48aecd commit df182bb

File tree

9 files changed

+44
-52
lines changed

9 files changed

+44
-52
lines changed

.circleci/config.yml

+6-33
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,11 @@
1-
version: 2.0
2-
jobs:
3-
test:
4-
docker:
5-
- image: membraneframeworklabs/docker_membrane
6-
environment:
7-
MIX_ENV: test
8-
9-
working_directory: ~/app
10-
11-
steps:
12-
- checkout
13-
- run: mix deps.get
14-
- run: mix compile --force --warnings-as-errors
15-
- run: mix test
16-
17-
lint:
18-
docker:
19-
- image: membrane/membrane:latest
20-
environment:
21-
MIX_ENV: dev
22-
23-
working_directory: ~/app
24-
25-
steps:
26-
- checkout
27-
- run: mix deps.get
28-
- run: mix format --check-formatted
29-
- run: mix compile
30-
- run: mix credo
31-
- run: mix docs && mix docs 2>&1 | (! grep -q "warning:")
1+
version: 2.1
2+
orbs:
3+
elixir: membraneframework/elixir@1
324

335
workflows:
346
version: 2
357
build:
368
jobs:
37-
- test
38-
- lint
9+
- elixir/build_test
10+
- elixir/test
11+
- elixir/lint

.credo.exs

+6-4
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
#
9494
## Readability Checks
9595
#
96-
{Credo.Check.Readability.AliasOrder, []},
96+
{Credo.Check.Readability.AliasOrder, [priority: :normal]},
9797
{Credo.Check.Readability.FunctionNames, []},
9898
{Credo.Check.Readability.LargeNumbers, []},
9999
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]},
@@ -112,6 +112,7 @@
112112
{Credo.Check.Readability.TrailingWhiteSpace, []},
113113
{Credo.Check.Readability.UnnecessaryAliasExpansion, []},
114114
{Credo.Check.Readability.VariableNames, []},
115+
{Credo.Check.Readability.WithSingleClause, false},
115116

116117
#
117118
## Refactoring Opportunities
@@ -126,7 +127,7 @@
126127
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
127128
{Credo.Check.Refactor.Nesting, []},
128129
{Credo.Check.Refactor.UnlessWithElse, []},
129-
{Credo.Check.Refactor.WithClauses, false},
130+
{Credo.Check.Refactor.WithClauses, []},
130131

131132
#
132133
## Warnings
@@ -156,9 +157,10 @@
156157
#
157158
# Controversial and experimental checks (opt-in, just replace `false` with `[]`)
158159
#
159-
{Credo.Check.Readability.StrictModuleLayout, priority: :normal},
160+
{Credo.Check.Readability.StrictModuleLayout,
161+
priority: :normal, order: ~w/shortdoc moduledoc behaviour use import require alias/a},
160162
{Credo.Check.Consistency.MultiAliasImportRequireUse, false},
161-
{Credo.Check.Consistency.UnusedVariableNames, []},
163+
{Credo.Check.Consistency.UnusedVariableNames, force: :meaningful},
162164
{Credo.Check.Design.DuplicatedCode, false},
163165
{Credo.Check.Readability.AliasAs, false},
164166
{Credo.Check.Readability.MultiAlias, false},

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ compile_commands.json
33
bundlex.sh
44
bundlex.bat
55

6+
# Dir generated by tmp_dir ExUnit tag
7+
/tmp/
8+
69
# Created by https://www.gitignore.io/api/c,vim,linux,macos,elixir,windows,visualstudiocode
710
# Edit at https://www.gitignore.io/?templates=c,vim,linux,macos,elixir,windows,visualstudiocode
811

@@ -175,4 +178,4 @@ $RECYCLE.BIN/
175178

176179
# End of https://www.gitignore.io/api/c,vim,linux,macos,elixir,windows,visualstudiocode
177180

178-
test/results
181+
test/results

lib/deserializer.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ defmodule Membrane.Element.IVF.Deserializer do
77
use Membrane.Filter
88
use Ratio
99

10-
alias Membrane.{Time, RemoteStream, Buffer}
11-
alias Membrane.{VP9, VP8}
1210
alias Membrane.Element.IVF.Headers
1311
alias Membrane.Element.IVF.Headers.FrameHeader
12+
alias Membrane.{Buffer, RemoteStream, Time}
13+
alias Membrane.{VP8, VP9}
1414

1515
def_input_pad :input, caps: :any, demand_mode: :auto, demand_unit: :buffers
1616

lib/membrane_element_ivf/headers.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Membrane.Element.IVF.Headers do
22
@moduledoc false
33

4-
alias Membrane.{VP9, VP8}
4+
alias Membrane.{VP8, VP9}
55

66
defmodule FileHeader do
77
@moduledoc """

lib/serializer.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule Membrane.Element.IVF.Serializer do
77

88
alias Membrane.Element.IVF
99
alias Membrane.{Buffer, RemoteStream}
10-
alias Membrane.{VP9, VP8}
10+
alias Membrane.{VP8, VP9}
1111

1212
def_options width: [spec: [integer], description: "width of frame"],
1313
height: [spec: [integer], description: "height of frame"],

mix.exs

+18-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ defmodule Membrane.IVF.Plugin.MixProject do
1212
elixirc_paths: elixirc_paths(Mix.env()),
1313
start_permanent: Mix.env() == :prod,
1414
deps: deps(),
15+
dialyzer: dialyzer(),
1516

1617
# hex
1718
description: "Membrane plugin for IVF container",
@@ -37,13 +38,26 @@ defmodule Membrane.IVF.Plugin.MixProject do
3738
defp deps do
3839
[
3940
{:membrane_core, github: "membraneframework/membrane_core", override: true},
40-
{:ex_doc, "~> 0.24", only: :dev, runtime: false},
41-
{:dialyxir, "~> 1.1.0", only: :dev, runtime: false},
42-
{:credo, "~> 1.4", only: :dev, runtime: false},
41+
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
42+
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
43+
{:credo, ">= 0.0.0", only: :dev, runtime: false},
4344
{:membrane_file_plugin, "~> 0.12.0", only: :test}
4445
]
4546
end
4647

48+
defp dialyzer() do
49+
opts = [
50+
flags: [:error_handling]
51+
]
52+
53+
if System.get_env("CI") == "true" do
54+
# Store PLTs in cacheable directory for CI
55+
[plt_local_path: "priv/plts", plt_core_path: "priv/plts"] ++ opts
56+
else
57+
opts
58+
end
59+
end
60+
4761
defp package do
4862
[
4963
maintainers: ["Membrane Team"],
@@ -59,6 +73,7 @@ defmodule Membrane.IVF.Plugin.MixProject do
5973
[
6074
main: "readme",
6175
extras: ["README.md", "LICENSE"],
76+
formatters: ["html"],
6277
source_ref: "v#{@version}",
6378
nest_modules_by_prefix: [Membrane.IVF]
6479
]

mix.lock

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
%{
22
"bunch": {:hex, :bunch, "1.3.1", "f8fe80042f9eb474ef2801ae2c9372f9b13d11e7053265dcfc24b9d912e3750b", [:mix], [], "hexpm", "00e21b16ff9bb698b728a01a2fc4b3bf7fc0e87c4bb9c6e4a442324aa8c5e567"},
3-
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
3+
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
44
"coerce": {:hex, :coerce, "1.0.1", "211c27386315dc2894ac11bc1f413a0e38505d808153367bd5c6e75a4003d096", [:mix], [], "hexpm", "b44a691700f7a1a15b4b7e2ff1fa30bebd669929ac8aa43cffe9e2f8bf051cf1"},
5-
"credo": {:hex, :credo, "1.6.5", "330ca591c12244ab95498d8f47994c493064b2689febf1236d43d596b4f2261d", [: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", "101de53e6907397c3246ccd2cc9b9f0d3fc0b7805b8e1c1c3d818471fc85bafd"},
6-
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
5+
"credo": {:hex, :credo, "1.6.6", "f51f8d45db1af3b2e2f7bee3e6d3c871737bda4a91bff00c5eec276517d1a19c", [: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", "625520ce0984ee0f9f1f198165cd46fa73c1e59a17ebc520038b8fce056a5bdc"},
6+
"dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"},
77
"earmark_parser": {:hex, :earmark_parser, "1.4.26", "f4291134583f373c7d8755566122908eb9662df4c4b63caa66a0eabe06569b0a", [:mix], [], "hexpm", "48d460899f8a0c52c5470676611c01f64f3337bad0b26ddab43648428d94aabc"},
88
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
9-
"ex_doc": {:hex, :ex_doc, "0.28.4", "001a0ea6beac2f810f1abc3dbf4b123e9593eaa5f00dd13ded024eae7c523298", [: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", "bf85d003dd34911d89c8ddb8bda1a958af3471a274a4c2150a9c01c78ac3f8ed"},
9+
"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"},
1010
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
1111
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
1212
"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"},
1313
"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"},
1414
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
15-
"membrane_core": {:git, "https://github.com/membraneframework/membrane_core.git", "f6e0922924016414116b761edb6360aab5f45c3b", []},
15+
"membrane_core": {:git, "https://github.com/membraneframework/membrane_core.git", "33c0b4b3419426233d6898f873d7bb045025948c", []},
1616
"membrane_file_plugin": {:hex, :membrane_file_plugin, "0.12.0", "eb940e7a2f2abf30e048bd0b7c2bef9c17c18aa58875b9a833c0bc7e7b1fd709", [:mix], [{:membrane_core, "~> 0.10.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "281b9bf9467beead3f973adce55b9844bc4206bb3f3f60f0db8320a4af4fc5ca"},
17-
"mockery": {:hex, :mockery, "2.3.1", "a02fd60b10ac9ed37a7a2ecf6786c1f1dd5c75d2b079a60594b089fba32dc087", [:mix], [], "hexpm", "1d0971d88ebf084e962da3f2cfee16f0ea8e04ff73a7710428500d4500b947fa"},
1817
"nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"},
1918
"numbers": {:hex, :numbers, "5.2.4", "f123d5bb7f6acc366f8f445e10a32bd403c8469bdbce8ce049e1f0972b607080", [:mix], [{:coerce, "~> 1.0", [hex: :coerce, repo: "hexpm", optional: false]}, {:decimal, "~> 1.9 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "eeccf5c61d5f4922198395bf87a465b6f980b8b862dd22d28198c5e6fab38582"},
2019
"qex": {:hex, :qex, "0.5.1", "0d82c0f008551d24fffb99d97f8299afcb8ea9cf99582b770bd004ed5af63fd6", [:mix], [], "hexpm", "935a39fdaf2445834b95951456559e9dc2063d0a055742c558a99987b38d6bab"},

test/serializer_test.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Membrane.Element.IVF.SerializerTest do
44

55
import Membrane.Testing.Assertions
66

7-
alias Membrane.{Testing, RemoteStream, Buffer}
7+
alias Membrane.{Buffer, RemoteStream, Testing}
88
alias Membrane.Element.IVF
99
alias Membrane.VP9
1010

0 commit comments

Comments
 (0)