From 8cbdd0de4d76306d702ad3a5db97de2e32a59685 Mon Sep 17 00:00:00 2001 From: Vitalii Elenhaupt Date: Fri, 1 Dec 2017 19:00:11 +0200 Subject: [PATCH] Remove temp config, adjust Readme --- README.md | 6 +-- config/ameba.yml | 94 --------------------------------------- spec/ameba/runner_spec.cr | 2 +- 3 files changed, 4 insertions(+), 98 deletions(-) delete mode 100644 config/ameba.yml diff --git a/README.md b/README.md index 9a9311df..d9444b73 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,9 @@ Finished in 10.53 milliseconds ## Configuration Default configuration file is `.ameba.yml`. -It allows to configure or even disable specific rules. -Simply copy and adjust [existed sample](config/ameba.yml). -Each rule is enabled by default, even if you remove it from the config file. +It allows to configure rule properties, disable specific rules and exclude sources from the rules. + +Generate new file by running `ameba --gen-config`. ## Writing a new Rule diff --git a/config/ameba.yml b/config/ameba.yml deleted file mode 100644 index 92133d51..00000000 --- a/config/ameba.yml +++ /dev/null @@ -1,94 +0,0 @@ -ComparisonToBoolean: - # Disallows comparison to booleans in conditions. - Enabled: false - -ConstantNames: - # Enforces constant names to be in a screaming case. - Enabled: true - -DebuggerStatement: - # Disallows calls to debugger. - Enabled: true - -DuplicatedWhen: - # Disallows duplicated when conditions in case. - Enabled: true - -EmptyEnsure: - # Disallows empty ensure statement. - Enabled: true - -EmptyExpression: - # Disallows empty expressions. - Enabled: true - -HashDuplicatedKey: - # Disallows duplicated keys in hash literals. - Enabled: true - -LargeNumbers: - # A rule that disallows usage of large numbers without underscore. - Enabled: true - IntMinDigits: 5 # i.e. integers higher than 9999 - -LineLength: - # Disallows lines longer that MaxLength number of symbols. - Enabled: false - MaxLength: 80 - -LiteralInCondition: - # Disallows useless conditional statements that contain a literal in place - # of a variable or predicate function. - Enabled: true - -LiteralInInterpolation: - # Disallows useless string interpolations that contain a literal value - # instead of a variable or function. - Enabled: true - -MethodNames: - # Enforces method names to be in the underscored case. - Enabled: true - -NegatedConditionsInUnless: - # Disallows negated conditions in unless. - Enabled: true - -PercentArrays: - # Disallows unwanted symbols in percent array literals. - Enabled: true - StringArrayUnwantedSymbols: ',"' - SymbolArrayUnwantedSymbols: ',:' - -PredicateName: - # Disallows tautological predicate names, meaning those that start with - # the prefix `has_` or the prefix `is_`. - Enabled: true - -RedundantBegin: - # Disallows redundant begin blocks. - Enabled: true - -TrailingBlankLines: - # Disallows trailing blank lines at the end of the source file. - Enabled: true - -TrailingWhitespace: - # Disallows trailing whitespaces. - Enabled: true - -TypeNames: - # Enforces type names in a camelcase manner. - Enabled: true - -UnlessElse: - # Disallows the use of an `else` block with `unless`. - Enabled: true - -VariableNames: - # Enforces variable names to be in the underscored case. - Enabled: true - -WhileTrue: - # Disallows `while` statements with a `true` literal as condition - Enabled: true \ No newline at end of file diff --git a/spec/ameba/runner_spec.cr b/spec/ameba/runner_spec.cr index 07b90f5d..0bacee76 100644 --- a/spec/ameba/runner_spec.cr +++ b/spec/ameba/runner_spec.cr @@ -2,7 +2,7 @@ require "../spec_helper" module Ameba private def runner(files = [__FILE__], formatter = DummyFormatter.new) - config = Config.load "config/ameba.yml" + config = Config.load config.formatter = formatter config.files = files