Scottish leader cleared of breaching ministerial code