Skip to content

Commit c67c434

Browse files
committed
Add dependencies
1 parent 039c36c commit c67c434

File tree

9 files changed

+206
-95
lines changed

9 files changed

+206
-95
lines changed

.credo.exs

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
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: 2]},
91+
{Credo.Check.Design.TagFIXME, []},
92+
93+
#
94+
## Readability Checks
95+
#
96+
{Credo.Check.Readability.AliasOrder, []},
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, []},
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+
116+
#
117+
## Refactoring Opportunities
118+
#
119+
{Credo.Check.Refactor.CondStatements, []},
120+
{Credo.Check.Refactor.CyclomaticComplexity, []},
121+
{Credo.Check.Refactor.FunctionArity, []},
122+
{Credo.Check.Refactor.LongQuoteBlocks, []},
123+
# {Credo.Check.Refactor.MapInto, []},
124+
{Credo.Check.Refactor.MatchInCondition, []},
125+
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
126+
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
127+
{Credo.Check.Refactor.Nesting, []},
128+
{Credo.Check.Refactor.UnlessWithElse, []},
129+
{Credo.Check.Refactor.WithClauses, []},
130+
131+
#
132+
## Warnings
133+
#
134+
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, []},
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, []},
140+
{Credo.Check.Warning.MixEnv, false},
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.Consistency.MultiAliasImportRequireUse, false},
161+
{Credo.Check.Consistency.UnusedVariableNames, false},
162+
{Credo.Check.Design.DuplicatedCode, false},
163+
{Credo.Check.Readability.AliasAs, false},
164+
{Credo.Check.Readability.BlockPipe, false},
165+
{Credo.Check.Readability.ImplTrue, false},
166+
{Credo.Check.Readability.MultiAlias, false},
167+
{Credo.Check.Readability.SeparateAliasRequire, false},
168+
{Credo.Check.Readability.SinglePipe, false},
169+
{Credo.Check.Readability.Specs, false},
170+
{Credo.Check.Readability.StrictModuleLayout, false},
171+
{Credo.Check.Readability.WithCustomTaggedTuple, false},
172+
{Credo.Check.Refactor.ABCSize, false},
173+
{Credo.Check.Refactor.AppendSingleItem, false},
174+
{Credo.Check.Refactor.DoubleBooleanNegation, false},
175+
{Credo.Check.Refactor.ModuleDependencies, false},
176+
{Credo.Check.Refactor.NegatedIsNil, false},
177+
{Credo.Check.Refactor.PipeChainStart, false},
178+
{Credo.Check.Refactor.VariableRebinding, false},
179+
{Credo.Check.Warning.LeakyEnvironment, false},
180+
{Credo.Check.Warning.MapGetUnsafePass, false},
181+
{Credo.Check.Warning.UnsafeToAtom, false}
182+
183+
#
184+
# Custom checks can be created using `mix credo.gen.check`.
185+
#
186+
]
187+
}
188+
]
189+
}

.devcontainer/Dockerfile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,14 @@ FROM elixir:1.11.2-slim
33
ARG USERNAME=vscode
44

55
RUN apt-get update && \
6-
apt-get install -y postgresql-client && \
76
apt-get install -y inotify-tools && \
87
apt-get install -y vim && \
98
apt-get install -y git && \
109
apt-get install -y curl && \
1110
apt-get install -y wget && \
1211
apt-get install -y gnupg2 && \
13-
apt-get install -y rubygems && \
1412
apt-get install -y zsh
1513

16-
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
17-
18-
RUN apt-get update && \
19-
apt-get install -y nodejs
20-
21-
RUN gem install htmlbeautifier
22-
2314
COPY setup.sh .
2415
RUN bash ./setup.sh
2516

.devcontainer/devcontainer.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@
1515

1616
// Add the IDs of extensions you want installed when the container is created.
1717
"extensions": [
18-
"JakeBecker.elixir-ls",
19-
"esbenp.prettier-vscode",
20-
"dbaeumer.vscode-eslint",
21-
"bradlc.vscode-tailwindcss",
22-
"adrianwilczynski.alpine-js-intellisense",
23-
"stylelint.vscode-stylelint",
24-
"ms-azuretools.vscode-docker",
25-
"pantajoe.vscode-elixir-credo"
26-
],
18+
"JakeBecker.elixir-ls",
19+
"ms-azuretools.vscode-docker",
20+
"pantajoe.vscode-elixir-credo"
21+
],
2722
"settings": {
2823
"terminal.integrated.shell.linux": "/usr/bin/zsh"
2924
},

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,4 @@ services:
55
build:
66
context: .
77
dockerfile: Dockerfile
8-
depends_on:
9-
- db
108
command: /bin/sh -c "while sleep 1000; do :; done"
11-
db:
12-
image: postgres:13.1
13-
environment:
14-
POSTGRES_USER: postgres
15-
POSTGRES_PASSWORD: postgres
16-
POSTGRES_DB: database
17-
PGDATA: /var/lib/postgresql/data/pgdata
18-
restart: always
19-
volumes:
20-
- db:/var/lib/postgresql/data
21-
22-
volumes:
23-
deps:
24-
elixir_ls:
25-
build:
26-
node_modules:
27-
db:

.github/workflows/ci.yml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,13 @@ jobs:
1010
test:
1111
name: Test
1212
runs-on: ubuntu-latest
13-
env:
14-
DATABASE_HOST: localhost
15-
16-
services:
17-
postgres:
18-
image: postgres:13.1
19-
env:
20-
POSTGRES_USER: postgres
21-
POSTGRES_PASSWORD: postgres
22-
POSTGRES_DB: database_test
23-
PGDATA: /var/lib/postgresql/data/pgdata
24-
ports:
25-
- "5432:5432"
26-
options: >-
27-
--health-cmd pg_isready
28-
--health-interval 10s
29-
--health-timeout 5s
30-
--health-retries 5
3113
steps:
3214
- uses: actions/checkout@v2
3315
- name: Set up Elixir
3416
uses: actions/setup-elixir@v1
3517
with:
3618
elixir-version: "1.11.2" # Define the elixir version [required]
3719
otp-version: "23.0" # Define the OTP version [required]
38-
- name: Set up node
39-
uses: actions/setup-node@v1
40-
with:
41-
node-version: "11"
4220
- name: Restore deps cache
4321
uses: actions/cache@v2
4422
with:
@@ -47,22 +25,9 @@ jobs:
4725
**/deps
4826
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
4927
restore-keys: ${{ runner.os }}-mix-
50-
- name: Restore npm cache
51-
uses: actions/cache@v2
52-
with:
53-
path: assets/node_modules
54-
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
55-
restore-keys: ${{ runner.os }}-npm-
5628
- name: Install dependencies
5729
run: mix deps.get
5830
- name: Check Elixir formatting
5931
run: mix format --check-formatted
60-
- name: Check JS and CSS formatting
61-
run: npm run lint
62-
working-directory: ./assets
63-
- run: npm ci
64-
working-directory: ./assets
65-
- run: npm run deploy
66-
working-directory: ./assets
6732
- name: Run tests
6833
run: mix test

.vscode/settings.json

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
11
{
2-
"css.validate": false,
3-
"editor.formatOnSave": true,
4-
"stylelint.configBasedir": "assets",
5-
"files.associations": {
6-
"*.css": "postcss"
7-
},
8-
"eslint.workingDirectories": ["./assets"],
9-
"eslint.nodePath": "assets",
10-
"[javascript]": {
11-
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
12-
},
13-
"[json]": {
14-
"editor.defaultFormatter": "esbenp.prettier-vscode"
15-
},
16-
"[css]": {
17-
"editor.defaultFormatter": "stylelint.vscode-stylelint"
18-
},
19-
"[postcss]": {
20-
"editor.defaultFormatter": "stylelint.vscode-stylelint"
21-
},
22-
"editor.codeActionsOnSave": {
23-
"source.fixAll.stylelint": true
24-
}
2+
"editor.formatOnSave": true
253
}

mix.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ defmodule ElixirStarter.MixProject do
2121
# Run "mix help deps" to learn about dependencies.
2222
defp deps do
2323
[
24+
{:credo, "~> 1.5", only: [:dev, :test], runtime: false}
2425
# {:dep_from_hexpm, "~> 0.3.0"},
2526
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
2627
]

mix.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
%{
2+
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
3+
"credo": {:hex, :credo, "1.5.1", "4fe303cc828412b9d21eed4eab60914c401e71f117f40243266aafb66f30d036", [: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", "0b219ca4dcc89e4e7bc6ae7e6539c313e738e192e10b85275fa1e82b5203ecd7"},
4+
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
5+
"jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
6+
}

rename.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
find . -type f -name '.gitignore' -exec sed -i 's/elixir_starter/awesome_project/g' {} \;
4+
find . -type f -regex '.*\.\(eex\|ex\|exs\|leex\|md\)' -exec sed -i 's/elixir_starter/awesome_project/g' {} \;
5+
find . -type f -regex '.*\.\(eex\|ex\|exs\|leex\|md\)' -exec sed -i 's/ElixirStarter/AwesomeProject/g' {} \;

0 commit comments

Comments
 (0)