Deuteronomy 17:2

2 Someone who is living among you might do what is evil in the sight of the LORD your God. It might happen in one of the towns the LORD is giving you. That person is breaking the LORD's covenant.

Deuteronomy 17:2 Meaning and Commentary

Deuteronomy 17:2

If there be found among you, within any of thy gates which the
Lord thy God giveth thee
In any of their cities in the land of Canaan:

man or woman that hath wrought wickedness in the sight of the Lord thy
God:
as all that is wrought is in the sight of the omniscient God; here it means not any kind of wickedness, for there is none lives without committing sin of one sort or another, all which is known to God the searcher of hearts, but such wickedness as is after described:

in transgressing his covenant;
that is, his law, and particularly the first table of it, which respects divine worship, and which is in the nature of a marriage contract or covenant; which, as that is transgressed by adultery committed by either party, so the covenant between God and Israel was transgressed by idolatry, which is spiritual adultery, and going a whoring after other gods, as it follows:

Deuteronomy 17:2 In-Context

1 Suppose an ox or sheep has anything at all wrong with it. Then don't sacrifice it to the LORD your God. He hates it.
2 Someone who is living among you might do what is evil in the sight of the LORD your God. It might happen in one of the towns the LORD is giving you. That person is breaking the LORD's covenant.
3 The person might have worshiped or bowed down to other gods. That person might have bowed down to the sun or moon or stars in the sky. I have commanded you not to do those things.
4 When you hear that people have done something like that, check the matter out carefully. If it's true, an evil thing has been done in Israel. It's something the LORD hates.
5 So take the person who has done that evil thing to your city gate. Put that person to death with stones.
Holy Bible, New International Reader's Version® Copyright © 1995, 1996, 1998 by Biblica.   All rights reserved worldwide.