From 366c317cd22d8454367acae1b4d6843b068ade0f Mon Sep 17 00:00:00 2001 From: "V. Elenhaupt" Date: Sat, 23 Dec 2017 21:45:46 +0200 Subject: [PATCH] Enable ameba linter --- .ameba.yml | 13 +++++++++++++ .travis.yml | 5 +++++ shard.yml | 3 +++ spec/support/factories.cr | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .ameba.yml diff --git a/.ameba.yml b/.ameba.yml new file mode 100644 index 0000000..e3e6eb7 --- /dev/null +++ b/.ameba.yml @@ -0,0 +1,13 @@ +# This configuration file was generated by `ameba --gen-config` +# on 2017-12-23 21:39:50 +0200 using Ameba version 0.3.0. +# The point is for the user to remove these configuration records +# one by one as the reported problems are removed from the code base. + +# Problems found: 3 +# Run `ameba --only LargeNumbers` for details +LargeNumbers: + Description: Disallows usage of large numbers without underscore + IntMinDigits: 5 + Enabled: true + Excluded: + - spec/controllers/oauth_controller_spec.cr diff --git a/.travis.yml b/.travis.yml index 3852304..936df1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,8 @@ language: crystal services: postgresql before_script: - psql -c "create database $DATABASE_NAME;" -U postgres +install: + - crystal deps +script: + - crystal spec + - bin/ameba diff --git a/shard.yml b/shard.yml index 4dbea24..2f8c66c 100644 --- a/shard.yml +++ b/shard.yml @@ -50,3 +50,6 @@ development_dependencies: webmock: github: manastech/webmock.cr branch: master + + ameba: + github: veelenga/ameba diff --git a/spec/support/factories.cr b/spec/support/factories.cr index be6e71b..5f7d8c2 100644 --- a/spec/support/factories.cr +++ b/spec/support/factories.cr @@ -2,7 +2,7 @@ require "../../src/models/**" def user(**params) attributes = { - :uid => (rand() * 10000).to_i.to_s, + :uid => (rand() * 10_000).to_i.to_s, :login => "johndoe", :provider => "github", } of Symbol | String => String | JSON::Type