Skip to content

Commit 2b8fde8

Browse files
committed
Initial Commit
0 parents  commit 2b8fde8

26 files changed

+2013
-0
lines changed

.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,
86+
[priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]},
87+
{Credo.Check.Design.TagFIXME, []},
88+
# You can also customize the exit_status of each check.
89+
# If you don't want TODO comments to cause `mix credo` to fail, just
90+
# set this value to 0 (zero).
91+
#
92+
{Credo.Check.Design.TagTODO, [exit_status: 2]},
93+
94+
#
95+
## Readability Checks
96+
#
97+
{Credo.Check.Readability.AliasOrder, []},
98+
{Credo.Check.Readability.FunctionNames, []},
99+
{Credo.Check.Readability.LargeNumbers, []},
100+
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]},
101+
{Credo.Check.Readability.ModuleAttributeNames, []},
102+
{Credo.Check.Readability.ModuleDoc, []},
103+
{Credo.Check.Readability.ModuleNames, []},
104+
{Credo.Check.Readability.ParenthesesInCondition, []},
105+
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
106+
{Credo.Check.Readability.PipeIntoAnonymousFunctions, []},
107+
{Credo.Check.Readability.PredicateFunctionNames, []},
108+
{Credo.Check.Readability.PreferImplicitTry, []},
109+
{Credo.Check.Readability.RedundantBlankLines, []},
110+
{Credo.Check.Readability.Semicolons, []},
111+
{Credo.Check.Readability.SpaceAfterCommas, []},
112+
{Credo.Check.Readability.StringSigils, []},
113+
{Credo.Check.Readability.TrailingBlankLine, []},
114+
{Credo.Check.Readability.TrailingWhiteSpace, []},
115+
{Credo.Check.Readability.UnnecessaryAliasExpansion, []},
116+
{Credo.Check.Readability.VariableNames, []},
117+
{Credo.Check.Readability.WithSingleClause, []},
118+
119+
#
120+
## Refactoring Opportunities
121+
#
122+
{Credo.Check.Refactor.Apply, []},
123+
{Credo.Check.Refactor.CondStatements, []},
124+
{Credo.Check.Refactor.CyclomaticComplexity, []},
125+
{Credo.Check.Refactor.FilterCount, []},
126+
{Credo.Check.Refactor.FilterFilter, []},
127+
{Credo.Check.Refactor.FunctionArity, []},
128+
{Credo.Check.Refactor.LongQuoteBlocks, []},
129+
{Credo.Check.Refactor.MapJoin, []},
130+
{Credo.Check.Refactor.MatchInCondition, []},
131+
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
132+
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
133+
{Credo.Check.Refactor.Nesting, []},
134+
{Credo.Check.Refactor.RedundantWithClauseResult, []},
135+
{Credo.Check.Refactor.RejectReject, []},
136+
{Credo.Check.Refactor.UnlessWithElse, []},
137+
{Credo.Check.Refactor.WithClauses, []},
138+
139+
#
140+
## Warnings
141+
#
142+
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, []},
143+
{Credo.Check.Warning.BoolOperationOnSameValues, []},
144+
{Credo.Check.Warning.Dbg, []},
145+
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
146+
{Credo.Check.Warning.IExPry, []},
147+
{Credo.Check.Warning.IoInspect, []},
148+
{Credo.Check.Warning.OperationOnSameValues, []},
149+
{Credo.Check.Warning.OperationWithConstantResult, []},
150+
{Credo.Check.Warning.RaiseInsideRescue, []},
151+
{Credo.Check.Warning.SpecWithStruct, []},
152+
{Credo.Check.Warning.UnsafeExec, []},
153+
{Credo.Check.Warning.UnusedEnumOperation, []},
154+
{Credo.Check.Warning.UnusedFileOperation, []},
155+
{Credo.Check.Warning.UnusedKeywordOperation, []},
156+
{Credo.Check.Warning.UnusedListOperation, []},
157+
{Credo.Check.Warning.UnusedPathOperation, []},
158+
{Credo.Check.Warning.UnusedRegexOperation, []},
159+
{Credo.Check.Warning.UnusedStringOperation, []},
160+
{Credo.Check.Warning.UnusedTupleOperation, []},
161+
{Credo.Check.Warning.WrongTestFileExtension, []}
162+
],
163+
disabled: [
164+
#
165+
# Checks scheduled for next check update (opt-in for now)
166+
{Credo.Check.Refactor.UtcNowTruncate, []},
167+
168+
#
169+
# Controversial and experimental checks (opt-in, just move the check to `:enabled`
170+
# and be sure to use `mix credo --strict` to see low priority checks)
171+
#
172+
{Credo.Check.Consistency.MultiAliasImportRequireUse, []},
173+
{Credo.Check.Consistency.UnusedVariableNames, []},
174+
{Credo.Check.Design.DuplicatedCode, []},
175+
{Credo.Check.Design.SkipTestWithoutComment, []},
176+
{Credo.Check.Readability.AliasAs, []},
177+
{Credo.Check.Readability.BlockPipe, []},
178+
{Credo.Check.Readability.ImplTrue, []},
179+
{Credo.Check.Readability.MultiAlias, []},
180+
{Credo.Check.Readability.NestedFunctionCalls, []},
181+
{Credo.Check.Readability.OneArityFunctionInPipe, []},
182+
{Credo.Check.Readability.OnePipePerLine, []},
183+
{Credo.Check.Readability.SeparateAliasRequire, []},
184+
{Credo.Check.Readability.SingleFunctionToBlockPipe, []},
185+
{Credo.Check.Readability.SinglePipe, []},
186+
{Credo.Check.Readability.Specs, []},
187+
{Credo.Check.Readability.StrictModuleLayout, []},
188+
{Credo.Check.Readability.WithCustomTaggedTuple, []},
189+
{Credo.Check.Refactor.ABCSize, []},
190+
{Credo.Check.Refactor.AppendSingleItem, []},
191+
{Credo.Check.Refactor.DoubleBooleanNegation, []},
192+
{Credo.Check.Refactor.FilterReject, []},
193+
{Credo.Check.Refactor.IoPuts, []},
194+
{Credo.Check.Refactor.MapMap, []},
195+
{Credo.Check.Refactor.ModuleDependencies, []},
196+
{Credo.Check.Refactor.NegatedIsNil, []},
197+
{Credo.Check.Refactor.PassAsyncInTestCases, []},
198+
{Credo.Check.Refactor.PipeChainStart, []},
199+
{Credo.Check.Refactor.RejectFilter, []},
200+
{Credo.Check.Refactor.VariableRebinding, []},
201+
{Credo.Check.Warning.LazyLogging, []},
202+
{Credo.Check.Warning.LeakyEnvironment, []},
203+
{Credo.Check.Warning.MapGetUnsafePass, []},
204+
{Credo.Check.Warning.MixEnv, []},
205+
{Credo.Check.Warning.UnsafeToAtom, []},
206+
{Credo.Check.Warning.MissedMetadataKeyInLoggerConfig, []}
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+
}

.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}.exs", "{config,lib,test}/**/*.{ex,exs}"]
5+
]

.github/CONTRIBUTING.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Contributing to `localhost_run`
2+
3+
## Welcome!
4+
5+
We look forward to your contributions! Here are some examples how you can
6+
contribute:
7+
8+
- [Report a bug](https://github.com/erlef/localhost-run/issues/new?type=bug)
9+
- [Propose a new feature](https://github.com/erlef/localhost-run/issues/new?type=Feature)
10+
- [Send a pull request](https://github.com/erlef/erlef/pulls)
11+
12+
## We have a Code of Conduct
13+
14+
Please note that this project is released with a
15+
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this
16+
project you agree to abide by its terms.
17+
18+
## Any contributions you make will be under the Apache 2.0 License
19+
20+
When you submit code changes, your submissions are understood to be under the
21+
same [Apache 2.0](https://github.com/erlef/erlef/blob/main/LICENSE)
22+
that covers the project. By contributing to this project, you agree that your
23+
contributions will be licensed under its Apache 2.0 License.
24+
25+
## Write bug reports with detail, background, and sample code
26+
27+
In your bug report, please provide the following:
28+
29+
- A quick summary and/or background
30+
- Steps to reproduce
31+
- Be specific!
32+
- Give sample code if you can.
33+
- What you expected would happen
34+
- What actually happens
35+
- Notes (possibly including why you think this might be happening, or stuff you
36+
- tried that didn't work)
37+
38+
<!--
39+
TODO: Put in once V1 is released
40+
Please do not report a bug for a version of `erlef` that is no longer
41+
supported (`< 1.0.0`). Please do not report a bug if you are using a version of
42+
Erlang or Elixir that is not supported by the version of `erlef` you are using.
43+
-->
44+
45+
Please post code and output as text
46+
([using proper markup](https://guides.github.com/features/mastering-markdown/)).
47+
Do not post screenshots of code or output.
48+
49+
## Workflow for Pull Requests
50+
51+
1. Fork the repository.
52+
2. Create your branch from `main` if you plan to implement new functionality or
53+
change existing code significantly; create your branch from the oldest branch
54+
that is affected by the bug if you plan to fix a bug.
55+
3. Implement your change and add tests for it.
56+
4. Ensure the test suite passes.
57+
5. Ensure the code complies with our coding guidelines (see below).
58+
6. Send that pull request!
59+
60+
Please make sure you have
61+
[set up your user name and email address](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup)
62+
for use with Git. Strings such as `silly nick name <root@localhost>` look really
63+
stupid in the commit history of a project.
64+
65+
We encourage you to
66+
[sign your Git commits with your GPG key](https://docs.github.com/en/github/authenticating-to-github/signing-commits).
67+
68+
Pull requests for new features must be based on the `main` branch.
69+
70+
We are trying to keep backwards compatibility breaks in `localhost_run` to a
71+
minimum. Please take this into account when proposing changes.
72+
73+
Due to time constraints, we are not always able to respond as quickly as we
74+
would like. Please do not take delays personal and feel free to remind us if you
75+
feel that we forgot to respond.
76+
77+
## Coding Guidelines
78+
79+
This project comes with configured linters (located in `.credo.exs` in the
80+
repository) that you can use to perform various checks:
81+
82+
```bash
83+
$ mix credo
84+
```
85+
86+
This project comes with configuration (located in `.formatter.exs` in the
87+
repository) that you can use to (re)format your source code for compliance with
88+
this project's coding guidelines:
89+
90+
```bash
91+
$ mix format
92+
```
93+
94+
This project uses `dialyzer` to perform static code checking. Run it to make
95+
sure that your code is valid:
96+
97+
```bash
98+
$ mix dialyzer
99+
```
100+
101+
Please understand that we will not accept a pull request when its changes
102+
violate this project's coding guidelines.
103+
104+
## Using `localhost_run` from a Git checkout
105+
106+
The following commands can be used to perform the initial checkout of
107+
`localhost_run`:
108+
109+
```bash
110+
$ git clone [email protected]:erlef/localhost-run.git
111+
112+
$ cd localhost-run
113+
```
114+
115+
Install `localhost-run`'s dependencies using [mix](https://hexdocs.pm/mix/Mix.html):
116+
117+
```bash
118+
$ mix deps.get
119+
```
120+
121+
## Running `localhost_run`'s test suite
122+
123+
After following the steps shown above, `localhost_run`'s test suite is run like
124+
this:
125+
126+
```bash
127+
$ mix test
128+
```
129+
130+
## Generating `localhost_run` Documentation
131+
132+
To generate the documentation for the library, run:
133+
134+
```bash
135+
$ mix docs
136+
```

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: "/"
6+
schedule:
7+
interval: weekly
8+
groups:
9+
github-actions:
10+
applies-to: version-updates
11+
patterns:
12+
- "*"

.github/scorecard.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
annotations:
2+
- checks:
3+
- fuzzing
4+
reasons:
5+
- reason: not-applicable # Erlang / Elixir is memory safe
6+
- checks:
7+
- packaging
8+
reasons:
9+
- reason: not-supported # Using Hex.pm

0 commit comments

Comments
 (0)