Mishkat al-Masabih 1922
Abu Dharr reported God's messenger as saying, 
“There are three whom God loves and three whom God hates. Those whom God loves are:
a man who, when one came and begged from some people in God’s name, not because of any relationship between him and them, and was refused by them, withdrew from them and gave him something secretly, no one knowing of the gift but God and the one who gave it; 
a man who travelled all night with people till sleep was more desirable to them than anything which could be compared with it, and when they laid down their heads got up and engaged in his devotions and recited verses of the Qur’an; 
and a man who was in a detachment which met the enemy and was routed, yet went straight forward till he was killed or given victory. 
The three whom God hates are an old man who commits fornication, a poor man who is proud, and a rich man who is oppressive.” 

Tirmidhi and Nasa’i transmitted it but Nasa'i did not mention the three whom God hates.
وَعَنْ أَبِي ذَرٍّ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: «ثَلَاثَةٌ يُحِبُّهُمُ اللَّهُ وَثَلَاثَةٌ يُبْغِضُهُمُ اللَّهُ فَأَمَّا الَّذِينَ يُحِبُّهُمُ اللَّهُ فَرَجُلٌ أَتَى قَوْمًا فَسَأَلَهُمْ بِاللَّه وَلم يسألهم بِقرَابَة بَيْنَهُ وَبَيْنَهُمْ فَمَنَعُوهُ فَتَخَلَّفَ رَجُلٌ بِأَعْيَانِهِمْ فَأَعْطَاهُ سِرًّا لَا يَعْلَمُ بِعَطِيَّتِهِ إِلَّا اللَّهُ وَالَّذِي أَعْطَاهُ وَقَوْمٌ سَارُوا لَيْلَتَهُمْ حَتَّى إِذَا كَانَ النَّوْمُ أَحَبَّ إِلَيْهِمْ مِمَّا يُعْدَلُ بِهِ فَوَضَعُوا رُءُوسَهُمْ فَقَامَ يَتَمَلَّقُنِي وَيَتْلُو آيَاتِي وَرَجُلٌ كَانَ فِي سَرِيَّة فلقي الْعَدو فهزموا وَأَقْبل بِصَدْرِهِ حَتَّى يُقْتَلَ أَوْ يُفْتَحَ لَهُ وَالثَّلَاثَةُ الَّذِينَ يُبْغِضُهُمُ اللَّهُ الشَّيْخُ الزَّانِي وَالْفَقِيرُ الْمُخْتَالُ والغني الظلوم» . رَوَاهُ التِّرْمِذِيّ وَالنَّسَائِيّ