From 70ee294079758a3e4de897d758414399a39a39e4 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 21 Aug 2024 22:57:36 +0200 Subject: [PATCH] elvis.config: Fix file syntax, set vim mode, disable many tests Let's disable the tests that would require major changes in existing ejabberd source code, and fixing them would produce a curtain of changes that would difficult using git blame and git log, but provide minimal benefits. Don't check erlang header files by now. Don't check rebar.config because it has customizations that must be parsed by rebar.config.script to have suitable syntax. --- elvis.config | 56 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/elvis.config b/elvis.config index c679b7e2f02..074e1301018 100644 --- a/elvis.config +++ b/elvis.config @@ -5,38 +5,54 @@ {config, [#{dirs => ["src"], filter => "*.erl", + ignore => ['ELDAPv3', eldap_filter_yecc], ruleset => erl_files, - rules => [{elvis_style, line_length, #{limit => 100, - skip_comments => false}}, + rules => [{elvis_text_style, line_length, #{limit => 1000, skip_comments => false}}, {elvis_text_style, no_tabs, disable}, + {elvis_style, atom_naming_convention, disable}, + {elvis_style, consistent_variable_casing, disable}, + {elvis_style, dont_repeat_yourself, #{min_complexity => 70}}, + {elvis_style, export_used_types, disable}, + {elvis_style, function_naming_convention, disable}, + {elvis_style, god_modules, #{limit => 300}}, + {elvis_style, invalid_dynamic_call, disable}, + {elvis_style, macro_module_names, disable}, + {elvis_style, macro_names, disable}, + {elvis_style, max_function_arity, disable}, % #{max_arity => 15}}, + {elvis_style, nesting_level, disable}, + {elvis_style, no_author, disable}, + {elvis_style, no_catch_expressions, disable}, {elvis_style, no_debug_call, disable}, + {elvis_style, no_if_expression, disable}, + {elvis_style, no_import, disable}, + {elvis_style, no_match_in_condition, disable}, + {elvis_style, no_nested_try_catch, disable}, + {elvis_style, no_single_clause_case, disable}, + {elvis_style, no_spec_with_records, disable}, + {elvis_style, no_throw, disable}, {elvis_style, operator_spaces, disable}, - {elvis_style, invalid_dynamic_call, disable}, - {elvis_style, variable_naming_convention, #{ regex => ".*" }}, - {elvis_style, dont_repeat_yourself, #{min_complexity => 20}} - ] + {elvis_style, param_pattern_matching, disable}, + {elvis_style, private_data_types, disable}, + {elvis_style, variable_naming_convention, disable} + ] }, + + %#{dirs => ["include"], + % filter => "*.hrl", + % ruleset => hrl_files}, + #{dirs => ["."], filter => "Makefile.in", ruleset => makefiles, - rules => [{elvis_style, line_length, #{limit => 100, - skip_comments => false}}, - {elvis_style, no_tabs, disable}, - {elvis_style, dont_repeat_yourself, #{min_complexity => 20}} - ] - }, - #{dirs => ["."], - filter => "rebar.config", - ruleset => rebar_config, - rules => [{elvis_style, line_length, #{limit => 100, + rules => [{elvis_text_style, line_length, #{limit => 400, skip_comments => false}}, - {elvis_style, no_tabs, disable}, - {elvis_style, dont_repeat_yourself, #{min_complexity => 20}} - ] + {elvis_style, dont_repeat_yourself, #{min_complexity => 20}} + ] } - } ] } ] } ]. + +%% vim: set filetype=erlang tabstop=8: