From 623544e5957a9e68a77224fc9b95204e9381d912 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 6 Jul 2017 01:09:08 +0300 Subject: [PATCH] Adds dializer support --- CONTRIBUTING.md | 31 +++++++++++++++++++++++++++++++ README.md | 9 +++------ mix.exs | 2 ++ mix.lock | 1 + 4 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0765036 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing + +## Pull Requests Welcome + +1. Fork the project +2. Create a topic branch +3. Make logically-grouped commits with clear commit messages +4. Push commits to your fork +5. Open a pull request against `recaptcha/master` + +## Issues + +If you believe there to be a bug, please provide the maintainers with enough +detail to reproduce or a link to an app exhibiting unexpected behavior. For +help, please start with Stack Overflow. + +## Development and testing + +To set up the development environment you would have to follow several steps: + +0. setup `elixir`, we are using the latest release, but supporting everything from `1.2` +1. clone the repo +2. `mix deps.get && mix compile` + +To test if everything is working: + +1. `mix test` will run unit-tests +2. `mix credo --strict` will run linting +3. `mix dialyzer` will run static analyzer tool to check that everything is fine with your code. It may take some time at the first run + +If everything is fine - feel free to submit your code! diff --git a/README.md b/README.md index dacb8ed..8c025dc 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ if you have any problems with migrating. ```elixir defp deps do [ - {:recaptcha, "~> 2.0"}, + {:recaptcha, "~> 2.0"}, ] end ``` @@ -76,7 +76,7 @@ Recaptcha provides the `verify/2` method. Below is an example using a Phoenix co ```elixir def create(conn, params) do - # some code + # some code case Recaptcha.verify(params["g-recaptcha-response"]) do {:ok, response} -> do_something {:error, errors} -> handle_error @@ -100,10 +100,7 @@ Option | Action ## Contributing -* Fork the project. -* Make your feature addition or bug fix. (If you're not sure raise an issue to discuss first) -* Commit -* Send me a pull request +Check out [CONTRIBUTING.md](/CONTRIBUTING.md) if you want to help. ## License diff --git a/mix.exs b/mix.exs index 1c22778..71f1eb7 100644 --- a/mix.exs +++ b/mix.exs @@ -39,8 +39,10 @@ defmodule Recaptcha.Mixfile do [ {:httpoison, "~> 0.11.0"}, {:poison, "~> 1.5 or ~> 2.0 or ~> 3.0"}, + {:credo, "~> 0.6", only: [:dev, :test]}, {:ex_doc, ">= 0.0.0", only: :dev}, + {:dialyxir, "~> 0.5", only: [:dev]}, {:excoveralls, "~> 0.6", only: :test}, ] end diff --git a/mix.lock b/mix.lock index acafe64..b4af34f 100644 --- a/mix.lock +++ b/mix.lock @@ -1,6 +1,7 @@ %{"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"}, "certifi": {:hex, :certifi, "1.2.1", "c3904f192bd5284e5b13f20db3ceac9626e14eeacfbb492e19583cf0e37b22be", [:rebar3], [], "hexpm"}, "credo": {:hex, :credo, "0.6.0", "44a82f82b94eeb4ba6092c89b8a6730ca1a3291c7940739d5acc8806d25ac991", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}], "hexpm"}, + "dialyxir": {:hex, :dialyxir, "0.5.0", "5bc543f9c28ecd51b99cc1a685a3c2a1a93216990347f259406a910cf048d1d7", [:mix], [], "hexpm"}, "earmark": {:hex, :earmark, "1.0.1", "2c2cd903bfdc3de3f189bd9a8d4569a075b88a8981ded9a0d95672f6e2b63141", [:mix], [], "hexpm"}, "ex_doc": {:hex, :ex_doc, "0.13.0", "aa2f8fe4c6136a2f7cfc0a7e06805f82530e91df00e2bff4b4362002b43ada65", [:mix], [{:earmark, "~> 1.0", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"}, "excoveralls": {:hex, :excoveralls, "0.6.5", "2d3faf8fe40e77c980620f1344f6d3df2c43b18ab9c21a2c1781a898cc710184", [:mix], [{:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: false]}, {:hackney, ">= 0.12.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"},