Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit a753a71

Browse files
authored
Update continuous integration and Update Readme (#69)
1 parent 6126b55 commit a753a71

File tree

9 files changed

+164
-53
lines changed

9 files changed

+164
-53
lines changed

.circleci/config.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2.0
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/elixir:1.6.6-otp-21
6+
environment:
7+
MIX_ENV: test
8+
steps:
9+
- checkout
10+
- restore_cache:
11+
keys:
12+
- v2-dependency-cache-{{ checksum "mix.lock" }}
13+
- run: mix local.hex --force
14+
- run: mix local.rebar --force
15+
- run: mix deps.get
16+
- run: mix deps.compile
17+
- run: mix compile
18+
# not passing yet
19+
# - run: mix credo --strict
20+
- run: mix coveralls.circle
21+
- run: mix inch.report
22+
- save_cache:
23+
key: v2-dependency-cache-{{ checksum "mix.lock" }}
24+
paths:
25+
- _build
26+
- deps

.credo.exs

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
%{configs: [
2+
%{name: "default",
3+
files: %{
4+
included: ["lib/", "test/", "integration/"],
5+
excluded: [~r"/_build/", ~r"/deps/"]
6+
},
7+
requires: [],
8+
check_for_updates: false,
9+
10+
# You can customize the parameters of any check by adding a second element
11+
# to the tuple.
12+
#
13+
# To disable a check put `false` as second element:
14+
#
15+
# {Credo.Check.Design.DuplicatedCode, false}
16+
#
17+
checks: [
18+
{Credo.Check.Consistency.ExceptionNames},
19+
{Credo.Check.Consistency.LineEndings},
20+
{Credo.Check.Consistency.MultiAliasImportRequireUse},
21+
{Credo.Check.Consistency.ParameterPatternMatching},
22+
{Credo.Check.Consistency.SpaceAroundOperators},
23+
{Credo.Check.Consistency.SpaceInParentheses},
24+
{Credo.Check.Consistency.TabsOrSpaces},
25+
26+
{Credo.Check.Design.AliasUsage, false},
27+
{Credo.Check.Design.DuplicatedCode, excluded_macros: []},
28+
29+
# Disabled for now as those are checked by Code Climate
30+
{Credo.Check.Design.TagTODO, false},
31+
{Credo.Check.Design.TagFIXME, false},
32+
33+
{Credo.Check.Readability.FunctionNames},
34+
{Credo.Check.Readability.LargeNumbers},
35+
{Credo.Check.Readability.MaxLineLength, false},
36+
{Credo.Check.Readability.ModuleAttributeNames},
37+
{Credo.Check.Readability.ModuleDoc},
38+
{Credo.Check.Readability.ModuleNames},
39+
{Credo.Check.Readability.ParenthesesInCondition},
40+
{Credo.Check.Readability.PredicateFunctionNames},
41+
{Credo.Check.Readability.PreferImplicitTry, false},
42+
{Credo.Check.Readability.RedundantBlankLines},
43+
{Credo.Check.Readability.Semicolons},
44+
{Credo.Check.Readability.SinglePipe, false},
45+
# ^^ Ecto does this quite a bit and we want to follow their
46+
# code format closely, so silence this warning.
47+
48+
{Credo.Check.Readability.SpaceAfterCommas},
49+
{Credo.Check.Readability.Specs, false},
50+
{Credo.Check.Readability.StringSigils, false},
51+
# ^^ Ecto does this quite a bit and we want to follow their
52+
# code format closely, so silence this warning.
53+
54+
{Credo.Check.Readability.TrailingBlankLine},
55+
{Credo.Check.Readability.TrailingWhiteSpace},
56+
{Credo.Check.Readability.VariableNames},
57+
{Credo.Check.Readability.RedundantBlankLines},
58+
59+
{Credo.Check.Refactor.ABCSize, false},
60+
{Credo.Check.Refactor.CondStatements},
61+
{Credo.Check.Refactor.CyclomaticComplexity},
62+
{Credo.Check.Refactor.DoubleBooleanNegation, false},
63+
{Credo.Check.Refactor.FunctionArity, max_arity: 8},
64+
{Credo.Check.Refactor.MatchInCondition},
65+
{Credo.Check.Refactor.PipeChainStart, false},
66+
{Credo.Check.Refactor.NegatedConditionsInUnless},
67+
{Credo.Check.Refactor.NegatedConditionsWithElse},
68+
{Credo.Check.Refactor.Nesting},
69+
{Credo.Check.Refactor.UnlessWithElse},
70+
{Credo.Check.Refactor.VariableRebinding, false},
71+
72+
{Credo.Check.Warning.BoolOperationOnSameValues},
73+
{Credo.Check.Warning.IExPry},
74+
{Credo.Check.Warning.IoInspect, false},
75+
{Credo.Check.Warning.OperationOnSameValues, false},
76+
# Disabled because of p.x == p.x in Ecto queries
77+
{Credo.Check.Warning.OperationWithConstantResult},
78+
{Credo.Check.Warning.UnusedEnumOperation},
79+
{Credo.Check.Warning.UnusedFileOperation},
80+
{Credo.Check.Warning.UnusedKeywordOperation},
81+
{Credo.Check.Warning.UnusedListOperation},
82+
{Credo.Check.Warning.UnusedPathOperation},
83+
{Credo.Check.Warning.UnusedRegexOperation},
84+
{Credo.Check.Warning.UnusedStringOperation},
85+
{Credo.Check.Warning.UnusedTupleOperation},
86+
]
87+
}
88+
]}

.formatter.exs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Used by "mix format"
2+
[
3+
inputs: ["mix.exs", "{config,lib,test,bench}/**/*.{ex,exs}"]
4+
]

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ erl_crash.dump
55
*.ez
66
/doc
77
/docs
8-
mix.lock

.tool-versions

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
erlang 21.0.1
2+
elixir 1.6.6-otp-21

.travis.yml

-23
This file was deleted.

README.md

+8-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
[![Build Status](https://travis-ci.org/mmmries/sqlitex.svg?branch=master)](https://travis-ci.org/mmmries/sqlitex)
2-
[![Inline docs](http://inch-ci.org/github/mmmries/sqlitex.svg?branch=master)](http://inch-ci.org/github/mmmries/sqlitex)
1+
[![CircleCI](https://circleci.com/gh/Sqlite-Ecto/sqlitex.svg?style=svg)](https://circleci.com/gh/Sqlite-Ecto/sqlitex)
2+
[![Coverage Status](https://coveralls.io/repos/github/Sqlite-Ecto/sqlitex/badge.svg?branch=master)](https://coveralls.io/github/Sqlite-Ecto/sqlitex?branch=master)
3+
[![Inline docs](http://inch-ci.org/github/Sqlite-Ecto/sqlitex.svg)](http://inch-ci.org/github/Sqlite-Ecto/sqlitex)
34
[![Hex.pm](https://img.shields.io/hexpm/v/sqlitex.svg)](https://hex.pm/packages/sqlitex)
45
[![Hex.pm](https://img.shields.io/hexpm/dt/sqlitex.svg)](https://hex.pm/packages/sqlitex)
56

6-
Sqlitex
7-
=======
7+
# Sqlitex
88

99
An Elixir wrapper around [esqlite](https://github.com/mmzeeman/esqlite). The main aim here is to provide convenient usage of sqlite databases.
1010

11-
Updated to 1.0
12-
==============
11+
# Updated to 1.0
1312

1413
With the 1.0 release we made just a single breaking change. `Sqlitex.Query.query` previously returned just the raw query results on success and `{:error, reason}` on failure.
1514
This has been bothering us for a while so we changed it in 1.0 to return `{:ok, results}` on success and `{:error, reason}` on failure.
1615
This should make it easier to pattern match on. The `Sqlitex.Query.query!` function has kept its same functionality of returning bare results on success and raising an error on failure.
1716

18-
Usage
19-
=====
17+
# Usage
2018

2119
The simple way to use sqlitex is just to open a database and run a query
2220

@@ -65,9 +63,5 @@ Sqlitex.Server.query(Golf.DB,
6563
ORDER BY g.played_at DESC LIMIT 10")
6664
```
6765

68-
Plans
69-
=====
70-
71-
I started this project mostly as a way to learn about Elixir.
72-
Some other people have found it useful and have done the hard work to make it work with ecto [v1.X](https://github.com/jazzyb/sqlite_ecto) and [v2.X](https://github.com/scouten/sqlite_ecto2).
73-
I'm not currently using this for any production-level projects, but I'm happy to continue maintaining it as long as people find it useful.
66+
# Looking for Ecto?
67+
Check out the [Sqlite Ecto2 adapter](https://github.com/Sqlite-Ecto/sqlite_ecto2)

mix.exs

+13-15
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ defmodule Sqlitex.Mixfile do
55
[
66
app: :sqlitex,
77
version: "1.4.2",
8-
elixir: "~> 1.2",
8+
elixir: "~> 1.4",
99
deps: deps(),
1010
package: package(),
1111
test_coverage: [tool: ExCoveralls],
1212
preferred_cli_env: [
13-
"coveralls": :test,
13+
coveralls: :test,
14+
"coveralls.circle": :test,
1415
"coveralls.detail": :test,
1516
"coveralls.post": :test,
1617
"coveralls.html": :test],
@@ -23,32 +24,29 @@ defmodule Sqlitex.Mixfile do
2324

2425
# Configuration for the OTP application
2526
def application do
26-
[applications: [:logger, :esqlite]]
27+
[extra_applications: [:logger]]
2728
end
2829

2930
# Type `mix help deps` for more examples and options
3031
defp deps do
3132
[
3233
{:esqlite, "~> 0.2.4"},
33-
{:decimal, "~> 1.1"},
34-
35-
{:credo, "~> 0.4", only: :dev},
36-
{:dialyxir, "~> 0.5.1", only: :dev, runtime: false},
37-
{:earmark, "~> 1.2", only: :dev},
38-
{:excoveralls, "~> 0.6", only: :test},
39-
{:ex_doc, "~> 0.18", only: :dev},
40-
{:inch_ex, "~> 0.5", only: :dev},
41-
42-
{:excheck, "~> 0.5", only: :test},
34+
{:decimal, "~> 1.5"},
35+
{:credo, "~> 0.10", only: :dev},
36+
{:dialyxir, "~> 1.0.0-rc.3", only: :dev, runtime: false},
37+
{:excoveralls, "~> 0.9", only: :test},
38+
{:ex_doc, "~> 0.18", only: :docs, runtime: false},
39+
{:excheck, "~> 0.6", only: :test},
40+
{:inch_ex, "~> 1.0", only: :test},
4341
{:triq, "~> 1.2", only: :test},
4442
]
4543
end
4644

4745
defp package do
48-
[maintainers: ["Michael Ries", "Jason M Barnes", "Graeme Coupar", "Eric Scouten"],
46+
[maintainers: ["Michael Ries", "Jason M Barnes", "Graeme Coupar", "Eric Scouten", "Connor Rigby"],
4947
licenses: ["MIT"],
5048
links: %{
51-
github: "https://github.com/mmmries/sqlitex",
49+
github: "https://github.com/Sqlite-Ecto/sqlitex",
5250
docs: "http://hexdocs.pm/sqlitex"}]
5351
end
5452
end

mix.lock

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
%{
2+
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"},
3+
"certifi": {:hex, :certifi, "2.3.1", "d0f424232390bf47d82da8478022301c561cf6445b5b5fb6a84d49a9e76d2639", [:rebar3], [{:parse_trans, "3.2.0", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"},
4+
"credo": {:hex, :credo, "0.10.0", "66234a95effaf9067edb19fc5d0cd5c6b461ad841baac42467afed96c78e5e9e", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
5+
"decimal": {:hex, :decimal, "1.5.0", "b0433a36d0e2430e3d50291b1c65f53c37d56f83665b43d79963684865beab68", [:mix], [], "hexpm"},
6+
"dialyxir": {:hex, :dialyxir, "1.0.0-rc.3", "774306f84973fc3f1e2e8743eeaa5f5d29b117f3916e5de74c075c02f1b8ef55", [:mix], [], "hexpm"},
7+
"earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:mix], [], "hexpm"},
8+
"esqlite": {:hex, :esqlite, "0.2.4", "3a8a352c190afe2d6b828b252a6fbff65b5cc1124647f38b15bdab3bf6fd4b3e", [:rebar3], [], "hexpm"},
9+
"ex_doc": {:hex, :ex_doc, "0.18.4", "4406b8891cecf1352f49975c6d554e62e4341ceb41b9338949077b0d4a97b949", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
10+
"excheck": {:hex, :excheck, "0.6.0", "f8595a8ac2c0abc0d060c1a4fce7d26f41574543366a52d5f3c84de30a69747b", [:mix], [], "hexpm"},
11+
"excoveralls": {:hex, :excoveralls, "0.9.1", "14fd20fac51ab98d8e79615814cc9811888d2d7b28e85aa90ff2e30dcf3191d6", [:mix], [{:hackney, ">= 0.12.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
12+
"hackney": {:hex, :hackney, "1.13.0", "24edc8cd2b28e1c652593833862435c80661834f6c9344e84b6a2255e7aeef03", [:rebar3], [{:certifi, "2.3.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "5.1.2", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
13+
"idna": {:hex, :idna, "5.1.2", "e21cb58a09f0228a9e0b95eaa1217f1bcfc31a1aaa6e1fdf2f53a33f7dbd9494", [:rebar3], [{:unicode_util_compat, "0.3.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
14+
"inch_ex": {:hex, :inch_ex, "1.0.0", "18496a900ca4b7542a1ff1159e7f8be6c2012b74ca55ac70de5e805f14cdf939", [:mix], [{:poison, "~> 1.5 or ~> 2.0 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"},
15+
"jason": {:hex, :jason, "1.1.1", "d3ccb840dfb06f2f90a6d335b536dd074db748b3e7f5b11ab61d239506585eb2", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"},
16+
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm"},
17+
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], [], "hexpm"},
18+
"parse_trans": {:hex, :parse_trans, "3.2.0", "2adfa4daf80c14dc36f522cf190eb5c4ee3e28008fc6394397c16f62a26258c2", [:rebar3], [], "hexpm"},
19+
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"},
20+
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], [], "hexpm"},
21+
"triq": {:hex, :triq, "1.2.0", "3fbf99c16671f084b558f7e799e38d92835d67dcc012fb40d418330ea1053455", [:rebar3], [], "hexpm"},
22+
"unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], [], "hexpm"},
23+
}

0 commit comments

Comments
 (0)