Skip to content

Commit

Permalink
[Closes #179] Correctly print and quote lines with cyrilic chars.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfacorro committed Nov 25, 2014
1 parent a0bbe59 commit 17880eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/elvis_style.erl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
no_spec_with_records/3
]).

-define(LINE_LENGTH_MSG, "Line ~p is too long: ~p.").
-define(LINE_LENGTH_MSG, "Line ~p is too long: ~s.").

-define(NO_TABS_MSG, "Line ~p has a tab at column ~p.").

Expand Down
6 changes: 5 additions & 1 deletion test/examples/fail_line_length.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
function_2/0,
function_3/0,
function_4/0,
function_5/0
function_5/0,
function_6/2
]).

function_1() ->
Expand All @@ -23,3 +24,6 @@ function_4() ->
function_5() ->
io:format("This line is 90 characters long and should be detected ~p!!!!!!!!!!!!!!!!!!", [yeah]),
io:format("This line is 90 characters long and should be detected ~p and these two escaped ~p!!!!!!!!!!!!!!!!!!", [yeah, no]).

function_6(Config, AntPositions)->
gb_trees:from_orddict([{Pos, #{pos => Pos, state => model:random_ant_state(Config)}} || Pos <- lists:sort(AntPositions)]). % {Pozycja, CałyAgent} - ew. do zmiany, jest zbalansowany [DG]
7 changes: 6 additions & 1 deletion test/style_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ verify_line_length_rule(_Config) ->
File = "fail_line_length.erl",
{ok, Path} = elvis_test_utils:find_file(SrcDirs, File),

[_, _, _, _] = elvis_style:line_length(ElvisConfig, Path, #{limit => 80}).
[_, _, _, _, Utf] =
elvis_style:line_length(ElvisConfig, Path, #{limit => 80}),

#{info := Info, message := Msg} = Utf,
<<"Line 29 is too long: gb_trees:from_orddict(", _/binary>> =
list_to_binary(io_lib:format(Msg, Info)).

-spec verify_no_tabs_rule(config()) -> any().
verify_no_tabs_rule(_Config) ->
Expand Down

0 comments on commit 17880eb

Please sign in to comment.