From a9f51689ee90cad036378b6460491d7ad5c6b1cb Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Mon, 7 Oct 2024 07:06:53 +0200 Subject: [PATCH] Version rules from 3 last versions --- src/ameba/rule/documentation/documentation.cr | 1 + src/ameba/rule/documentation/documentation_admonition.cr | 1 + src/ameba/rule/lint/formatting.cr | 1 + src/ameba/rule/lint/literal_assignments_in_expressions.cr | 1 + src/ameba/rule/lint/missing_block_argument.cr | 1 + src/ameba/rule/lint/spec_filename.cr | 1 + src/ameba/rule/lint/typos.cr | 1 + src/ameba/rule/lint/unused_block_argument.cr | 1 + src/ameba/rule/naming/accessor_method_name.cr | 1 + src/ameba/rule/naming/ascii_identifiers.cr | 1 + src/ameba/rule/naming/binary_operator_parameter_name.cr | 1 + src/ameba/rule/naming/block_parameter_name.cr | 1 + src/ameba/rule/naming/filename.cr | 1 + src/ameba/rule/naming/query_bool_methods.cr | 1 + src/ameba/rule/naming/rescued_exceptions_variable_name.cr | 1 + src/ameba/rule/performance/excessive_allocations.cr | 1 + src/ameba/rule/performance/minmax_after_map.cr | 1 + src/ameba/rule/style/parentheses_around_condition.cr | 1 + 18 files changed, 18 insertions(+) diff --git a/src/ameba/rule/documentation/documentation.cr b/src/ameba/rule/documentation/documentation.cr index 45cbfc369..dd1f69456 100644 --- a/src/ameba/rule/documentation/documentation.cr +++ b/src/ameba/rule/documentation/documentation.cr @@ -16,6 +16,7 @@ module Ameba::Rule::Documentation # ``` class Documentation < Base properties do + since_version "1.5.0" enabled false description "Enforces public types to be documented" diff --git a/src/ameba/rule/documentation/documentation_admonition.cr b/src/ameba/rule/documentation/documentation_admonition.cr index 75547750d..5b7993838 100644 --- a/src/ameba/rule/documentation/documentation_admonition.cr +++ b/src/ameba/rule/documentation/documentation_admonition.cr @@ -34,6 +34,7 @@ module Ameba::Rule::Documentation # ``` class DocumentationAdmonition < Base properties do + since_version "1.6.0" description "Reports documentation admonitions" admonitions %w[TODO FIXME BUG] timezone "UTC" diff --git a/src/ameba/rule/lint/formatting.cr b/src/ameba/rule/lint/formatting.cr index ea848ad25..8664261c2 100644 --- a/src/ameba/rule/lint/formatting.cr +++ b/src/ameba/rule/lint/formatting.cr @@ -27,6 +27,7 @@ module Ameba::Rule::Lint # ``` class Formatting < Base properties do + since_version "1.4.0" description "Reports not formatted sources" fail_on_error false end diff --git a/src/ameba/rule/lint/literal_assignments_in_expressions.cr b/src/ameba/rule/lint/literal_assignments_in_expressions.cr index 1851bb0f3..f030d380e 100644 --- a/src/ameba/rule/lint/literal_assignments_in_expressions.cr +++ b/src/ameba/rule/lint/literal_assignments_in_expressions.cr @@ -28,6 +28,7 @@ module Ameba::Rule::Lint include AST::Util properties do + since_version "1.4.0" description "Disallows assignments with literal values in control expressions" end diff --git a/src/ameba/rule/lint/missing_block_argument.cr b/src/ameba/rule/lint/missing_block_argument.cr index 5fd6176a6..26b612538 100644 --- a/src/ameba/rule/lint/missing_block_argument.cr +++ b/src/ameba/rule/lint/missing_block_argument.cr @@ -21,6 +21,7 @@ module Ameba::Rule::Lint # ``` class MissingBlockArgument < Base properties do + since_version "1.4.0" description "Disallows yielding method definitions without block argument" end diff --git a/src/ameba/rule/lint/spec_filename.cr b/src/ameba/rule/lint/spec_filename.cr index 32492a6fa..16316d21f 100644 --- a/src/ameba/rule/lint/spec_filename.cr +++ b/src/ameba/rule/lint/spec_filename.cr @@ -13,6 +13,7 @@ module Ameba::Rule::Lint # ``` class SpecFilename < Base properties do + since_version "1.6.0" description "Enforces spec filenames to have `_spec` suffix" ignored_dirs %w[spec/support spec/fixtures spec/data] ignored_filenames %w[spec_helper] diff --git a/src/ameba/rule/lint/typos.cr b/src/ameba/rule/lint/typos.cr index 8a2506e95..e6117ce12 100644 --- a/src/ameba/rule/lint/typos.cr +++ b/src/ameba/rule/lint/typos.cr @@ -14,6 +14,7 @@ module Ameba::Rule::Lint # ``` class Typos < Base properties do + since_version "1.6.0" description "Reports typos found in source files" bin_path nil, as: String? diff --git a/src/ameba/rule/lint/unused_block_argument.cr b/src/ameba/rule/lint/unused_block_argument.cr index 65a7255d5..6fa5067e2 100644 --- a/src/ameba/rule/lint/unused_block_argument.cr +++ b/src/ameba/rule/lint/unused_block_argument.cr @@ -32,6 +32,7 @@ module Ameba::Rule::Lint # ``` class UnusedBlockArgument < Base properties do + since_version "1.4.0" description "Disallows unused block arguments" end diff --git a/src/ameba/rule/naming/accessor_method_name.cr b/src/ameba/rule/naming/accessor_method_name.cr index 55b9cbd92..31df6141b 100644 --- a/src/ameba/rule/naming/accessor_method_name.cr +++ b/src/ameba/rule/naming/accessor_method_name.cr @@ -37,6 +37,7 @@ module Ameba::Rule::Naming # ``` class AccessorMethodName < Base properties do + since_version "1.6.0" description "Makes sure that accessor methods are named properly" end diff --git a/src/ameba/rule/naming/ascii_identifiers.cr b/src/ameba/rule/naming/ascii_identifiers.cr index f2739b47e..cf5cf5141 100644 --- a/src/ameba/rule/naming/ascii_identifiers.cr +++ b/src/ameba/rule/naming/ascii_identifiers.cr @@ -24,6 +24,7 @@ module Ameba::Rule::Naming # ``` class AsciiIdentifiers < Base properties do + since_version "1.6.0" description "Disallows non-ascii characters in identifiers" ignore_symbols false end diff --git a/src/ameba/rule/naming/binary_operator_parameter_name.cr b/src/ameba/rule/naming/binary_operator_parameter_name.cr index 16cc1ed6b..0a0f2d2cc 100644 --- a/src/ameba/rule/naming/binary_operator_parameter_name.cr +++ b/src/ameba/rule/naming/binary_operator_parameter_name.cr @@ -29,6 +29,7 @@ module Ameba::Rule::Naming # ``` class BinaryOperatorParameterName < Base properties do + since_version "1.6.0" description "Enforces that certain binary operator methods have " \ "their sole parameter named `other`" excluded_operators %w[[] []? []= << >> ` =~ !~] diff --git a/src/ameba/rule/naming/block_parameter_name.cr b/src/ameba/rule/naming/block_parameter_name.cr index 71e6a6a87..9564362e9 100644 --- a/src/ameba/rule/naming/block_parameter_name.cr +++ b/src/ameba/rule/naming/block_parameter_name.cr @@ -25,6 +25,7 @@ module Ameba::Rule::Naming # ``` class BlockParameterName < Base properties do + since_version "1.6.0" description "Disallows non-descriptive block parameter names" min_name_length 3 allow_names_ending_in_numbers true diff --git a/src/ameba/rule/naming/filename.cr b/src/ameba/rule/naming/filename.cr index 1c73b767b..0351221e1 100644 --- a/src/ameba/rule/naming/filename.cr +++ b/src/ameba/rule/naming/filename.cr @@ -9,6 +9,7 @@ module Ameba::Rule::Naming # ``` class Filename < Base properties do + since_version "1.6.0" description "Enforces file names to be in underscored case" end diff --git a/src/ameba/rule/naming/query_bool_methods.cr b/src/ameba/rule/naming/query_bool_methods.cr index a0ecaebb0..0fcd2ee5e 100644 --- a/src/ameba/rule/naming/query_bool_methods.cr +++ b/src/ameba/rule/naming/query_bool_methods.cr @@ -30,6 +30,7 @@ module Ameba::Rule::Naming include AST::Util properties do + since_version "1.4.0" description "Reports boolean properties without the `?` suffix" end diff --git a/src/ameba/rule/naming/rescued_exceptions_variable_name.cr b/src/ameba/rule/naming/rescued_exceptions_variable_name.cr index f1230c517..91ddc56d2 100644 --- a/src/ameba/rule/naming/rescued_exceptions_variable_name.cr +++ b/src/ameba/rule/naming/rescued_exceptions_variable_name.cr @@ -26,6 +26,7 @@ module Ameba::Rule::Naming # ``` class RescuedExceptionsVariableName < Base properties do + since_version "1.6.0" description "Makes sure that rescued exceptions variables are named as expected" allowed_names %w[e ex exception error] end diff --git a/src/ameba/rule/performance/excessive_allocations.cr b/src/ameba/rule/performance/excessive_allocations.cr index e8677d741..9d38bf78f 100644 --- a/src/ameba/rule/performance/excessive_allocations.cr +++ b/src/ameba/rule/performance/excessive_allocations.cr @@ -33,6 +33,7 @@ module Ameba::Rule::Performance include AST::Util properties do + since_version "1.5.0" description "Identifies usage of excessive collection allocations" call_names({ "codepoints" => "each_codepoint", diff --git a/src/ameba/rule/performance/minmax_after_map.cr b/src/ameba/rule/performance/minmax_after_map.cr index 803c84e17..614fc7f36 100644 --- a/src/ameba/rule/performance/minmax_after_map.cr +++ b/src/ameba/rule/performance/minmax_after_map.cr @@ -29,6 +29,7 @@ module Ameba::Rule::Performance include AST::Util properties do + since_version "1.5.0" description "Identifies usage of `min/max/minmax` calls that follow `map`" end diff --git a/src/ameba/rule/style/parentheses_around_condition.cr b/src/ameba/rule/style/parentheses_around_condition.cr index 112d3a64c..45710b8fc 100644 --- a/src/ameba/rule/style/parentheses_around_condition.cr +++ b/src/ameba/rule/style/parentheses_around_condition.cr @@ -28,6 +28,7 @@ module Ameba::Rule::Style # ``` class ParenthesesAroundCondition < Base properties do + since_version "1.4.0" description "Disallows redundant parentheses around control expressions" exclude_ternary false