Vlad you should NEVER do anything that violates the code. You are the EC on the job and it's your job not the GC's job to see the job is done right and to code.
I had a GC try to get me do make splices and bury them in the wall so we wouldn't have to cut the drywall. He got my answer when I pulled out the sawzall and started cutting away.
In your case, what would happen if the inspector missed the lights in the closets and a fire started after a family moved in? You did the right thing by bringing it to his attention, but you should not have installed them in the first place.