Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pehbehbeh committed Dec 6, 2023
2 parents fe6f157 + fa2a260 commit e810f6b
Show file tree
Hide file tree
Showing 183 changed files with 62,454 additions and 0 deletions.
140 changes: 140 additions & 0 deletions .credo.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
%{
configs: [
%{
name: "default",
files: %{
included: [
"lib/",
"test/",
"priv/"
],
excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"]
},
plugins: [],
requires: [],
strict: true,
parse_timeout: 5000,
color: true,
checks: %{
enabled: [
#
## Consistency Checks
#
{Credo.Check.Consistency.ExceptionNames, []},
{Credo.Check.Consistency.LineEndings, []},
{Credo.Check.Consistency.MultiAliasImportRequireUse, []},
{Credo.Check.Consistency.ParameterPatternMatching, []},
{Credo.Check.Consistency.SpaceAroundOperators, []},
{Credo.Check.Consistency.SpaceInParentheses, []},
{Credo.Check.Consistency.TabsOrSpaces, []},
{Credo.Check.Consistency.UnusedVariableNames, []},

#
## Design Checks
#
{Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]},
{Credo.Check.Design.DuplicatedCode, []},
{Credo.Check.Design.SkipTestWithoutComment, []},
{Credo.Check.Design.TagFIXME, []},
{Credo.Check.Design.TagTODO, [exit_status: 0]},

#
## Readability Checks
#
{Credo.Check.Readability.AliasOrder, []},
{Credo.Check.Readability.BlockPipe, []},
{Credo.Check.Readability.FunctionNames, []},
{Credo.Check.Readability.ImplTrue, []},
{Credo.Check.Readability.LargeNumbers, []},
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]},
{Credo.Check.Readability.ModuleAttributeNames, []},
{Credo.Check.Readability.ModuleDoc, []},
{Credo.Check.Readability.ModuleNames, []},
{Credo.Check.Readability.MultiAlias, []},
{Credo.Check.Readability.NestedFunctionCalls, []},
{Credo.Check.Readability.ParenthesesInCondition, []},
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
{Credo.Check.Readability.PipeIntoAnonymousFunctions, []},
{Credo.Check.Readability.PredicateFunctionNames, []},
{Credo.Check.Readability.PreferImplicitTry, []},
{Credo.Check.Readability.RedundantBlankLines, []},
{Credo.Check.Readability.Semicolons, []},
{Credo.Check.Readability.SeparateAliasRequire, []},
{Credo.Check.Readability.SingleFunctionToBlockPipe, []},
{Credo.Check.Readability.SpaceAfterCommas, []},
{Credo.Check.Readability.StrictModuleLayout, []},
{Credo.Check.Readability.StringSigils, []},
{Credo.Check.Readability.TrailingBlankLine, []},
{Credo.Check.Readability.TrailingWhiteSpace, []},
{Credo.Check.Readability.UnnecessaryAliasExpansion, []},
{Credo.Check.Readability.VariableNames, []},
{Credo.Check.Readability.WithCustomTaggedTuple, []},
{Credo.Check.Readability.WithSingleClause, []},

#
## Refactoring Opportunities
#
{Credo.Check.Refactor.AppendSingleItem, []},
{Credo.Check.Refactor.Apply, []},
{Credo.Check.Refactor.CondStatements, []},
{Credo.Check.Refactor.CyclomaticComplexity, []},
{Credo.Check.Refactor.DoubleBooleanNegation, []},
{Credo.Check.Refactor.FilterFilter, []},
{Credo.Check.Refactor.FilterReject, []},
{Credo.Check.Refactor.FunctionArity, []},
{Credo.Check.Refactor.IoPuts, []},
{Credo.Check.Refactor.LongQuoteBlocks, []},
{Credo.Check.Refactor.MapInto, false},
{Credo.Check.Refactor.MapJoin, []},
{Credo.Check.Refactor.MapMap, []},
{Credo.Check.Refactor.MatchInCondition, []},
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
{Credo.Check.Refactor.NegatedIsNil, []},
{Credo.Check.Refactor.Nesting, []},
{Credo.Check.Refactor.PipeChainStart, [excluded_argument_types: [:atom, :credo_type_error]]},
{Credo.Check.Refactor.RedundantWithClauseResult, []},
{Credo.Check.Refactor.RejectFilter, []},
{Credo.Check.Refactor.RejectReject, []},
{Credo.Check.Refactor.UnlessWithElse, []},
{Credo.Check.Refactor.VariableRebinding, []},
{Credo.Check.Refactor.WithClauses, []},

#
## Warnings
#
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, []},
{Credo.Check.Warning.BoolOperationOnSameValues, []},
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
{Credo.Check.Warning.IExPry, []},
{Credo.Check.Warning.IoInspect, []},
{Credo.Check.Warning.LazyLogging, false},
{Credo.Check.Warning.MapGetUnsafePass, []},
{Credo.Check.Warning.MixEnv, []},
{Credo.Check.Warning.OperationOnSameValues, []},
{Credo.Check.Warning.OperationWithConstantResult, []},
{Credo.Check.Warning.RaiseInsideRescue, []},
{Credo.Check.Warning.SpecWithStruct, []},
{Credo.Check.Warning.UnsafeExec, []},
{Credo.Check.Warning.UnsafeToAtom, []},
{Credo.Check.Warning.UnusedEnumOperation, []},
{Credo.Check.Warning.UnusedFileOperation, []},
{Credo.Check.Warning.UnusedKeywordOperation, []},
{Credo.Check.Warning.UnusedListOperation, []},
{Credo.Check.Warning.UnusedPathOperation, []},
{Credo.Check.Warning.UnusedRegexOperation, []},
{Credo.Check.Warning.UnusedStringOperation, []},
{Credo.Check.Warning.UnusedTupleOperation, []},
{Credo.Check.Warning.WrongTestFileExtension, []}
],
disabled: [
{Credo.Check.Refactor.ABCSize, []},
{Credo.Check.Readability.AliasAs, []},
{Credo.Check.Readability.SinglePipe, []},
{Credo.Check.Readability.Specs, []},
{Credo.Check.Refactor.ModuleDependencies, []}
]
}
}
]
}
6 changes: 6 additions & 0 deletions .docker/etc/bash.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if test -d /etc/bashrc.d; then
for script in /etc/bashrc.d/*.sh; do
test -r "$script" && . "$script"
done
unset item
fi
4 changes: 4 additions & 0 deletions .docker/etc/bashrc.d/prompt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# force prompt colors and short user display
force_color_prompt=yes
PS1='\[\033[1;36m\]\u\[\033[1;31m\]\[\033[1;32m\]:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '
6 changes: 6 additions & 0 deletions .docker/opt/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
echo "Running entrypoint script..."
set -e
source /opt/scripts/env-secrets-expand.sh
source /opt/scripts/startup-commands.sh
exec "$@"
6 changes: 6 additions & 0 deletions .docker/opt/scripts/startup-commands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
echo "Running startup commands..."
for command in "${!STARTUP_COMMAND@}"; do
printf 'Running %s: %s\n' "$command" "${!command}"
eval ${!command}
done
1 change: 1 addition & 0 deletions .docker/root/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source /etc/bash.bashrc
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[Dockerfile]
indent_size = 4
14 changes: 14 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
locals_without_parens = [
live_resources: 2,
live_resources: 3
]

[
line_length: 120,
import_deps: [:ecto, :phoenix],
plugins: [TailwindFormatter, Phoenix.LiveView.HTMLFormatter],
inputs: ["*.{heex,ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{heex,ex,exs}"],
subdirectories: ["priv/*/migrations"],
locals_without_parens: locals_without_parens,
export: [locals_without_parens: locals_without_parens]
]
44 changes: 44 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: 2
updates:
- package-ecosystem: 'docker'
directory: '/'
schedule:
interval: 'daily'
reviewers:
- 'krns'
pull-request-branch-name:
separator: "/"
open-pull-requests-limit: -1
open-security-pull-requests-limit: -1
- package-ecosystem: 'mix'
directory: '/'
schedule:
interval: 'daily'
insecure-external-code-execution: allow
reviewers:
- 'krns'
pull-request-branch-name:
separator: "/"
open-pull-requests-limit: -1
open-security-pull-requests-limit: -1
- package-ecosystem: 'mix'
directory: '/demo/'
schedule:
interval: 'daily'
insecure-external-code-execution: allow
reviewers:
- 'krns'
pull-request-branch-name:
separator: "/"
open-pull-requests-limit: -1
open-security-pull-requests-limit: -1
- package-ecosystem: 'npm'
directory: '/demo/'
schedule:
interval: 'daily'
reviewers:
- 'krns'
pull-request-branch-name:
separator: "/"
open-pull-requests-limit: -1
open-security-pull-requests-limit: -1
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
release:
types: [published]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: '26.1.2'
elixir-version: '1.15.7'

- name: Install Dependencies
run: mix deps.get

- name: Check Formatting
run: mix format --check-formatted

- name: Run Tests
run: mix test

- name: Publish package
if: github.event_name == 'release'
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
run: mix hex.publish --yes
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# System / Docker
.vscode
.bash_history
.env
/.elixir_ls/
.DS_Store

# Phoenix
/_build/
/cover/
/deps/
/doc/
/.fetch
erl_crash.dump
*.ez
backpex-*.tar
/priv/static/assets/
/priv/static/cache_manifest.json
npm-debug.log
/assets/node_modules/

12 changes: 12 additions & 0 deletions .sobelow-conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
verbose: true,
private: true,
skip: true,
router: "",
exit: "low",
format: "txt",
out: "",
threshold: "low",
ignore: [],
ignore_files: [""]
]
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
erlang 26.1.2
elixir 1.15.7-otp-26
Loading

0 comments on commit e810f6b

Please sign in to comment.