Skip to content

Commit 4ffea0e

Browse files
authored
feat(linter, api-nodes): add pylint for comfy_api_nodes folder (#10157)
1 parent 1395bce commit 4ffea0e

File tree

5 files changed

+81
-5
lines changed

5 files changed

+81
-5
lines changed

.github/workflows/ruff.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,28 @@ jobs:
2121

2222
- name: Run Ruff
2323
run: ruff check .
24+
25+
pylint:
26+
name: Run Pylint
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.12'
37+
38+
- name: Install requirements
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
42+
pip install -r requirements.txt
43+
44+
- name: Install Pylint
45+
run: pip install pylint
46+
47+
- name: Run Pylint
48+
run: pylint comfy_api_nodes

comfy_api_nodes/apis/__init__.py

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

comfy_api_nodes/apis/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ async def upload_file(
535535
request_method="PUT",
536536
request_url=upload_url,
537537
response_status_code=e.status if hasattr(e, "status") else None,
538-
response_headers=dict(e.headers) if getattr(e, "headers") else None,
538+
response_headers=dict(e.headers) if hasattr(e, "headers") else None,
539539
response_content=None,
540540
error_message=f"{type(e).__name__}: {str(e)}",
541541
)

comfy_api_nodes/apis/rodin_api.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,3 @@ class RodinResourceItem(BaseModel):
5252

5353
class Rodin3DDownloadResponse(BaseModel):
5454
list: List[RodinResourceItem] = Field(..., description="Source List")
55-
56-
57-
58-

pyproject.toml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,57 @@ lint.select = [
2222
"F",
2323
]
2424
exclude = ["*.ipynb", "**/generated/*.pyi"]
25+
26+
[tool.pylint]
27+
master.py-version = "3.9"
28+
master.extension-pkg-allow-list = [
29+
"pydantic",
30+
]
31+
reports.output-format = "colorized"
32+
similarities.ignore-imports = "yes"
33+
messages_control.disable = [
34+
"missing-module-docstring",
35+
"missing-class-docstring",
36+
"missing-function-docstring",
37+
"line-too-long",
38+
"too-few-public-methods",
39+
"too-many-public-methods",
40+
"too-many-instance-attributes",
41+
"too-many-positional-arguments",
42+
"broad-exception-raised",
43+
"too-many-lines",
44+
"invalid-name",
45+
"unused-argument",
46+
"broad-exception-caught",
47+
"consider-using-with",
48+
"fixme",
49+
"too-many-statements",
50+
"too-many-branches",
51+
"too-many-locals",
52+
"too-many-arguments",
53+
"duplicate-code",
54+
"abstract-method",
55+
"superfluous-parens",
56+
"arguments-differ",
57+
"redefined-builtin",
58+
"unnecessary-lambda",
59+
"dangerous-default-value",
60+
# next warnings should be fixed in future
61+
"bad-classmethod-argument", # Class method should have 'cls' as first argument
62+
"wrong-import-order", # Standard imports should be placed before third party imports
63+
"logging-fstring-interpolation", # Use lazy % formatting in logging functions
64+
"ungrouped-imports",
65+
"unnecessary-pass",
66+
"unidiomatic-typecheck",
67+
"unnecessary-lambda-assignment",
68+
"bad-indentation",
69+
"no-else-return",
70+
"no-else-raise",
71+
"invalid-overridden-method",
72+
"unused-variable",
73+
"pointless-string-statement",
74+
"inconsistent-return-statements",
75+
"import-outside-toplevel",
76+
"reimported",
77+
"redefined-outer-name",
78+
]

0 commit comments

Comments
 (0)