Cleaned up sources with pre-commit hooks. (#69)

This commit is contained in:
Jean-François Boismenu 2020-01-09 07:43:26 -05:00 коммит произвёл GitHub
Родитель 2642261598
Коммит feae35bf4e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
110 изменённых файлов: 334 добавлений и 330 удалений

41
.pre-commit-config.yaml Normal file
Просмотреть файл

@ -0,0 +1,41 @@
# Copyright (c) 2019 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
# not expressly granted therein are reserved by Shotgun Software Inc.
# Styles the code properly
# Exclude the UI files, as they are auto-generated.
exclude: "ui\/.*py$"
# List of super useful formatters.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
# Ensures the code is syntaxically correct
- id: check-ast
language_version: python3
# Ensures a yaml file is properly formatted
- id: check-yaml
# Ensures a file name will resolve on all platform
- id: check-case-conflict
# Checks files with the execute bit set have shebangs
- id: check-executables-have-shebangs
# Ensure there's no incomplete merges
- id: check-merge-conflict
# Adds an empty line if missing at the end of a file.
- id: end-of-file-fixer
# Makes sure requirements.txt is properly formatted
- id: requirements-txt-fixer
# Removes trailing whitespaces.
- id: trailing-whitespace
# Leave black at the bottom so all touchups are done before it is run.
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
language_version: python3

Просмотреть файл

@ -23,6 +23,7 @@ the following keyword arguments:
""" """
def create(sg, project_id, log, **kwargs): def create(sg, project_id, log, **kwargs):
""" """
Insert post-project code here Insert post-project code here

Просмотреть файл

@ -16,7 +16,6 @@ from tank import Hook
class PickEnvironment(Hook): class PickEnvironment(Hook):
def execute(self, context, **kwargs): def execute(self, context, **kwargs):
""" """
The default implementation assumes there are three environments, called shot, asset The default implementation assumes there are three environments, called shot, asset

Просмотреть файл

@ -67,4 +67,3 @@ primary:
# description: "High performance storage for fast/frequent texture access" # description: "High performance storage for fast/frequent texture access"
# shotgun_storage_id: 2 # shotgun_storage_id: 2
# #

Просмотреть файл

@ -21,4 +21,3 @@ skip_unused: false
# the shotgun field to use for the folder name # the shotgun field to use for the folder name
field_name: "sg_asset_type" field_name: "sg_asset_type"

Просмотреть файл

@ -13,4 +13,3 @@ type: "shotgun_step"
# the shotgun field to use for the folder name # the shotgun field to use for the folder name
name: "short_name" name: "short_name"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when 3dsmax starts # defer creation and only create this folder when 3dsmax starts
defer_creation: ["tk-3dsmax", "tk-3dsmaxplus"] defer_creation: ["tk-3dsmax", "tk-3dsmaxplus"]

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Nuke starts # defer creation and only create this folder when Nuke starts
defer_creation: "tk-alias" defer_creation: "tk-alias"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Houdini starts # defer creation and only create this folder when Houdini starts
defer_creation: "tk-houdini" defer_creation: "tk-houdini"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Maya starts # defer creation and only create this folder when Maya starts
defer_creation: "tk-maya" defer_creation: "tk-maya"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Motion Builder starts # defer creation and only create this folder when Motion Builder starts
defer_creation: "tk-motionbuilder" defer_creation: "tk-motionbuilder"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Nuke starts # defer creation and only create this folder when Nuke starts
defer_creation: "tk-nuke" defer_creation: "tk-nuke"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Photoshop starts # defer creation and only create this folder when Photoshop starts
defer_creation: "tk-photoshopcc" defer_creation: "tk-photoshopcc"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Nuke starts # defer creation and only create this folder when Nuke starts
defer_creation: "tk-vred" defer_creation: "tk-vred"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when 3dsmax starts # defer creation and only create this folder when 3dsmax starts
defer_creation: ["tk-3dsmax", "tk-3dsmaxplus"] defer_creation: ["tk-3dsmax", "tk-3dsmaxplus"]

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Maya starts # defer creation and only create this folder when Maya starts
defer_creation: "tk-alias" defer_creation: "tk-alias"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Houdini starts # defer creation and only create this folder when Houdini starts
defer_creation: "tk-houdini" defer_creation: "tk-houdini"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Maya starts # defer creation and only create this folder when Maya starts
defer_creation: "tk-maya" defer_creation: "tk-maya"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Motion Builder starts # defer creation and only create this folder when Motion Builder starts
defer_creation: "tk-motionbuilder" defer_creation: "tk-motionbuilder"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Nuke starts # defer creation and only create this folder when Nuke starts
defer_creation: "tk-nuke" defer_creation: "tk-nuke"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Photoshop starts # defer creation and only create this folder when Photoshop starts
defer_creation: "tk-photoshopcc" defer_creation: "tk-photoshopcc"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Maya starts # defer creation and only create this folder when Maya starts
defer_creation: "tk-vred" defer_creation: "tk-vred"

Просмотреть файл

@ -23,4 +23,3 @@ entity_type: "Sequence"
# (this is std shotgun API syntax) # (this is std shotgun API syntax)
# any values starting with $ are resolved into path objects # any values starting with $ are resolved into path objects
filters: [ { "path": "project", "relation": "is", "values": [ "$project" ] } ] filters: [ { "path": "project", "relation": "is", "values": [ "$project" ] } ]

Просмотреть файл

@ -13,4 +13,3 @@ type: "shotgun_step"
# the shotgun field to use for the folder name # the shotgun field to use for the folder name
name: "short_name" name: "short_name"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when 3dsmax starts # defer creation and only create this folder when 3dsmax starts
defer_creation: ["tk-3dsmax", "tk-3dsmaxplus"] defer_creation: ["tk-3dsmax", "tk-3dsmaxplus"]

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Houdini starts # defer creation and only create this folder when Houdini starts
defer_creation: "tk-houdini" defer_creation: "tk-houdini"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Maya starts # defer creation and only create this folder when Maya starts
defer_creation: "tk-maya" defer_creation: "tk-maya"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Motion Builder starts # defer creation and only create this folder when Motion Builder starts
defer_creation: "tk-motionbuilder" defer_creation: "tk-motionbuilder"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Nuke starts # defer creation and only create this folder when Nuke starts
defer_creation: "tk-nuke" defer_creation: "tk-nuke"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Photoshop starts # defer creation and only create this folder when Photoshop starts
defer_creation: "tk-photoshopcc" defer_creation: "tk-photoshopcc"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when 3dsmax starts # defer creation and only create this folder when 3dsmax starts
defer_creation: ["tk-3dsmax", "tk-3dsmaxplus"] defer_creation: ["tk-3dsmax", "tk-3dsmaxplus"]

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Houdini starts # defer creation and only create this folder when Houdini starts
defer_creation: "tk-houdini" defer_creation: "tk-houdini"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Maya starts # defer creation and only create this folder when Maya starts
defer_creation: "tk-maya" defer_creation: "tk-maya"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Motion Builder starts # defer creation and only create this folder when Motion Builder starts
defer_creation: "tk-motionbuilder" defer_creation: "tk-motionbuilder"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Nuke starts # defer creation and only create this folder when Nuke starts
defer_creation: "tk-nuke" defer_creation: "tk-nuke"

Просмотреть файл

@ -13,4 +13,3 @@ type: "static"
# defer creation and only create this folder when Photoshop starts # defer creation and only create this folder when Photoshop starts
defer_creation: "tk-photoshopcc" defer_creation: "tk-photoshopcc"

1
env/includes/settings/tk-houdini.yml поставляемый
Просмотреть файл

@ -118,4 +118,3 @@ settings.tk-houdini.shot_step:
- {app_instance: tk-multi-workfiles2, name: File Save...} - {app_instance: tk-multi-workfiles2, name: File Save...}
- {app_instance: tk-multi-publish2, name: Publish...} - {app_instance: tk-multi-publish2, name: Publish...}
location: '@engines.tk-houdini.location' location: '@engines.tk-houdini.location'

Просмотреть файл

@ -60,4 +60,3 @@ settings.tk-multi-launchapp.motionbuilder:
windows_path: "@path.windows.motionbuilder" windows_path: "@path.windows.motionbuilder"
menu_name: MotionBuilder menu_name: MotionBuilder
location: "@apps.tk-multi-launchapp.location" location: "@apps.tk-multi-launchapp.location"

2
env/includes/settings/tk-multi-loader2.yml поставляемый
Просмотреть файл

@ -363,5 +363,3 @@ settings.tk-multi-loader2.vred:
actions_hook: "{engine}/tk-multi-loader2/basic/scene_actions.py" actions_hook: "{engine}/tk-multi-loader2/basic/scene_actions.py"
publish_filters: [["sg_status_list", "is_not", null]] publish_filters: [["sg_status_list", "is_not", null]]
location: "@apps.tk-multi-loader2.location" location: "@apps.tk-multi-loader2.location"

1
env/includes/settings/tk-multi-publish2.yml поставляемый
Просмотреть файл

@ -555,4 +555,3 @@ settings.tk-multi-publish2.vred.asset_step:
settings: {} settings: {}
help_url: *help_url help_url: *help_url
location: "@apps.tk-multi-publish2.location" location: "@apps.tk-multi-publish2.location"

Просмотреть файл

@ -11,8 +11,8 @@
from tank import Hook from tank import Hook
from tank import TankError from tank import TankError
class SnapshotHistoryPostQuickdaily(Hook):
class SnapshotHistoryPostQuickdaily(Hook):
def execute(self, mov_path, version_id, comments, **kwargs): def execute(self, mov_path, version_id, comments, **kwargs):
app = self.parent app = self.parent
# get app # get app

Просмотреть файл

@ -12,6 +12,7 @@ import sgtk
HookBaseClass = sgtk.get_hook_baseclass() HookBaseClass = sgtk.get_hook_baseclass()
class BeforeRegisterCommand(HookBaseClass): class BeforeRegisterCommand(HookBaseClass):
""" """
Before Register Command Hook Before Register Command Hook
@ -20,6 +21,7 @@ class BeforeRegisterCommand(HookBaseClass):
the parent engine. Note: this hook is only run for Software entity the parent engine. Note: this hook is only run for Software entity
launchers. launchers.
""" """
def determine_engine_instance_name(self, software_version, engine_instance_name): def determine_engine_instance_name(self, software_version, engine_instance_name):
""" """
Hook method to intercept SoftwareLauncher and engine instance name data prior to Hook method to intercept SoftwareLauncher and engine instance name data prior to
@ -42,4 +44,3 @@ class BeforeRegisterCommand(HookBaseClass):
engine_instance_name = "tk-nukestudio" engine_instance_name = "tk-nukestudio"
return engine_instance_name return engine_instance_name