Cleanup: remove "<pep8 compliant>" from headers
It can be assumed that all scripts comply with basic pep8 formatting regarding white-space, indentation etc. Also remove note in best practices page & update `tests/python/pep8.py`. If we want to exclude some scripts from make format, this can be done by adding them to `ignore_files` in: source/tools/utils_maintenance/autopep8_format_paths.py Or using `# nopep8` for to ignore for individual lines. Ref T98554
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
"""
|
||||
Alembic Export Tests
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
"""
|
||||
Example Usage:
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
"""
|
||||
./blender.bin --background -noaudio --factory-startup --python tests/python/bl_alembic_io_test.py -- --testdir /path/to/lib/tests/alembic
|
||||
"""
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
"""
|
||||
blender -b -noaudio --factory-startup --python tests/python/bl_animation_fcurves.py -- --testdir /path/to/lib/tests/animation
|
||||
"""
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# Test that modules we ship with our Python installation are available
|
||||
|
||||
import bz2
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# simple script to test 'bl_keymap_utils.keymap_hierarchy' contains correct values.
|
||||
|
||||
# Needed for 'bl_keymap_utils.keymap_hierarchy' which inspects tools.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# ./blender.bin --background -noaudio --factory-startup --python tests/python/bl_keymap_validate.py
|
||||
#
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# simple script to enable all addons, and disable
|
||||
|
||||
"""
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# simple script to enable all addons, and disable
|
||||
|
||||
"""
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# Currently this script only generates images from different modifier
|
||||
# combinations and does not validate they work correctly,
|
||||
# this is because we don't get 1:1 match with bmesh.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# Simple script to check mash validate code.
|
||||
# XXX Should be extended with many more "wrong cases"!
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
"""
|
||||
blender -b -noaudio --factory-startup --python tests/python/bl_rigging_symmetrize.py -- --testdir /path/to/lib/tests/animation
|
||||
"""
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# Use for validating our manual interlinking.
|
||||
# ./blender.bin --background -noaudio --python tests/python/bl_rna_manual_reference.py
|
||||
#
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# run this script in the game engine.
|
||||
# or on the command line with...
|
||||
# ./blender.bin --background -noaudio --python tests/python/bl_rst_completeness.py
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# semi-useful script, runs all operators in a number of different
|
||||
# contexts, cheap way to find misc small bugs but is in no way a complete test.
|
||||
#
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
r"""
|
||||
Overview
|
||||
========
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import pathlib
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# To run all tests, use
|
||||
# BLENDER_VERBOSE=1 blender path/to/bool_regression.blend --python path/to/boolean_operator.py -- --run-all-tests
|
||||
# To run one test, use
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# To run the test type: blender -b /path/to/the/blend/file --python path/to/this/py/file -- --run-all-tests -- --verbose
|
||||
# Type the above line in cmd/terminal, for example, look below
|
||||
# blender -b c:\blender-lib\deform_modifiers.blend --python c:\deform_modifiers.py -- --run-all-tests -- --verbose
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import argparse
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import math
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# A framework to run regression tests on mesh modifiers and operators based on howardt's mesh_ops_test.py
|
||||
#
|
||||
# General idea:
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import functools
|
||||
import shutil
|
||||
import pathlib
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8-80 compliant>
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import shutil
|
||||
@@ -22,7 +20,6 @@ import shutil
|
||||
|
||||
# how many lines to read into the file, pep8 comment
|
||||
# should be directly after the license header, ~20 in most cases
|
||||
PEP8_SEEK_COMMENT = 40
|
||||
SKIP_PREFIX = "./tools", "./config", "./extern"
|
||||
SKIP_ADDONS = True
|
||||
FORCE_PEP8_ALL = False
|
||||
@@ -39,22 +36,8 @@ def is_pep8(path):
|
||||
print(path)
|
||||
if open(path, 'rb').read(3) == b'\xef\xbb\xbf':
|
||||
print("\nfile contains BOM, remove first 3 bytes: %r\n" % path)
|
||||
|
||||
# templates don't have a header but should be pep8
|
||||
for d in ("presets", "templates_py", "examples"):
|
||||
if ("%s%s%s" % (os.sep, d, os.sep)) in path:
|
||||
return 1
|
||||
|
||||
f = open(path, 'r', encoding="utf8")
|
||||
for _ in range(PEP8_SEEK_COMMENT):
|
||||
line = f.readline()
|
||||
if line.startswith("# <pep8"):
|
||||
if line.startswith("# <pep8 compliant>"):
|
||||
return 1
|
||||
elif line.startswith("# <pep8-80 compliant>"):
|
||||
return 2
|
||||
f.close()
|
||||
return 0
|
||||
# Currently all scripts assumed to be pep8.
|
||||
return 1
|
||||
|
||||
|
||||
def check_files_flake8(files):
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import os
|
||||
import sys
|
||||
import bpy
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# Used for generating API diffs between releases
|
||||
# ./blender.bin --background -noaudio --python tests/python/rna_info_dump.py
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# Module with function to extract a doctree from an reStructuredText file.
|
||||
# Named 'Mini' because we only parse the minimum data needed to check
|
||||
# Python classes, methods and attributes match up to those in existing modules.
|
||||
|
||||
Reference in New Issue
Block a user