Skip to content

Commit 9686a4f

Browse files
committed
Initialize Repository
0 parents  commit 9686a4f

26 files changed

Lines changed: 797 additions & 0 deletions

.credo.exs

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
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+
enabled: [
69+
#
70+
## Consistency Checks
71+
#
72+
{Credo.Check.Consistency.ExceptionNames, []},
73+
{Credo.Check.Consistency.LineEndings, []},
74+
{Credo.Check.Consistency.ParameterPatternMatching, []},
75+
{Credo.Check.Consistency.SpaceAroundOperators, []},
76+
{Credo.Check.Consistency.SpaceInParentheses, []},
77+
{Credo.Check.Consistency.TabsOrSpaces, []},
78+
79+
#
80+
## Design Checks
81+
#
82+
# You can customize the priority of any check
83+
# Priority values are: `low, normal, high, higher`
84+
#
85+
{Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]},
86+
{Credo.Check.Design.TagFIXME, []},
87+
# You can also customize the exit_status of each check.
88+
# If you don't want TODO comments to cause `mix credo` to fail, just
89+
# set this value to 0 (zero).
90+
#
91+
{Credo.Check.Design.TagTODO, [exit_status: 0]},
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.PipeIntoAnonymousFunctions, []},
106+
{Credo.Check.Readability.PredicateFunctionNames, []},
107+
{Credo.Check.Readability.PreferImplicitTry, []},
108+
{Credo.Check.Readability.RedundantBlankLines, []},
109+
{Credo.Check.Readability.Semicolons, []},
110+
{Credo.Check.Readability.SpaceAfterCommas, []},
111+
{Credo.Check.Readability.StringSigils, []},
112+
{Credo.Check.Readability.TrailingBlankLine, []},
113+
{Credo.Check.Readability.TrailingWhiteSpace, []},
114+
{Credo.Check.Readability.UnnecessaryAliasExpansion, []},
115+
{Credo.Check.Readability.VariableNames, []},
116+
{Credo.Check.Readability.WithSingleClause, []},
117+
118+
#
119+
## Refactoring Opportunities
120+
#
121+
{Credo.Check.Refactor.Apply, []},
122+
{Credo.Check.Refactor.CondStatements, []},
123+
{Credo.Check.Refactor.CyclomaticComplexity, []},
124+
{Credo.Check.Refactor.FilterCount, []},
125+
{Credo.Check.Refactor.FilterFilter, []},
126+
{Credo.Check.Refactor.FunctionArity, []},
127+
{Credo.Check.Refactor.LongQuoteBlocks, []},
128+
{Credo.Check.Refactor.MapJoin, []},
129+
{Credo.Check.Refactor.MatchInCondition, []},
130+
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
131+
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
132+
{Credo.Check.Refactor.Nesting, []},
133+
{Credo.Check.Refactor.RedundantWithClauseResult, []},
134+
{Credo.Check.Refactor.RejectReject, []},
135+
{Credo.Check.Refactor.UnlessWithElse, []},
136+
{Credo.Check.Refactor.WithClauses, []},
137+
138+
#
139+
## Warnings
140+
#
141+
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, []},
142+
{Credo.Check.Warning.BoolOperationOnSameValues, []},
143+
{Credo.Check.Warning.Dbg, []},
144+
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
145+
{Credo.Check.Warning.IExPry, []},
146+
{Credo.Check.Warning.IoInspect, []},
147+
{Credo.Check.Warning.MissedMetadataKeyInLoggerConfig, []},
148+
{Credo.Check.Warning.OperationOnSameValues, []},
149+
{Credo.Check.Warning.OperationWithConstantResult, []},
150+
{Credo.Check.Warning.RaiseInsideRescue, []},
151+
{Credo.Check.Warning.SpecWithStruct, []},
152+
{Credo.Check.Warning.StructFieldAmount, []},
153+
{Credo.Check.Warning.UnsafeExec, []},
154+
{Credo.Check.Warning.UnusedEnumOperation, []},
155+
{Credo.Check.Warning.UnusedFileOperation, []},
156+
{Credo.Check.Warning.UnusedKeywordOperation, []},
157+
{Credo.Check.Warning.UnusedListOperation, []},
158+
{Credo.Check.Warning.UnusedPathOperation, []},
159+
{Credo.Check.Warning.UnusedRegexOperation, []},
160+
{Credo.Check.Warning.UnusedStringOperation, []},
161+
{Credo.Check.Warning.UnusedTupleOperation, []},
162+
{Credo.Check.Warning.WrongTestFileExtension, []}
163+
],
164+
disabled: [
165+
#
166+
# Checks scheduled for next check update (opt-in for now)
167+
{Credo.Check.Refactor.UtcNowTruncate, []},
168+
169+
#
170+
# Controversial and experimental checks (opt-in, just move the check to `:enabled`
171+
# and be sure to use `mix credo --strict` to see low priority checks)
172+
#
173+
{Credo.Check.Consistency.MultiAliasImportRequireUse, []},
174+
{Credo.Check.Consistency.UnusedVariableNames, []},
175+
{Credo.Check.Design.DuplicatedCode, []},
176+
{Credo.Check.Design.SkipTestWithoutComment, []},
177+
{Credo.Check.Readability.AliasAs, []},
178+
{Credo.Check.Readability.BlockPipe, []},
179+
{Credo.Check.Readability.ImplTrue, []},
180+
{Credo.Check.Readability.MultiAlias, []},
181+
{Credo.Check.Readability.NestedFunctionCalls, []},
182+
{Credo.Check.Readability.OneArityFunctionInPipe, []},
183+
{Credo.Check.Readability.OnePipePerLine, []},
184+
{Credo.Check.Readability.SeparateAliasRequire, []},
185+
{Credo.Check.Readability.SingleFunctionToBlockPipe, []},
186+
{Credo.Check.Readability.SinglePipe, []},
187+
{Credo.Check.Readability.Specs, []},
188+
{Credo.Check.Readability.StrictModuleLayout, []},
189+
{Credo.Check.Readability.WithCustomTaggedTuple, []},
190+
{Credo.Check.Refactor.ABCSize, []},
191+
{Credo.Check.Refactor.AppendSingleItem, []},
192+
{Credo.Check.Refactor.DoubleBooleanNegation, []},
193+
{Credo.Check.Refactor.FilterReject, []},
194+
{Credo.Check.Refactor.IoPuts, []},
195+
{Credo.Check.Refactor.MapMap, []},
196+
{Credo.Check.Refactor.ModuleDependencies, []},
197+
{Credo.Check.Refactor.NegatedIsNil, []},
198+
{Credo.Check.Refactor.PassAsyncInTestCases, []},
199+
{Credo.Check.Refactor.PipeChainStart, []},
200+
{Credo.Check.Refactor.RejectFilter, []},
201+
{Credo.Check.Refactor.VariableRebinding, []},
202+
{Credo.Check.Warning.LazyLogging, []},
203+
{Credo.Check.Warning.LeakyEnvironment, []},
204+
{Credo.Check.Warning.MapGetUnsafePass, []},
205+
{Credo.Check.Warning.MixEnv, []},
206+
{Credo.Check.Warning.UnsafeToAtom, []}
207+
208+
# {Credo.Check.Refactor.MapInto, []},
209+
210+
#
211+
# Custom checks can be created using `mix credo.gen.check`.
212+
#
213+
]
214+
}
215+
}
216+
]
217+
}

.dialyzer.ignore-warnings.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

.formatter.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Used by "mix format"
2+
[
3+
plugins: [Styler],
4+
inputs: ["{mix,.formatter,.iex,.credo}.exs", "{config,lib,test,bench,scripts}/**/*.{ex,exs,eex}"]
5+
]

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Lines starting with '#' are comments.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in the repo.
5+
* @probably-not

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "mix"
5+
insecure-external-code-execution: "allow"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
open-pull-requests-limit: 10
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "daily"
14+
open-pull-requests-limit: 10
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Cleanup Caches Created By A Branch
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
7+
permissions:
8+
contents: write
9+
actions: write
10+
11+
jobs:
12+
cleanup:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Cleanup
16+
run: |
17+
echo "Fetching list of cache key"
18+
cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id')
19+
20+
## Setting this to not fail the workflow while deleting cache keys.
21+
set +e
22+
echo "Deleting caches..."
23+
for cacheKey in $cacheKeysForPR
24+
do
25+
gh cache delete $cacheKey
26+
done
27+
echo "Done"
28+
env:
29+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
GH_REPO: ${{ github.repository }}
31+
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge

0 commit comments

Comments
 (0)