It is reported that Al-A’mash – Allāh have mercy on him – said:
They (the Salaf) never used to ask about [the religious condition of ] a man after knowing three things about him: where and upon whom he entered, where and with whom he walked, and the close company he kept.
Meaning: Knowing these things about a man is more than sufficient for knowing whether he is following the right path on the Sunnah or not.
Ibn Battah, Al-Ibānah article 419.