Matt 7:1-2 Judge not lest you be judged. For in the same way you judge others, you will be judged, and with the measure you use, it will be measured to you.
1 Corinthians 2:13-16 When we tell you this, we do not use words of human wisdom. We speak words given to us by the Spirit, using the Spirit's words to explain spiritual truths. The man without the Spirit does not accept the things that come from the Spirit of God, for they are foolishness to him, and he cannot understand them, because they are spiritually discerned. The spiritual man makes judgments about all things, but he himself is not subject to any man's judgment: For "who has known the mind of the LORD that he may instruct Him?" But we have the mind of Christ.
I don't know about discernment but when I read these verses in my kjv it seems to me to be saying that IF you truly have the holy spirit when you judge things it is not the material man that is doing the judging; but the Holy spirit that in in you that is doing the judging. I try to not interpret things "BUT" like when scripture says "Judge not that ye be not judged" I think that is refering to not judging someone to be a worse sinner than yourself; as judging them to hell. It is OK to judge someone as being someone that you do not want to hang with, Specially if they have a hammer in their hand and you know your toe is going to be hurting.