Skip to content

Commit fe87812

Browse files
committed
Several updates and improvements
- Upgrade to Elixir 1.6+ - Format using mix format - Support multiple possible runtime executables - Support runtime command arguments - Add V8 runtime - Add Credo and Dialyxir static analysis - Relicense under CC0 1.0 Universal
1 parent a1c0af4 commit fe87812

22 files changed

+597
-207
lines changed

.credo.exs

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
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 exec using `mix credo -C <name>`. If no exec 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/",
30+
"bench/",
31+
"{mix,.credo,.formatter}.exs"
32+
],
33+
excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"]
34+
},
35+
#
36+
# If you create your own checks, you must specify the source files for
37+
# them here, so they can be loaded by Credo before running the analysis.
38+
#
39+
requires: [],
40+
#
41+
# If you want to enforce a style guide and need a more traditional linting
42+
# experience, you can change `strict` to `true` below:
43+
#
44+
strict: true,
45+
#
46+
# If you want to use uncolored output by default, you can change `color`
47+
# to `false` below:
48+
#
49+
color: true,
50+
#
51+
# You can customize the parameters of any check by adding a second element
52+
# to the tuple.
53+
#
54+
# To disable a check put `false` as second element:
55+
#
56+
# {Credo.Check.Design.DuplicatedCode, false}
57+
#
58+
checks: [
59+
#
60+
## Consistency Checks
61+
#
62+
{Credo.Check.Consistency.ExceptionNames},
63+
{Credo.Check.Consistency.LineEndings},
64+
{Credo.Check.Consistency.ParameterPatternMatching},
65+
{Credo.Check.Consistency.SpaceAroundOperators},
66+
{Credo.Check.Consistency.SpaceInParentheses},
67+
{Credo.Check.Consistency.TabsOrSpaces},
68+
69+
#
70+
## Design Checks
71+
#
72+
# You can customize the priority of any check
73+
# Priority values are: `low, normal, high, higher`
74+
#
75+
{Credo.Check.Design.AliasUsage, priority: :low},
76+
# For some checks, you can also set other parameters
77+
#
78+
# If you don't want the `setup` and `test` macro calls in ExUnit tests
79+
# or the `schema` macro in Ecto schemas to trigger DuplicatedCode, just
80+
# set the `excluded_macros` parameter to `[:schema, :setup, :test]`.
81+
#
82+
{Credo.Check.Design.DuplicatedCode, excluded_macros: []},
83+
# You can also customize the exit_status of each check.
84+
# If you don't want TODO comments to cause `mix credo` to fail, just
85+
# set this value to 0 (zero).
86+
#
87+
{Credo.Check.Design.TagTODO, exit_status: 2},
88+
{Credo.Check.Design.TagFIXME},
89+
90+
#
91+
## Readability Checks
92+
#
93+
{Credo.Check.Readability.AliasOrder},
94+
{Credo.Check.Readability.FunctionNames},
95+
{Credo.Check.Readability.LargeNumbers},
96+
{Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 80},
97+
{Credo.Check.Readability.ModuleAttributeNames},
98+
{Credo.Check.Readability.ModuleDoc},
99+
{Credo.Check.Readability.ModuleNames},
100+
{Credo.Check.Readability.ParenthesesOnZeroArityDefs},
101+
{Credo.Check.Readability.ParenthesesInCondition},
102+
{Credo.Check.Readability.PredicateFunctionNames},
103+
{Credo.Check.Readability.PreferImplicitTry},
104+
{Credo.Check.Readability.RedundantBlankLines},
105+
{Credo.Check.Readability.StringSigils},
106+
{Credo.Check.Readability.TrailingBlankLine},
107+
{Credo.Check.Readability.TrailingWhiteSpace},
108+
{Credo.Check.Readability.VariableNames},
109+
{Credo.Check.Readability.Semicolons},
110+
{Credo.Check.Readability.SpaceAfterCommas},
111+
112+
#
113+
## Refactoring Opportunities
114+
#
115+
{Credo.Check.Refactor.DoubleBooleanNegation},
116+
{Credo.Check.Refactor.CondStatements},
117+
{Credo.Check.Refactor.CyclomaticComplexity},
118+
{Credo.Check.Refactor.FunctionArity},
119+
{Credo.Check.Refactor.LongQuoteBlocks},
120+
{Credo.Check.Refactor.MapInto},
121+
{Credo.Check.Refactor.MatchInCondition},
122+
{Credo.Check.Refactor.NegatedConditionsInUnless},
123+
{Credo.Check.Refactor.NegatedConditionsWithElse},
124+
{Credo.Check.Refactor.Nesting},
125+
{Credo.Check.Refactor.PipeChainStart,
126+
excluded_argument_types: [:atom, :binary, :fn, :keyword],
127+
excluded_functions: []},
128+
{Credo.Check.Refactor.UnlessWithElse},
129+
130+
#
131+
## Warnings
132+
#
133+
{Credo.Check.Warning.BoolOperationOnSameValues},
134+
{Credo.Check.Warning.ExpensiveEmptyEnumCheck},
135+
{Credo.Check.Warning.IExPry},
136+
{Credo.Check.Warning.IoInspect},
137+
{Credo.Check.Warning.LazyLogging},
138+
{Credo.Check.Warning.OperationOnSameValues},
139+
{Credo.Check.Warning.OperationWithConstantResult},
140+
{Credo.Check.Warning.UnusedEnumOperation},
141+
{Credo.Check.Warning.UnusedFileOperation},
142+
{Credo.Check.Warning.UnusedKeywordOperation},
143+
{Credo.Check.Warning.UnusedListOperation},
144+
{Credo.Check.Warning.UnusedPathOperation},
145+
{Credo.Check.Warning.UnusedRegexOperation},
146+
{Credo.Check.Warning.UnusedStringOperation},
147+
{Credo.Check.Warning.UnusedTupleOperation},
148+
{Credo.Check.Warning.RaiseInsideRescue},
149+
150+
#
151+
# Controversial and experimental checks (opt-in, just remove `, false`)
152+
#
153+
{Credo.Check.Refactor.ABCSize, false},
154+
{Credo.Check.Refactor.AppendSingleItem, false},
155+
{Credo.Check.Refactor.VariableRebinding, false},
156+
{Credo.Check.Warning.MapGetUnsafePass, false},
157+
{Credo.Check.Consistency.MultiAliasImportRequireUse, false},
158+
159+
#
160+
# Deprecated checks (these will be deleted after a grace period)
161+
#
162+
{Credo.Check.Readability.Specs, false}
163+
164+
#
165+
# Custom checks can be created using `mix credo.gen.check`.
166+
#
167+
]
168+
}
169+
]
170+
}

.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+
inputs: ["{mix,.credo,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"],
4+
line_length: 80
5+
]

.gitignore

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
/_build
2-
/deps
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
317
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
420
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
execjs-*.tar

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
erlang 21.0.5
2+
elixir 1.7.2-otp-21

.travis.yml

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
1+
---
2+
sudo: false
3+
14
language: elixir
25
elixir:
3-
- 1.4.0
4-
- 1.3.4
5-
- 1.3.3
6-
- 1.3.2
7-
- 1.3.1
8-
- 1.3.0
9-
- 1.2.6
10-
- 1.2.5
11-
- 1.2.4
12-
- 1.2.3
13-
- 1.2.2
14-
- 1.2.1
15-
- 1.2.0
16-
- 1.1.1
17-
- 1.1.0
18-
- 1.0.5
19-
- 1.0.4
6+
- 1.7.2
7+
- 1.6.6
208
otp_release:
21-
- 19.2
22-
- 19.1
23-
- 19.0
24-
- 18.3
25-
- 18.2
26-
- 18.1
27-
- 18.0
28-
before_install:
29-
- sudo apt-get update -qq
30-
- sudo apt-get install -qq rhino
9+
- 21.0
10+
- 20.3
11+
12+
addons:
13+
apt:
14+
packages:
15+
- nodejs
16+
- libmozjs-24-bin
17+
- libjavascriptcoregtk-3.0-bin
18+
- rhino
19+
3120
env:
3221
- EXECJS_RUNTIME=Node
22+
- EXECJS_RUNTIME=SpiderMonkey
23+
- EXECJS_RUNTIME=JavaScriptCore
3324
- EXECJS_RUNTIME=Rhino

LICENSE

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Creative Commons Legal Code
2+
3+
CC0 1.0 Universal
4+
5+
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6+
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7+
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8+
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9+
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10+
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11+
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12+
HEREUNDER.
13+
14+
Statement of Purpose
15+
16+
The laws of most jurisdictions throughout the world automatically confer
17+
exclusive Copyright and Related Rights (defined below) upon the creator
18+
and subsequent owner(s) (each and all, an "owner") of an original work of
19+
authorship and/or a database (each, a "Work").
20+
21+
Certain owners wish to permanently relinquish those rights to a Work for
22+
the purpose of contributing to a commons of creative, cultural and
23+
scientific works ("Commons") that the public can reliably and without fear
24+
of later claims of infringement build upon, modify, incorporate in other
25+
works, reuse and redistribute as freely as possible in any form whatsoever
26+
and for any purposes, including without limitation commercial purposes.
27+
These owners may contribute to the Commons to promote the ideal of a free
28+
culture and the further production of creative, cultural and scientific
29+
works, or to gain reputation or greater distribution for their Work in
30+
part through the use and efforts of others.
31+
32+
For these and/or other purposes and motivations, and without any
33+
expectation of additional consideration or compensation, the person
34+
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35+
is an owner of Copyright and Related Rights in the Work, voluntarily
36+
elects to apply CC0 to the Work and publicly distribute the Work under its
37+
terms, with knowledge of his or her Copyright and Related Rights in the
38+
Work and the meaning and intended legal effect of CC0 on those rights.
39+
40+
1. Copyright and Related Rights. A Work made available under CC0 may be
41+
protected by copyright and related or neighboring rights ("Copyright and
42+
Related Rights"). Copyright and Related Rights include, but are not
43+
limited to, the following:
44+
45+
i. the right to reproduce, adapt, distribute, perform, display,
46+
communicate, and translate a Work;
47+
ii. moral rights retained by the original author(s) and/or performer(s);
48+
iii. publicity and privacy rights pertaining to a person's image or
49+
likeness depicted in a Work;
50+
iv. rights protecting against unfair competition in regards to a Work,
51+
subject to the limitations in paragraph 4(a), below;
52+
v. rights protecting the extraction, dissemination, use and reuse of data
53+
in a Work;
54+
vi. database rights (such as those arising under Directive 96/9/EC of the
55+
European Parliament and of the Council of 11 March 1996 on the legal
56+
protection of databases, and under any national implementation
57+
thereof, including any amended or successor version of such
58+
directive); and
59+
vii. other similar, equivalent or corresponding rights throughout the
60+
world based on applicable law or treaty, and any national
61+
implementations thereof.
62+
63+
2. Waiver. To the greatest extent permitted by, but not in contravention
64+
of, applicable law, Affirmer hereby overtly, fully, permanently,
65+
irrevocably and unconditionally waives, abandons, and surrenders all of
66+
Affirmer's Copyright and Related Rights and associated claims and causes
67+
of action, whether now known or unknown (including existing as well as
68+
future claims and causes of action), in the Work (i) in all territories
69+
worldwide, (ii) for the maximum duration provided by applicable law or
70+
treaty (including future time extensions), (iii) in any current or future
71+
medium and for any number of copies, and (iv) for any purpose whatsoever,
72+
including without limitation commercial, advertising or promotional
73+
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74+
member of the public at large and to the detriment of Affirmer's heirs and
75+
successors, fully intending that such Waiver shall not be subject to
76+
revocation, rescission, cancellation, termination, or any other legal or
77+
equitable action to disrupt the quiet enjoyment of the Work by the public
78+
as contemplated by Affirmer's express Statement of Purpose.
79+
80+
3. Public License Fallback. Should any part of the Waiver for any reason
81+
be judged legally invalid or ineffective under applicable law, then the
82+
Waiver shall be preserved to the maximum extent permitted taking into
83+
account Affirmer's express Statement of Purpose. In addition, to the
84+
extent the Waiver is so judged Affirmer hereby grants to each affected
85+
person a royalty-free, non transferable, non sublicensable, non exclusive,
86+
irrevocable and unconditional license to exercise Affirmer's Copyright and
87+
Related Rights in the Work (i) in all territories worldwide, (ii) for the
88+
maximum duration provided by applicable law or treaty (including future
89+
time extensions), (iii) in any current or future medium and for any number
90+
of copies, and (iv) for any purpose whatsoever, including without
91+
limitation commercial, advertising or promotional purposes (the
92+
"License"). The License shall be deemed effective as of the date CC0 was
93+
applied by Affirmer to the Work. Should any part of the License for any
94+
reason be judged legally invalid or ineffective under applicable law, such
95+
partial invalidity or ineffectiveness shall not invalidate the remainder
96+
of the License, and in such case Affirmer hereby affirms that he or she
97+
will not (i) exercise any of his or her remaining Copyright and Related
98+
Rights in the Work or (ii) assert any associated claims and causes of
99+
action with respect to the Work, in either case contrary to Affirmer's
100+
express Statement of Purpose.
101+
102+
4. Limitations and Disclaimers.
103+
104+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
105+
surrendered, licensed or otherwise affected by this document.
106+
b. Affirmer offers the Work as-is and makes no representations or
107+
warranties of any kind concerning the Work, express, implied,
108+
statutory or otherwise, including without limitation warranties of
109+
title, merchantability, fitness for a particular purpose, non
110+
infringement, or the absence of latent or other defects, accuracy, or
111+
the present or absence of errors, whether or not discoverable, all to
112+
the greatest extent permissible under applicable law.
113+
c. Affirmer disclaims responsibility for clearing rights of other persons
114+
that may apply to the Work or any use thereof, including without
115+
limitation any person's Copyright and Related Rights in the Work.
116+
Further, Affirmer disclaims responsibility for obtaining any necessary
117+
consents, permissions or other rights required for any use of the
118+
Work.
119+
d. Affirmer understands and acknowledges that Creative Commons is not a
120+
party to this document and has no duty or obligation with respect to
121+
this CC0 or use of the Work.

0 commit comments

Comments
 (0)