samber / git-contrib-graph

📊 Displays a github-like contribution graph, of every contributors of a repository
10 stars 11 forks source link

Clean code: "print" functions should only return data #18

Closed samber closed 5 years ago

samber commented 5 years ago

Only 1 function should be responsible for outputing results, depending of --img, --json or nothing.

Do not call printf or println from print*********() functions.

korrat commented 5 years ago

I would like to pick this up.

Just to be clear, you want those functions to return a struct or an array that contains the information neatly formatted?

samber commented 5 years ago

yes !

Today, we print author contributions into loop iterations. We would like to return aggregated data and being able to call a "formatter" function printing output, depending of command parameters ;)