Skip to content

Commit 9afe6ed

Browse files
authored
Initial commit
0 parents  commit 9afe6ed

15 files changed

+860
-0
lines changed

.circleci/config.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 2.1
2+
orbs:
3+
elixir: membraneframework/elixir@1
4+
5+
workflows:
6+
version: 2
7+
build:
8+
jobs:
9+
- elixir/build_test:
10+
filters: &filters
11+
tags:
12+
only: /v.*/
13+
- elixir/test:
14+
filters:
15+
<<: *filters
16+
- elixir/lint:
17+
filters:
18+
<<: *filters
19+
- elixir/hex_publish:
20+
requires:
21+
- elixir/build_test
22+
- elixir/test
23+
- elixir/lint
24+
context:
25+
- Deployment
26+
filters:
27+
branches:
28+
ignore: /.*/
29+
tags:
30+
only: /v.*/

.credo.exs

+187
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
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+
#
69+
## Consistency Checks
70+
#
71+
{Credo.Check.Consistency.ExceptionNames, []},
72+
{Credo.Check.Consistency.LineEndings, []},
73+
{Credo.Check.Consistency.ParameterPatternMatching, []},
74+
{Credo.Check.Consistency.SpaceAroundOperators, []},
75+
{Credo.Check.Consistency.SpaceInParentheses, []},
76+
{Credo.Check.Consistency.TabsOrSpaces, []},
77+
78+
#
79+
## Design Checks
80+
#
81+
# You can customize the priority of any check
82+
# Priority values are: `low, normal, high, higher`
83+
#
84+
{Credo.Check.Design.AliasUsage,
85+
[priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]},
86+
# You can also customize the exit_status of each check.
87+
# If you don't want TODO comments to cause `mix credo` to fail, just
88+
# set this value to 0 (zero).
89+
#
90+
{Credo.Check.Design.TagTODO, [exit_status: 0]},
91+
{Credo.Check.Design.TagFIXME, []},
92+
93+
#
94+
## Readability Checks
95+
#
96+
{Credo.Check.Readability.AliasOrder, [priority: :normal]},
97+
{Credo.Check.Readability.FunctionNames, []},
98+
{Credo.Check.Readability.LargeNumbers, []},
99+
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]},
100+
{Credo.Check.Readability.ModuleAttributeNames, []},
101+
{Credo.Check.Readability.ModuleDoc, []},
102+
{Credo.Check.Readability.ModuleNames, []},
103+
{Credo.Check.Readability.ParenthesesInCondition, []},
104+
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, parens: true},
105+
{Credo.Check.Readability.PredicateFunctionNames, []},
106+
{Credo.Check.Readability.PreferImplicitTry, []},
107+
{Credo.Check.Readability.RedundantBlankLines, []},
108+
{Credo.Check.Readability.Semicolons, []},
109+
{Credo.Check.Readability.SpaceAfterCommas, []},
110+
{Credo.Check.Readability.StringSigils, []},
111+
{Credo.Check.Readability.TrailingBlankLine, []},
112+
{Credo.Check.Readability.TrailingWhiteSpace, []},
113+
{Credo.Check.Readability.UnnecessaryAliasExpansion, []},
114+
{Credo.Check.Readability.VariableNames, []},
115+
{Credo.Check.Readability.WithSingleClause, false},
116+
117+
#
118+
## Refactoring Opportunities
119+
#
120+
{Credo.Check.Refactor.CondStatements, []},
121+
{Credo.Check.Refactor.CyclomaticComplexity, []},
122+
{Credo.Check.Refactor.FunctionArity, []},
123+
{Credo.Check.Refactor.LongQuoteBlocks, []},
124+
{Credo.Check.Refactor.MapInto, false},
125+
{Credo.Check.Refactor.MatchInCondition, []},
126+
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
127+
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
128+
{Credo.Check.Refactor.Nesting, []},
129+
{Credo.Check.Refactor.UnlessWithElse, []},
130+
{Credo.Check.Refactor.WithClauses, []},
131+
132+
#
133+
## Warnings
134+
#
135+
{Credo.Check.Warning.BoolOperationOnSameValues, []},
136+
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
137+
{Credo.Check.Warning.IExPry, []},
138+
{Credo.Check.Warning.IoInspect, []},
139+
{Credo.Check.Warning.LazyLogging, false},
140+
{Credo.Check.Warning.MixEnv, []},
141+
{Credo.Check.Warning.OperationOnSameValues, []},
142+
{Credo.Check.Warning.OperationWithConstantResult, []},
143+
{Credo.Check.Warning.RaiseInsideRescue, []},
144+
{Credo.Check.Warning.UnusedEnumOperation, []},
145+
{Credo.Check.Warning.UnusedFileOperation, []},
146+
{Credo.Check.Warning.UnusedKeywordOperation, []},
147+
{Credo.Check.Warning.UnusedListOperation, []},
148+
{Credo.Check.Warning.UnusedPathOperation, []},
149+
{Credo.Check.Warning.UnusedRegexOperation, []},
150+
{Credo.Check.Warning.UnusedStringOperation, []},
151+
{Credo.Check.Warning.UnusedTupleOperation, []},
152+
{Credo.Check.Warning.UnsafeExec, []},
153+
154+
#
155+
# Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`)
156+
157+
#
158+
# Controversial and experimental checks (opt-in, just replace `false` with `[]`)
159+
#
160+
{Credo.Check.Readability.StrictModuleLayout,
161+
priority: :normal, order: ~w/shortdoc moduledoc behaviour use import require alias/a},
162+
{Credo.Check.Consistency.MultiAliasImportRequireUse, false},
163+
{Credo.Check.Consistency.UnusedVariableNames, force: :meaningful},
164+
{Credo.Check.Design.DuplicatedCode, false},
165+
{Credo.Check.Readability.AliasAs, false},
166+
{Credo.Check.Readability.MultiAlias, false},
167+
{Credo.Check.Readability.Specs, []},
168+
{Credo.Check.Readability.SinglePipe, false},
169+
{Credo.Check.Readability.WithCustomTaggedTuple, false},
170+
{Credo.Check.Refactor.ABCSize, false},
171+
{Credo.Check.Refactor.AppendSingleItem, false},
172+
{Credo.Check.Refactor.DoubleBooleanNegation, false},
173+
{Credo.Check.Refactor.ModuleDependencies, false},
174+
{Credo.Check.Refactor.NegatedIsNil, false},
175+
{Credo.Check.Refactor.PipeChainStart, false},
176+
{Credo.Check.Refactor.VariableRebinding, false},
177+
{Credo.Check.Warning.LeakyEnvironment, false},
178+
{Credo.Check.Warning.MapGetUnsafePass, false},
179+
{Credo.Check.Warning.UnsafeToAtom, false}
180+
181+
#
182+
# Custom checks can be created using `mix credo.gen.check`.
183+
#
184+
]
185+
}
186+
]
187+
}

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
max_line_length = 100
10+
tab_width = 2
11+
trim_trailing_whitespace = true

.formatter.exs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
inputs: [
3+
"{lib,test,config}/**/*.{ex,exs}",
4+
".formatter.exs",
5+
"*.exs"
6+
],
7+
import_deps: [:membrane_core]
8+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Please, open new issues in membranefranework/membrane_core
3+
about: New issues related to this repo should be opened there
4+
title: "[DO NOT OPEN]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Please, do not open this issue here. Open it in the [membrane_core](https://github.com/membraneframework/membrane_core) repository instead.
11+
12+
Thanks for helping us grow :)

.github/workflows/fetch_changes.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Fetch changes
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Trigger thrice a day
8+
schedule:
9+
- cron: '0 4,8,12 * * *'
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
jobs:
15+
# This workflow contains a single job called "build"
16+
build:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+
- uses: actions/checkout@v3
24+
with:
25+
fetch-depth: '0'
26+
27+
- name: webfactory/ssh-agent
28+
uses: webfactory/ssh-agent@v0.5.4
29+
with:
30+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
31+
32+
# Runs a set of commands using the runners shell
33+
- name: Add remote
34+
run: |
35+
git remote add source git@github.com:membraneframework/membrane_template_plugin.git
36+
git remote update
37+
38+
echo "CURRENT_BRANCH=$(git branch --show-current)" >> $GITHUB_ENV
39+
40+
- name: Check changes
41+
run: |
42+
echo ${{env.CURRENT_BRANCH}}
43+
echo "LOG_SIZE=$(git log origin/${{ env.CURRENT_BRANCH }}..source/${{ env.CURRENT_BRANCH }} | wc -l)"
44+
45+
echo "LOG_SIZE=$(git log origin/${{ env.CURRENT_BRANCH }}..source/${{ env.CURRENT_BRANCH }} | wc -l)" >> $GITHUB_ENV
46+
47+
- if: ${{ env.LOG_SIZE != '0'}}
48+
name: Merge changes
49+
run: |
50+
git config --global user.email "admin@membraneframework.com"
51+
git config --global user.name "MembraneFramework"
52+
53+
git merge source/master
54+
git push origin master
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Close issue when opened'
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
jobs:
7+
close:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout membrane_core
11+
uses: actions/checkout@v3
12+
with:
13+
repository: membraneframework/membrane_core
14+
- name: Close issue
15+
uses: ./.github/actions/close_issue
16+
with:
17+
GITHUB_TOKEN: ${{ secrets.MEMBRANEFRAMEWORKADMIN_TOKEN }}
18+
ISSUE_URL: ${{ github.event.issue.html_url }}
19+
ISSUE_NUMBER: ${{ github.event.issue.number }}
20+
REPOSITORY: ${{ github.repository }}

.github/workflows/on_pr_opened.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Add PR to Smackore project board, if the author is from outside Membrane Team
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
jobs:
7+
maybe_add_to_project_board:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout membrane_core
11+
uses: actions/checkout@v3
12+
with:
13+
repository: membraneframework/membrane_core
14+
- name: Puts PR in "New PRs by community" column in the Smackore project, if the author is from outside Membrane Team
15+
uses: ./.github/actions/add_pr_to_smackore_board
16+
with:
17+
GITHUB_TOKEN: ${{ secrets.MEMBRANEFRAMEWORKADMIN_TOKEN }}
18+
AUTHOR_LOGIN: ${{ github.event.pull_request.user.login }}
19+
PR_URL: ${{ github.event.pull_request.html_url }}

0 commit comments

Comments
 (0)