|
71 | 71 | verify_ms_transform_included/1, |
72 | 72 | verify_redundant_blank_lines/1, |
73 | 73 | verify_no_boolean_in_comparison/1, |
74 | | - verify_no_operation_on_same_value/1 |
| 74 | + verify_no_operation_on_same_value/1, |
| 75 | + verify_no_receive_without_timeout/1 |
75 | 76 | ]). |
76 | 77 | %% -elvis attribute |
77 | 78 | -export([ |
@@ -1987,6 +1988,21 @@ verify_no_boolean_in_comparison(Config) -> |
1987 | 1988 | ] = |
1988 | 1989 | elvis_core_apply_rule(Config, elvis_style, no_boolean_in_comparison, #{}, FailPath). |
1989 | 1990 |
|
| 1991 | +-spec verify_no_receive_without_timeout(config()) -> any(). |
| 1992 | +verify_no_receive_without_timeout(Config) -> |
| 1993 | + Ext = proplists:get_value(test_file_ext, Config, "erl"), |
| 1994 | + |
| 1995 | + PassPath = "pass_no_receive_without_timeout." ++ Ext, |
| 1996 | + [] = elvis_core_apply_rule(Config, elvis_style, no_receive_without_timeout, #{}, PassPath), |
| 1997 | + |
| 1998 | + FailPath = "fail_no_receive_without_timeout." ++ Ext, |
| 1999 | + [ |
| 2000 | + #{line_num := 6}, |
| 2001 | + #{line_num := 10}, |
| 2002 | + #{line_num := 20} |
| 2003 | + ] = |
| 2004 | + elvis_core_apply_rule(Config, elvis_style, no_receive_without_timeout, #{}, FailPath). |
| 2005 | + |
1990 | 2006 | -spec verify_atom_naming_convention(config()) -> any(). |
1991 | 2007 | verify_atom_naming_convention(Config) -> |
1992 | 2008 | Group = proplists:get_value(group, Config, erl_files), |
@@ -2736,11 +2752,13 @@ verify_elvis_attr(Config, FilenameNoExt) -> |
2736 | 2752 | SrcDirs = elvis_config:dirs(ElvisConfig), |
2737 | 2753 | Ext = proplists:get_value(test_file_ext, Config, "erl"), |
2738 | 2754 |
|
2739 | | - {ok, File} = elvis_test_utils:find_file(SrcDirs, FilenameNoExt ++ "." ++ Ext), |
| 2755 | + FullFilename = FilenameNoExt ++ "." ++ Ext, |
| 2756 | + {ok, File} = elvis_test_utils:find_file(SrcDirs, FullFilename), |
2740 | 2757 |
|
| 2758 | + ct:comment("Checking ~ts", [FullFilename]), |
2741 | 2759 | {ok, #{rules := RuleResults}} = elvis_core:do_rock(File, ElvisConfig), |
2742 | 2760 | [[] = Items || #{items := Items} <- RuleResults], |
2743 | | - true. |
| 2761 | + {comment, ""}. |
2744 | 2762 |
|
2745 | 2763 | -spec is_item_line_sort([elvis_result:file()]) -> [boolean()]. |
2746 | 2764 | is_item_line_sort(Result) -> |
|
0 commit comments