Skip to content

Commit

Permalink
Cleaned up sources with pre-commit hooks. (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfboismenu authored Jan 9, 2020
1 parent 2642261 commit feae35b
Show file tree
Hide file tree
Showing 110 changed files with 334 additions and 330 deletions.
41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
The Shotgun Pipeline Toolkit Default Configuration
-------------------------------------------------------------------------

Welcome to the Shotgun Pipeline Toolkit default configuration!
Welcome to the Shotgun Pipeline Toolkit default configuration!

For more information, go to the following url:
https://support.shotgunsoftware.com/hc/en-us/articles/115000067493-Integrations-Admin-Guide
Expand Down
1 change: 1 addition & 0 deletions after_project_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"""


def create(sg, project_id, log, **kwargs):
"""
Insert post-project code here
Expand Down
8 changes: 4 additions & 4 deletions core/hooks/README
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
This location is for core hook override files.

The Shotgun Pipeline Toolkit comes with a series of Core Hooks, essentially snippets of python
The Shotgun Pipeline Toolkit comes with a series of Core Hooks, essentially snippets of python
that contain key operations such as copying a file, creating directories etc.

These hooks are part of the platform distribution and are therefore bundled with the code itself.

If you want to provide your own hook implementations, for example control file system permissions
as files are being copied, you can override the core hooks by putting a file with the same
name as the core hook in this location. Sgtk will basically look in this folder first as it is
requesting a core hook - if it doesn't find the core hook here, it will look in its internal
platform location.
name as the core hook in this location. Sgtk will basically look in this folder first as it is
requesting a core hook - if it doesn't find the core hook here, it will look in its internal
platform location.
1 change: 0 additions & 1 deletion core/hooks/pick_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class PickEnvironment(Hook):

def execute(self, context, **kwargs):
"""
The default implementation assumes there are three environments, called shot, asset
Expand Down
1 change: 0 additions & 1 deletion core/roots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ primary:
# description: "High performance storage for fast/frequent texture access"
# shotgun_storage_id: 2
#

15 changes: 7 additions & 8 deletions core/schema/project/assets/asset_type.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
#
# 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
# 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.

# the type of dynamic content
Expand All @@ -15,10 +15,9 @@ type: "shotgun_list_field"
entity_type: "Asset"

# switch this to true if you only want to make folders for
# values that are being used. Note that evaluating this is
# values that are being used. Note that evaluating this is
# expensive and may potentially slow down folder creation.
skip_unused: false
skip_unused: false

# the shotgun field to use for the folder name
field_name: "sg_asset_type"

12 changes: 6 additions & 6 deletions core/schema/project/assets/asset_type/asset.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
#
# 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
# 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.

# the type of dynamic content
Expand All @@ -18,7 +18,7 @@ name: "code"
entity_type: "Asset"

# shotgun filters to apply when getting the list of items
# this should be a list of dicts, each dict containing
# this should be a list of dicts, each dict containing
# three fields: path, relation and values
# (this is std shotgun API syntax)
# any values starting with $ are resolved into path objects
Expand Down
11 changes: 5 additions & 6 deletions core/schema/project/assets/asset_type/asset/step.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
#
# 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
# 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.

# the type of dynamic content
type: "shotgun_step"

# the shotgun field to use for the folder name
name: "short_name"

Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
#
# 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
# 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.

# the type of dynamic content
type: "static"

# defer creation and only create this folder when 3dsmax starts
defer_creation: ["tk-3dsmax", "tk-3dsmaxplus"]

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ type: "static"

# defer creation and only create this folder when Nuke starts
defer_creation: "tk-alias"

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
#
# 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
# 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.

# the type of dynamic content
type: "static"

# defer creation and only create this folder when Houdini starts
defer_creation: "tk-houdini"

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
#
# 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
# 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.

# the type of dynamic content
type: "static"

# defer creation and only create this folder when Maya starts
defer_creation: "tk-maya"

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
#
# 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
# 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.

# the type of dynamic content
type: "static"

# defer creation and only create this folder when Motion Builder starts
defer_creation: "tk-motionbuilder"

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
#
# 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
# 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.

# the type of dynamic content
type: "static"

# defer creation and only create this folder when Nuke starts
defer_creation: "tk-nuke"

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
#
# 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
# 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.

# the type of dynamic content
type: "static"

# defer creation and only create this folder when Photoshop starts
defer_creation: "tk-photoshopcc"

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ type: "static"

# defer creation and only create this folder when Nuke starts
defer_creation: "tk-vred"

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a placeholder to ensure that the parent folder is preserved and not deleted by git.
# Any file named 'placeholder' will not be copied across when folders are created.
# Note: You can which files should be ignored when folders are created in the ignore_files file,
# located in the schema folder.
# located in the schema folder.
Loading

0 comments on commit feae35b

Please sign in to comment.