Skip to content

Commit b1869d6

Browse files
authored
Merge pull request #93 from woylie/master
Phoenix HTML 4.0 + spring cleaning
2 parents 78e51d9 + 33669dc commit b1869d6

File tree

12 files changed

+406
-194
lines changed

12 files changed

+406
-194
lines changed

.credo.exs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@
8484
#
8585
{Credo.Check.Design.AliasUsage,
8686
[priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]},
87+
{Credo.Check.Design.TagFIXME, []},
8788
# You can also customize the exit_status of each check.
8889
# If you don't want TODO comments to cause `mix credo` to fail, just
8990
# set this value to 0 (zero).
9091
#
9192
{Credo.Check.Design.TagTODO, [exit_status: 2]},
92-
{Credo.Check.Design.TagFIXME, []},
9393

9494
#
9595
## Readability Checks
@@ -99,7 +99,7 @@
9999
{Credo.Check.Readability.LargeNumbers, []},
100100
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]},
101101
{Credo.Check.Readability.ModuleAttributeNames, []},
102-
{Credo.Check.Readability.ModuleDoc, []},
102+
{Credo.Check.Readability.ModuleDoc, false},
103103
{Credo.Check.Readability.ModuleNames, []},
104104
{Credo.Check.Readability.ParenthesesInCondition, []},
105105
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
@@ -122,32 +122,35 @@
122122
{Credo.Check.Refactor.Apply, []},
123123
{Credo.Check.Refactor.CondStatements, []},
124124
{Credo.Check.Refactor.CyclomaticComplexity, []},
125+
{Credo.Check.Refactor.FilterCount, []},
126+
{Credo.Check.Refactor.FilterFilter, []},
125127
{Credo.Check.Refactor.FunctionArity, []},
126128
{Credo.Check.Refactor.LongQuoteBlocks, []},
127-
{Credo.Check.Refactor.MatchInCondition, []},
128129
{Credo.Check.Refactor.MapJoin, []},
130+
{Credo.Check.Refactor.MatchInCondition, []},
129131
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
130132
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
131133
{Credo.Check.Refactor.Nesting, []},
134+
{Credo.Check.Refactor.RedundantWithClauseResult, []},
135+
{Credo.Check.Refactor.RejectReject, []},
132136
{Credo.Check.Refactor.UnlessWithElse, []},
133137
{Credo.Check.Refactor.WithClauses, []},
134-
{Credo.Check.Refactor.FilterFilter, []},
135-
{Credo.Check.Refactor.RejectReject, []},
136-
{Credo.Check.Refactor.RedundantWithClauseResult, []},
137138

138139
#
139140
## Warnings
140141
#
141142
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, []},
142143
{Credo.Check.Warning.BoolOperationOnSameValues, []},
144+
{Credo.Check.Warning.Dbg, []},
143145
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
144146
{Credo.Check.Warning.IExPry, []},
145147
{Credo.Check.Warning.IoInspect, []},
148+
{Credo.Check.Warning.MissedMetadataKeyInLoggerConfig, []},
146149
{Credo.Check.Warning.OperationOnSameValues, []},
147150
{Credo.Check.Warning.OperationWithConstantResult, []},
148151
{Credo.Check.Warning.RaiseInsideRescue, []},
149152
{Credo.Check.Warning.SpecWithStruct, []},
150-
{Credo.Check.Warning.WrongTestFileExtension, []},
153+
{Credo.Check.Warning.UnsafeExec, []},
151154
{Credo.Check.Warning.UnusedEnumOperation, []},
152155
{Credo.Check.Warning.UnusedFileOperation, []},
153156
{Credo.Check.Warning.UnusedKeywordOperation, []},
@@ -156,11 +159,12 @@
156159
{Credo.Check.Warning.UnusedRegexOperation, []},
157160
{Credo.Check.Warning.UnusedStringOperation, []},
158161
{Credo.Check.Warning.UnusedTupleOperation, []},
159-
{Credo.Check.Warning.UnsafeExec, []}
162+
{Credo.Check.Warning.WrongTestFileExtension, []}
160163
],
161164
disabled: [
162165
#
163-
# Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`)
166+
# Checks scheduled for next check update (opt-in for now)
167+
{Credo.Check.Refactor.UtcNowTruncate, []},
164168

165169
#
166170
# Controversial and experimental checks (opt-in, just move the check to `:enabled`
@@ -175,6 +179,8 @@
175179
{Credo.Check.Readability.ImplTrue, []},
176180
{Credo.Check.Readability.MultiAlias, []},
177181
{Credo.Check.Readability.NestedFunctionCalls, []},
182+
{Credo.Check.Readability.OneArityFunctionInPipe, []},
183+
{Credo.Check.Readability.OnePipePerLine, []},
178184
{Credo.Check.Readability.SeparateAliasRequire, []},
179185
{Credo.Check.Readability.SingleFunctionToBlockPipe, []},
180186
{Credo.Check.Readability.SinglePipe, []},
@@ -189,6 +195,7 @@
189195
{Credo.Check.Refactor.MapMap, []},
190196
{Credo.Check.Refactor.ModuleDependencies, []},
191197
{Credo.Check.Refactor.NegatedIsNil, []},
198+
{Credo.Check.Refactor.PassAsyncInTestCases, []},
192199
{Credo.Check.Refactor.PipeChainStart, []},
193200
{Credo.Check.Refactor.RejectFilter, []},
194201
{Credo.Check.Refactor.VariableRebinding, []},

.github/workflows/ci.yml

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: CI
22

3+
env:
4+
ELIXIR_VERSION: "1.16"
5+
OTP_VERSION: "26"
6+
37
on:
48
push:
59
branches:
@@ -11,14 +15,18 @@ on:
1115
jobs:
1216
test:
1317
runs-on: ubuntu-latest
14-
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
18+
name: Test OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
1519
strategy:
1620
matrix:
17-
otp: ["24.3", "25.1"]
18-
elixir: ["1.13", "1.14"]
19-
exclude:
20-
- otp: "25.1"
21-
elixir: "1.13"
21+
include:
22+
- { elixir: 1.14, otp: 24 }
23+
- { elixir: 1.14, otp: 25 }
24+
- { elixir: 1.15, otp: 24 }
25+
- { elixir: 1.15, otp: 25 }
26+
- { elixir: 1.15, otp: 26 }
27+
- { elixir: 1.16, otp: 24 }
28+
- { elixir: 1.16, otp: 25 }
29+
- { elixir: 1.16, otp: 26 }
2230
env:
2331
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2432

@@ -37,21 +45,51 @@ jobs:
3745
- 5432:5432
3846

3947
steps:
40-
- uses: actions/checkout@v3
48+
- uses: actions/checkout@v4
4149
- uses: erlef/setup-beam@v1
50+
id: beam
4251
with:
4352
otp-version: ${{matrix.otp}}
4453
elixir-version: ${{matrix.elixir}}
4554
- name: Restore dependencies and build cache
46-
uses: actions/cache@v3
55+
uses: actions/cache@v4
56+
with:
57+
path: |
58+
_build
59+
deps
60+
key: ${{ runner.os }}-otp-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles('mix.lock') }}
61+
restore-keys: ${{ runner.os }}-otp-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-
62+
- name: Install Dependencies
63+
run: |
64+
mix local.rebar --force
65+
mix local.hex --force
66+
mix deps.get
67+
- name: Run Tests
68+
run: mix coveralls.github
69+
70+
lint:
71+
runs-on: ubuntu-latest
72+
name: Lint
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
76+
steps:
77+
- uses: actions/checkout@v4
78+
- uses: erlef/setup-beam@v1
79+
id: beam
80+
with:
81+
otp-version: ${{ env.OTP_VERSION }}
82+
elixir-version: ${{ env.ELIXIR_VERSION}}
83+
- name: Restore dependencies and build cache
84+
uses: actions/cache@v4
4785
with:
4886
path: |
4987
_build
5088
deps
5189
key: ${{ runner.os }}-otp-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles('mix.lock') }}
5290
restore-keys: ${{ runner.os }}-otp-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-
5391
- name: Restore PLT cache
54-
uses: actions/cache@v3
92+
uses: actions/cache@v4
5593
id: plt_cache
5694
with:
5795
key: |
@@ -75,5 +113,3 @@ jobs:
75113
run: mix hex.audit
76114
- name: Generate docs
77115
run: mix docs
78-
- name: Run Tests
79-
run: mix coveralls.github

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ polymorphic_embed-*.tar
2828

2929
# Ignore Dialyzer plts file
3030
.plts
31+
32+
.elixir_ls

config/test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Config
22

3-
config :logger, level: :warn
3+
config :logger, level: :warning
44

55
config :phoenix, :json_library, Jason
66

0 commit comments

Comments
 (0)