Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Hi! I cleaned up your code for you! #12

Open
wants to merge 1 commit into from

1 participant

@GunioRobot

Hi there!

This is WhitespaceBot. I'm an open-source robot that removes trailing white space in your code, and gives you a gitignore file if you didn't have one!

Why whitespace? Whitespace is an eyesore for developers who use text editors with dark themes. It's not a huge deal, but it's a bit annoying if you use Vim in a terminal. Really, I'm just a proof of concept - GitHub's V3 API allows robots to automatically improve open source projects, and that's really cool. Hopefully, somebody, maybe you!, will fork me and make me even more useful. My owner is funding a bounty to anybody who can add security fixing features to me.

I've only cleaned your most popular project, and I've added you to a list of users not to contact again, so you won't get any more pull requests from me unless you ask. If I'm misbehaving, please email my owner and tell him to turn me off! If this is pull request is of no use to you, please just ignore it.

Thanks!
WhiteSpacebot from Gun.io.

@mazenharake
Owner

Thank you GunioRobot :P Nice botty :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 31, 2011
  1. Remove whitespace [Gun.io WhitespaceBot]

    Gun.io Whitespace Robot authored
This page is out of date. Refresh to see the latest.
View
2  entop
@@ -15,7 +15,7 @@
##==============================================================================
## Author: Mazen Harake
## Shell script for running entop. See the function usage() for instructions.
-##==============================================================================
+##==============================================================================
#!/bin/bash
TARGETNODE=
NAME="-sname entop"
View
2  src/entop.erl
@@ -49,7 +49,7 @@ control(ViewPid) ->
end.
do_exit(ViewPid) ->
- exit(ViewPid, normal),
+ exit(ViewPid, normal),
application:stop(cecho),
halt().
View
2  src/entop.hrl
@@ -13,7 +13,7 @@
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%==============================================================================
-%% Records
+%% Records
-record(state, { callback = entop_format, remote_module = entop_collector,
columns, cbstate, node, otp_version, erts_version, os_fam, os,
os_version, node_flags, interval = 1000, reverse_sort = true,
View
6 src/entop_collector.erl
@@ -34,8 +34,8 @@ get_data() ->
{memory, erlang:memory([system, atom, atom_used, binary, code, ets])}
],
Self = self(),
- ProcessesProplist = [ [ {pid,erlang:pid_to_list(P)} | erlang:process_info(P) ] ||
- P <- erlang:processes(), P /= Self ],
-
+ ProcessesProplist = [ [ {pid,erlang:pid_to_list(P)} | erlang:process_info(P) ] ||
+ P <- erlang:processes(), P /= Self ],
+
{ok, HeaderProplist, ProcessesProplist}.
View
10 src/entop_format.erl
@@ -52,7 +52,7 @@ header(SystemInfo, State) ->
Uptime = millis2uptimestr(element(1, proplists:get_value(uptime, SystemInfo, 0))),
LocalTime = local2str(element(2, proplists:get_value(local_time, SystemInfo))),
PingTime = element(1,timer:tc(net_adm, ping, [State#state.node])) div 1000,
- Row1 = io_lib:format("Time: local time ~s, up for ~s, ~pms latency, ",
+ Row1 = io_lib:format("Time: local time ~s, up for ~s, ~pms latency, ",
[LocalTime, Uptime, PingTime]),
PTotal = proplists:get_value(process_count, SystemInfo),
@@ -60,7 +60,7 @@ header(SystemInfo, State) ->
RedTotal = element(2,proplists:get_value(reduction_count, SystemInfo)),
PMemUsed = proplists:get_value(process_memory_used, SystemInfo),
PMemTotal = proplists:get_value(process_memory_total, SystemInfo),
- Row2 = io_lib:format("Processes: total ~p (RQ ~p) at ~p RpI using ~s (~s allocated)",
+ Row2 = io_lib:format("Processes: total ~p (RQ ~p) at ~p RpI using ~s (~s allocated)",
[PTotal, RQueue, RedTotal, mem2str(PMemUsed), mem2str(PMemTotal)]),
MemInfo = proplists:get_value(memory, SystemInfo),
@@ -76,7 +76,7 @@ header(SystemInfo, State) ->
{ok, [ lists:flatten(Row) || Row <- [Row1, Row2, Row3, Row4] ], State}.
%% Column Specific Callbacks
-row([{pid,_}|undefined], State) ->
+row([{pid,_}|undefined], State) ->
{ok, skip, State};
row(ProcessInfo, State) ->
Pid = proplists:get_value(pid, ProcessInfo),
@@ -90,7 +90,7 @@ row(ProcessInfo, State) ->
Queue = proplists:get_value(message_queue_len, ProcessInfo, 0),
Heap = proplists:get_value(heap_size, ProcessInfo, 0),
Stack = proplists:get_value(stack_size, ProcessInfo, 0),
- HeapTot = proplists:get_value(total_heap_size, ProcessInfo, 0),
+ HeapTot = proplists:get_value(total_heap_size, ProcessInfo, 0),
{ok, {Pid, RegName, Reductions, Queue, Heap, Stack, HeapTot}, State}.
mem2str(Mem) ->
@@ -99,7 +99,7 @@ mem2str(Mem) ->
Mem >= 0 -> io_lib:format("~.1fb",[Mem/1.0])
end.
-millis2uptimestr(Millis) ->
+millis2uptimestr(Millis) ->
SecTime = Millis div 1000,
Days = ?R(SecTime div ?SECONDS_PER_DAY,3),
Hours = ?R((SecTime rem ?SECONDS_PER_DAY) div ?SECONDS_PER_HOUR,2),
View
2  src/entop_net.erl
@@ -36,4 +36,4 @@ reconnect(Parent, Node) ->
timer:sleep(1000),
reconnect(Parent, Node)
end.
-
+
View
20 src/entop_view.erl
@@ -75,7 +75,7 @@ init(Parent, State) ->
init_callback(State) ->
case (State#state.callback):init(State#state.node) of
- {ok, {Columns, DefaultSort}, CBState} when DefaultSort =< length(Columns)
+ {ok, {Columns, DefaultSort}, CBState} when DefaultSort =< length(Columns)
andalso DefaultSort >= 1 ->
NSort = DefaultSort;
{ok, {Columns, _}, CBState} ->
@@ -93,14 +93,14 @@ print_nodeinfo(State) ->
false -> cecho:addstr("(Disconnected)");
true -> cecho:addstr("(Connected)")
end,
- Head = io_lib:format(" (~s/~s) ~p (~p ~s)~s",
- [State#state.otp_version,
+ Head = io_lib:format(" (~s/~s) ~p (~p ~s)~s",
+ [State#state.otp_version,
State#state.erts_version, State#state.os_fam,
State#state.os, OsVers, flags2str(State#state.node_flags)]),
ok = cecho:addstr(lists:flatten(Head)).
flags2str([]) -> [];
-flags2str([{cpus, N}|Rest]) ->
+flags2str([{cpus, N}|Rest]) ->
[" CPU:"++integer_to_list(N)|flags2str(Rest)];
flags2str([{smp, true}|Rest]) ->
[" SMP"|flags2str(Rest)];
@@ -168,11 +168,11 @@ update_screen(Time, HeaderData, RowDataList, State) ->
draw_title_bar(State),
print_showinfo(State, Time),
{Headers, State1} = process_header_data(HeaderData, State),
- lists:foldl(fun(Header, Y) ->
+ lists:foldl(fun(Header, Y) ->
cecho:hline($ , ?MAX_HLINE),
cecho:mvaddstr(Y, 0, Header), Y + 1
end, 1, Headers),
- {RowList, State2} = process_row_data(RowDataList, State1),
+ {RowList, State2} = process_row_data(RowDataList, State1),
SortedRowList = sort(RowList, State),
{Y, _} = cecho:getmaxyx(),
StartY = (Y-(Y-7)),
@@ -199,7 +199,7 @@ print_showinfo(State, RoundTripTime) ->
cecho:hline($ , ?MAX_HLINE),
ColName = element(1,lists:nth(State#state.sort, State#state.columns)),
SortName = if State#state.reverse_sort -> "Descending"; true -> "Ascending" end,
- Showing = io_lib:format("Interval ~pms, Sorting on ~p (~s), Retrieved in ~pms",
+ Showing = io_lib:format("Interval ~pms, Sorting on ~p (~s), Retrieved in ~pms",
[State#state.interval, ColName, SortName, RoundTripTime div 1000]),
cecho:mvaddstr(5,0, lists:flatten(Showing)).
@@ -215,7 +215,7 @@ prd([], State, Acc) ->
prd([RowData|Rest], State, Acc) ->
case (State#state.callback):row(RowData, State#state.cbstate) of
{ok, skip, NCBState} ->
- prd(Rest, State#state{ cbstate = NCBState }, Acc);
+ prd(Rest, State#state{ cbstate = NCBState }, Acc);
{ok, Row, NCBState} ->
prd(Rest, State#state{ cbstate = NCBState }, [Row|Acc])
end.
@@ -249,8 +249,8 @@ update_row([RowColValue|Rest], [{_,Width,Options}|RestColumns], LineNumber, Offs
end,
cecho:mvaddstr(LineNumber, Offset, Aligned),
update_row(Rest, RestColumns, LineNumber, Offset+Width+1).
-
-
+
+
Something went wrong with that request. Please try again.