Support excludedpackages and format code