It all depends on your climate. If it gets cold and freezes in your area then there is no way I'd run water lines in the attic.
Code basically states type of material to be used, pipe sizing, depth of pipe for bural, pipe protection. Hoowever depending on your local code it may restrict lines in the attic