Humayd bin Abdul-Rahman bin Awf reported,

Marwan said to his gatekeeper, "Go, Rafi, to Ibn Abbas and say to him, 'If every one of us who rejoices in what he has done and loves to be praised for what he has not done is to be punished, then we shall all be punished.'"Ibn Abbas replied, "What have you to do with this verse? This verse was revealed only concerning the People of the Book."Then Ibn Abbas recited, "And when Allah took the covenant of those who were given the Scripture, that you make it clear to the people and do not conceal it" [Aal Imran 3:187], and he recited, "Do not think that those who rejoice in what they have done and love to be praised for what they have not done" [Aal Imran 3:188].Ibn Abbas explained, "The Prophet ﷺ asked them about something, and they concealed it from him and told him something else instead. They left having shown him that they had answered his question, and they sought his praise for that, and they rejoiced in what they had achieved by concealing from him what he had asked them about."

Azami 12112

Sahih

عن حميد بن عبد الرحمن بن عوف

أن مروان قال: اذهب يا رافع- لبوابه- إلى ابن عباس فقل: لئن كان كل امرئ منا فرح بما أتى وأحب أن يحمد بما لم يفعل معذبا لنعذبن أجمعون. فقال ابن عباس: ما لكم ولهذه الآية، إنما أنزلت هذه الآية في أهل الكتاب. ثم تلا ابن عباس: {وإذ أخذ الله ميثاق الذين أوتوا الكتاب لتبيننه للناس ولا تكتمونه} هذه الآية، وتلا ابن عباس: {لا تحسبن الذين يفرحون بما أتوا ويحبون أن يحمدوا بما لم يفعلوا} وقال ابن عباس: سألهم النبي ﷺ عن شيء فكتموه إياه، وأخبروه بغيره، فخرجوا قد أروه أن قد أخبروه بما سألهم عنه، واستحمدوا بذلك إليه، وفرحوا بما أتوا من كتمانهم إياه ما سألهم عنه.

الأعظمي 12112صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "Do not think that those who rejoice in what they have done and love to be praised for what they have not done, do not think them safe from punishment, and for them is a painful punishment" (188)
Numbering
Jami al-Kamil 12112 (2nd edition)
Azami 12112