Skip to content

Commit

Permalink
Merge pull request #3 from ynput/bugfix/ruff-linting-fixes
Browse files Browse the repository at this point in the history
Chore: Ruff linting fixes
  • Loading branch information
iLLiCiTiT authored Oct 1, 2024
2 parents 69b6ddc + 590161a commit 7470812
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 10 deletions.
1 change: 0 additions & 1 deletion client/ayon_royalrender/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
)
from ayon_royalrender.api import Api as rrApi
from ayon_royalrender.rr_job import (
CustomAttribute,
RREnvList,
RRJob,
SubmitterParameter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import attr
import json
import re

import pyblish.api

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def process_submission(self, jobs):
job.PreID = idx_pre_id
if idx_pre_id > 0:
job.WaitForPreIDs.append(idx_pre_id - 1)
# adjust rr pre id for publish job
# adjust rr pre id for publish job
if job.SceneName.endswith("metadata.json"):
idx_pre_id =+ 10
idx_pre_id += 1
Expand Down Expand Up @@ -102,10 +102,10 @@ def get_submission_parameters(self, auto_delete):
if auto_delete:
return [
SubmitterParameter("RequiredMemory", "0"),
SubmitterParameter("PPAyoninjectenvvar", "1~1"),
SubmitterParameter("PPAyoninjectenvvar", "1~1"),
SubmitterParameter("-AutoDeleteEnabled")
]
return [
SubmitterParameter("RequiredMemory", "0"),
SubmitterParameter("PPAyoninjectenvvar", "1~1")
SubmitterParameter("PPAyoninjectenvvar", "1~1")
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import uuid
from datetime import datetime

modPath = rrGlobal.rrModPyrrPath()
modPath = rrGlobal.rrModPyrrPath() # noqa: F821
sys.path.append(modPath)
import libpyRR39 as rr
import libpyRR39 as rr # noqa: E402

logs = []

Expand Down Expand Up @@ -51,8 +51,8 @@ def __init__(self):

def tcp_connect(self):
tcp = rr._rrTCP("")
tcp.setServer(rrGlobal.rrServer(), 7773)
print(f"RR Root Path: {rrGlobal.rootPath()}")
tcp.setServer(rrGlobal.rrServer(), 7773) # noqa: F821
print(f"RR Root Path: {rrGlobal.rootPath()}") # noqa: F821
tcp.setLogin("", "")
print(f"RR TCP Connection: {tcp.connectAndAuthorize()}")
tcp.configGetGlobal()
Expand Down Expand Up @@ -125,7 +125,7 @@ def _get_job(self):
logs.append("jid:{}".format(int(args.jid)))

if not self.tcp.jobList_GetInfo(int(args.jid)):
print("Error jobList_GetInfo: " + tcp.errorMessage())
print("Error jobList_GetInfo: " + self.tcp.errorMessage())
sys.exit()
job = self.tcp.jobs.getJobSend(int(args.jid))
self.tcp.jobs.setPathTargetOS(job.sceneOS)
Expand Down
74 changes: 74 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

# Same as Black.
line-length = 79
indent-width = 4

[lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F", "W"]
ignore = []

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false

# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"

0 comments on commit 7470812

Please sign in to comment.