b29d65416481efe627ee832e9f7e6646edcd81a6,tests/python/pants_test/test_utf8_header.py,Utf8HeaderTest,test_file_have_coding_utf8,#Utf8HeaderTest#,16
Before Change
buildroot = get_buildroot();
nonconforming_files = []
for root, dirs, files in os.walk(buildroot):
// build-support contains a lot of external files.
if root.find(os.sep + "build-support") >= 0:
continue
for filename in files:
if filename.endswith(".py"):
path = root + os.sep + filename;
with open(path, "r") as pyFile:
firstLine = pyFile.readline()
if not firstLine.rstrip() == "// coding=utf-8":
nonconforming_files.append(path)
if len(nonconforming_files) > 0:
self.fail("Expected these files to contain first line "// coding=utf8": "
+ str(nonconforming_files))
After Change
return (not tgt.is_synthetic) and tgt.is_original and tgt.has_sources(".py")
nonconforming_files = []
for target in build_file_parser.scan().targets(has_hand_coded_python_files):
for src in target.sources_relative_to_buildroot():
with open(os.path.join(get_buildroot(), src), "r") as python_file:
first_line = python_file.readline()
if not first_line.rstrip() == "// coding=utf-8":
nonconforming_files.append(src)
if len(nonconforming_files) > 0:
self.fail("Expected these files to contain first line "// coding=utf8": "
+ str(nonconforming_files))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: pantsbuild/pants
Commit Name: b29d65416481efe627ee832e9f7e6646edcd81a6
Time: 2014-06-16
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/test_utf8_header.py
Class Name: Utf8HeaderTest
Method Name: test_file_have_coding_utf8
Project Name: sobhe/hazm
Commit Name: b6f3c115b5f20b1f40a4157d99b7b74528ae811a
Time: 2014-08-09
Author: mo_eb_ko@yahoo.com
File Name: hazm/TreebankReader.py
Class Name: TreebankReader
Method Name: trees
Project Name: pantsbuild/pants
Commit Name: ef3f8d221a5afefb01d655448ce7e3f537399810
Time: 2016-01-26
Author: stuhood@gmail.com
File Name: src/python/pants/engine/exp/engine.py
Class Name: LocalSerialEngine
Method Name: reduce