Skip to content

Commit

Permalink
Completely disable auto restyle for generated pyhon files
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Dec 6, 2021
1 parent 5c314b6 commit 0e7bdd1
Show file tree
Hide file tree
Showing 3 changed files with 4,709 additions and 4,727 deletions.
1 change: 1 addition & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ exclude:
- "src/android/CHIPTool/gradlew" # gradle wrapper generated file
- "third_party/android_deps/gradlew" # gradle wrapper generated file
- "src/controller/python/chip/clusters/Objects.py" # generated file, no point to restyle
- "src/controller/python/chip/clusters/CHIPClusters.py" # generated file, no point to restyle


changed_paths:
Expand Down
18 changes: 0 additions & 18 deletions scripts/tools/zap/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,6 @@ def runJavaPrettifier(templates_file, output_dir):
print('google-java-format error:', err)


def runPythonPrettifier(templates_file, output_dir):
try:
jsonData = json.loads(Path(templates_file).read_text())
outputs = [(os.path.join(output_dir, template['output']))
for template in jsonData['templates']]
pyOutputs = list(
filter(lambda filepath: os.path.splitext(filepath)[1] == ".py", outputs))

if not pyOutputs:
return
args = ['autopep8', '--in-place']
args.extend(pyOutputs)
subprocess.check_call(args)
except Exception as err:
print('autopep8 error:', err)


def main():
checkPythonVersion()

Expand All @@ -172,7 +155,6 @@ def main():
prettifiers = [
runClangPrettifier,
runJavaPrettifier,
runPythonPrettifier,
]

for prettifier in prettifiers:
Expand Down
Loading

0 comments on commit 0e7bdd1

Please sign in to comment.